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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ecf969d277c9c380a85d39c972fd99951dc1371c | 256 | py | Python | python/requests/python_requests_library_guide/set_cookie.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/requests/python_requests_library_guide/set_cookie.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/requests/python_requests_library_guide/set_cookie.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import requests
s = requests.Session()
# 쿠키값 sessionkie를 123456789으로 설정
s.get('https://httpbin.org/cookies/set/sessioncookie/123456789')
# 내 쿠키값 가져오기
r = s.get('https://httpbin.org/cookies')
print(r.text)
# '{"cookies": {"sessioncookie": "123456789"}}'
| 21.333333 | 64 | 0.710938 |
a65682627380ca763287b167d2edc08522c75a03 | 389 | py | Python | Packs/PHash/Scripts/PHash/PHash.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PHash/Scripts/PHash/PHash.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PHash/Scripts/PHash/PHash.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
import imagehash
from CommonServerPython import * # noqa: F401
from PIL import Image
ImageID = demisto.args()['image']
ImageFilePath = demisto.getFilePath(ImageID)
hash = imagehash.phash(Image.open(ImageFilePath['path']))
context = {
"PHash": str(hash)
}
command_result... | 24.3125 | 57 | 0.768638 |
5be6d51cc39f06beb439c234c4f993b78f3b7ac2 | 293 | py | Python | algorithms/implementation/angry_professor.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/implementation/angry_professor.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/implementation/angry_professor.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
T = int(sys.stdin.readline())
for _ in range(T):
N, K = list(map(int, sys.stdin.readline().split()))
X = list(map(int, sys.stdin.readline().split()))
print('YES' if sum(1 for x in X if x <= 0) < K else 'NO') | 26.636364 | 65 | 0.532423 |
f3c9446e4dde13e8b75b75b094a48c7a9f2f6aa4 | 94 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.5-ex-string.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.5-ex-string.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-003/pg-3.5-ex-string.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | s = '100'
print(s)
s = 'abc1234-09232<>?323'
print(s)
s = 'abc 123'
print(s)
s = ' '
print(s)
| 10.444444 | 25 | 0.553191 |
9474089d2e84c2a30d93fa7ed7588fd9fb3e4642 | 1,802 | py | Python | PINp/2014/Platonova Olga/task_8_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Platonova Olga/task_8_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Platonova Olga/task_8_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 8. Вариант 21.
#Доработайте игру "Анаграммы" (см. М.Доусон Программируем на Python. Гл.4) так, чтобы к каждому слову полагалась подсказка. Игрок должен получать право на подсказку в том случае, если у него нет никаких предположений. Разработайте систему начисления очков, по которой бы игроки, отгадавшие слово ... | 40.954545 | 355 | 0.623751 |
ca436664571c958cfeef2abe50203c233abb5ff0 | 367 | py | Python | docker/django/restaurant/restapps/admin.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapps/admin.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapps/admin.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | from django.contrib import admin
from .models import Restaurant, Menu
class RestaurantAdmin(admin.ModelAdmin):
list_display = ('name', 'contact', 'active')
admin.site.register(Restaurant, RestaurantAdmin)
class MenuAdmin(admin.ModelAdmin):
list_display = ('name', 'price', 'current_date', 'restaurant', 'a... | 20.388889 | 76 | 0.741144 |
04a9a964813caf3199b7ddbba8b88f02fe951c38 | 863 | py | Python | notebooks/util/vespa_helper/result_formatter.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | notebooks/util/vespa_helper/result_formatter.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | notebooks/util/vespa_helper/result_formatter.py | dbmdz/webarchiv-dh-bestandsausbau | 98c271a09cdb026d1d58133f49dcb3e1c9fcf9b6 | [
"MIT"
] | null | null | null | def write_table_row(key, value):
row = f"<tr><td>{key}</td><td>{value}</td></tr>"
return row
def write_doc_entry(idx, domain):
fields = domain.get("fields")
doc_entry = f'<tr><th colspan="2">Link {idx}</th></tr>'
doc_entry += write_table_row(
"URL",
f"<a target=\"_blank\" rel=\"noo... | 35.958333 | 119 | 0.628042 |
f3dd3eb9c0de52bf0b070ce94c5e2d8dce80939a | 2,057 | py | Python | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_demo.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_demo.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_onnx/torch.onnx/custom_ops_demo/test_custom_ops_demo.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 25.7125 | 83 | 0.654837 |
ed9e8890fc8f7ed6a4fa787b1c512b52f4aa635c | 183 | py | Python | etl/core/exceptions.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/core/exceptions.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/core/exceptions.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | class TransformError(Exception):
def __init__(self, func_name, reason, context=''):
self.func_name = func_name
self.reason = reason
self.context = context
| 30.5 | 54 | 0.661202 |
b65daeb6d8f9277e6a364aa0a069ea645ae372e3 | 2,989 | py | Python | pyntcloud/ransac/samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/ransac/samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/ransac/samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import numpy as np
from abc import ABC, abstractmethod
from ..structures import VoxelGrid
class RansacSampler(ABC):
""" Base class for ransac samplers.
Parameters
----------
points : ndarray
(N, M) ndarray where N is the number of points and M is the number
scalar fields associated t... | 31.463158 | 115 | 0.644697 |
b68f9abad8c450140f0ab1f54eee797085f6f051 | 3,127 | py | Python | test/test_npu/test_all.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_all.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_all.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 36.788235 | 74 | 0.625839 |
bfad0bf897c11a2732fa3a7c4abec4e1637dc3bf | 3,392 | py | Python | indl/regularizers.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | 1 | 2021-02-22T01:39:50.000Z | 2021-02-22T01:39:50.000Z | indl/regularizers.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | indl/regularizers.py | SachsLab/indl | 531d2e0c2ee765004aedc553af40e258262f86cb | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
from typing import Iterable
__all__ = ['KernelLengthRegularizer']
class KernelLengthRegularizer(tf.keras.regularizers.Regularizer):
"""
Regularize a kernel by its length. Added loss is a int mask of 1s where abs(weight) is above threshold,
and 0s otherwise, mul... | 44.631579 | 107 | 0.606132 |
bfd07ebea55ae687b8fd6d334ef166b87b5960e4 | 156 | py | Python | Proyecto21dias/views.py | sergioandrespenarandatarazona/Tesis1 | 24ad878189aefa932895b2f42e8059a9720fcf1f | [
"MIT"
] | null | null | null | Proyecto21dias/views.py | sergioandrespenarandatarazona/Tesis1 | 24ad878189aefa932895b2f42e8059a9720fcf1f | [
"MIT"
] | null | null | null | Proyecto21dias/views.py | sergioandrespenarandatarazona/Tesis1 | 24ad878189aefa932895b2f42e8059a9720fcf1f | [
"MIT"
] | null | null | null | """ URLs module."""
from django.http import HttpResponse
def hello_world(request):
"""Return a greeting."""
return HttpResponse('Hello, world!')
| 17.333333 | 40 | 0.679487 |
44dc3aa81669f6ee82ce7c263f2faede5348f903 | 92 | py | Python | 2015/01/sp/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | graphic_templates/table/graphic_config.py | tophtucker/dailygraphics | abc8fa7fb0e4d15800bb3edcf2c864fe98f40197 | [
"MIT"
] | null | null | null | graphic_templates/table/graphic_config.py | tophtucker/dailygraphics | abc8fa7fb0e4d15800bb3edcf2c864fe98f40197 | [
"MIT"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1ciRc--h8HuBpQzMebVygC4x_y9dvKxp6OA45ccRrIX4'
| 23 | 68 | 0.826087 |
44ebb1386893966f91b865f959755b8287e28104 | 904 | py | Python | sys/1/start.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | sys/1/start.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | sys/1/start.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import requests
import re
from os.path import isfile
from time import sleep
from time import strftime as now
from random import shuffle, randrange
FORMAT = '%Y-%m-%d %H:%M:%S'
def log(data, file='fetch.log'):
with open(file, 'a+') as f:
f.write(now(FORMAT) + ' ' + str(data) + '\n')
f.close()
if ... | 26.588235 | 69 | 0.596239 |
e5aad9c3d7f5720d182117a938d13b218c7f4258 | 657 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_ctypes_____init____.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_ctypes_____init____.py,v 1.1 2020/09/01 09:26:54 schmonz Exp $
Avoid MemoryError from "import ctypes" on OpenBSD.
--- Lib/ctypes/__init__.py.orig Sun Apr 19 21:13:39 2020
+++ Lib/ctypes/__init__.py
@@ -273,7 +273,8 @@ def _reset_cache():
# function is needed for the unittests on Win64 to succe... | 38.647059 | 81 | 0.710807 |
8220ee1455505e060ab25e9c2e7664a9d42648e8 | 3,245 | py | Python | src/visitpy/visit_utils/tests/test_qannote_basic.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visit_utils/tests/test_qannote_basic.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visit_utils/tests/test_qannote_basic.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
author: Cyrus Harrison (cyrush@llnl.gov)
description:
Tests for qannote module.
"""
i... | 34.157895 | 122 | 0.536826 |
ec35cbe7db78b769c8006428df8025f03849e37f | 635 | py | Python | INBa/2015/Shemenev_A_V/task_6_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_6_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Shemenev_A_V/task_6_30.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 30.
# Создайте игру, в которой компьютер загадывает название одного из двенадцати месяцев, а игрок должен его угадать.
# Shemenev A.V
# 11.04.2016
import random
month=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"] #Список месяцев
print("Данн... | 37.352941 | 127 | 0.733858 |
6b944d3a4924ec77fe9d8ae602cfd5401958c63b | 1,643 | py | Python | tools/pythonpkg/tests/fast/pandas/test_same_name.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/pandas/test_same_name.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/pandas/test_same_name.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import pytest
import duckdb
import pandas as pd
class TestMultipleColumnsSameName(object):
def test_multiple_columns_with_same_name(self, duckdb_cursor):
df = pd.DataFrame({'a': [1, 2, 3, 4], 'b': [5, 6, 7, 8], 'd': [9, 10, 11, 12]})
df = df.rename(columns={ df.columns[1]: "a" })
df_origin... | 54.766667 | 194 | 0.566038 |
d84a852a922004ec2496f367b86b02e6931a52bf | 119 | py | Python | fuzzsvc/app/config.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | fuzzsvc/app/config.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | fuzzsvc/app/config.py | ifoundthetao/FuzzFlow | 86559ac7f85fc89510c0d9647e02880edb95aa2a | [
"MIT"
] | null | null | null | import os
DATABASE_URI = "sqlite:///fuzzflow.db"
CLIENT_FOLDER = "client"
UPLOAD_FOLDER = 'static' + os.sep + 'upload'
| 23.8 | 44 | 0.714286 |
cfa8edf57a7627fbafa12446431741d903610b78 | 7,580 | py | Python | keyboards/signum/3_0/elitec/keymaps/default/generate_km.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | keyboards/signum/3_0/elitec/keymaps/default/generate_km.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | keyboards/signum/3_0/elitec/keymaps/default/generate_km.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import layout
import os
import re
def gen_uc_iter():
length = len(layout.uc_dict)
for key, value in sorted(layout.uc_dict.items()):
length -= 1
if length:
yield (key, value, False)
else:
yield (key, val... | 38.871795 | 146 | 0.465435 |
8fa7dbf800f89cf32d1f717ade893043af2132a0 | 1,221 | py | Python | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseComplianceAlert/PrismaCloudComputeParseComplianceAlert.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseComplianceAlert/PrismaCloudComputeParseComplianceAlert.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PrismaCloudCompute/Scripts/PrismaCloudComputeParseComplianceAlert/PrismaCloudComputeParseComplianceAlert.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 *
import json
def parse_compliance(raw_json):
data = json.loads(raw_json)
if data.get('kind') != 'compliance':
raise ValueError(f'Input should be a raw JSON compliance alert, received: {raw_json}')
outputs = {'PrismaCloudCompute.Compli... | 27.75 | 99 | 0.634726 |
85905318aa0e704e3495bf516e995629a787dae9 | 9,402 | py | Python | tests/test_jsonld.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/test_jsonld.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/test_jsonld.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import pytest
def test_get_sd_for_admin_unit(client, app, db, seeder):
user_id, admin_unit_id = seeder.setup_base()
with app.app_context():
from project.jsonld import get_sd_for_admin_unit
from project.models import AdminUnit
admin_unit = AdminUnit.query.get(admin_unit_id)
ad... | 33.222615 | 86 | 0.668049 |
a4415f75eceb433cbac1b16aa47cf701bd9b7812 | 2,020 | py | Python | projects/g3h1-cp-fml-interpreter/src/fml_parser/grammar.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/grammar.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h1-cp-fml-interpreter/src/fml_parser/grammar.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | # Grammar
# =======
#
# Program -> { Statement SEMICOLON }
#
# Statement -> OriginStatement | ScaleStatement | RotStatement | ForStatement | ColorStatement | BgStatement
#
# OriginStatement -> ORIGIN IS L_BRACKET Expression COMMA Expression R_BRACKET
# ScaleStatement -> SCALE IS L_BRACKET Expression COMMA Expression R_... | 24.634146 | 108 | 0.657921 |
742a4278bb7f1dceb958050491d1dc68471f9ec9 | 607 | py | Python | website-addons-14.0/website_login_background/__manifest__.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | website-addons-14.0/website_login_background/__manifest__.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | website-addons-14.0/website_login_background/__manifest__.py | Reathline/DOD_PODCAST | ffadd4bd11f268d9983668b87348f29dd2f4a6a5 | [
"MIT"
] | null | null | null | {
"name": """Website login background""",
"summary": """Random background image to your taste at the website login page""",
"category": "Website",
"images": ["images/5.png"],
"version": "14.0.1.0.3",
"author": "IT-Projects LLC",
"support": "help@itpp.dev",
"website": "https://twitter.com... | 33.722222 | 85 | 0.586491 |
77e9ef301e9610123057b8002ee9e16a64741013 | 550 | py | Python | Algorithms/Warmup/Compare the Triplets.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Warmup/Compare the Triplets.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Warmup/Compare the Triplets.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/compare-the-triplets/problem?h_r=internal-search
A = input().split()
B = input().split()
def compare(a, b):
alice = 0
bob = 0
x = len(a)
for i in range(x):
if int(a[i]) > int(b[i]):
alice += 1
elif int(a[i]) < int(b[i]):
b... | 16.666667 | 88 | 0.494545 |
3b682ece4666002ac6b65489ef29b6afa0a80452 | 1,249 | py | Python | official/cv/srcnn/src/srcnn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/srcnn/src/srcnn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/srcnn/src/srcnn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.290323 | 95 | 0.644516 |
79483a18ade49b9e3a6aee2e2162b3123a115e42 | 536 | py | Python | python/en/_numpy/1.Quickstart_tutorial-1.The_Basics-1.An_eample.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/1.Quickstart_tutorial-1.The_Basics-1.An_eample.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/1.Quickstart_tutorial-1.The_Basics-1.An_eample.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # 1.Quickstart_tutorial-1.The_Basics-1.An_eample.py
#
# https://docs.scipy.org/doc/numpy/user/quickstart.html
# The Basics - An example
import numpy as np
a = np.arange(15).reshape(3,5)
#>>> a
#array([[ 0, 1, 2, 3, 4],
# [ 5, 6, 7, 8, 9],
# [10, 11, 12, 13, 14]])
print( a.shape )
#(3, 5)
print( ... | 14.486486 | 55 | 0.576493 |
eb6710330cd4341750137e64a7f344d4f35e286e | 402 | py | Python | book/translation/por/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | 1 | 2021-11-09T20:43:06.000Z | 2021-11-09T20:43:06.000Z | book/translation/por/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | null | null | null | book/translation/por/book/website/scripts/clean.py | AndreaSanchezTapia/the-turing-way | fe3e1a8ad36f9086edb4f36ec8e398f253fd8e0f | [
"CC-BY-4.0"
] | 2 | 2021-12-21T17:35:45.000Z | 2021-12-21T20:43:01.000Z | """Um script auxiliar para "limpar" todos os seus arquivos markdown e HTML gerados."""
importação shutil como shutil
do caminho de importação do pathlib
path_root = Caminho(__file__).parent.parent
caminhos = [path_root.joinpath('_site'),
path_root.joinpath('_build')]
para o caminho nos caminhos:
print(f'... | 28.714286 | 86 | 0.731343 |
d685a61f85861f34b540d6df1cf6b6654c800d50 | 4,559 | py | Python | LDA/LDA_notebook_example.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | 1 | 2018-05-14T10:02:54.000Z | 2018-05-14T10:02:54.000Z | LDA/LDA_notebook_example.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null | LDA/LDA_notebook_example.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null |
# coding: utf-8
# # Latent Dirichlet Allocation LDA
# #### Wikifetcher
# Raw Text von Wikipedia mittels Suchbegriffen
# #### LDAbuilder
# Ausführen der LDA mit der gegebenen Dokumentliste (Rohtext-Liste von Wikifetcher)
# ## Ausführung
# Zusätzlich für jeden Ausführungsblock wird die Ausführungszeit gemessen.
# ##... | 24.643243 | 178 | 0.726914 |
3013e789d8e350f15fae33ec3a3383b4a6026453 | 2,875 | py | Python | Crashkurs Python/15_Klassen.py | slogslog/Kurzgeschichten-in-CSharp | 3918c4174220e558cdeeada0edac941811418b93 | [
"Unlicense"
] | 2 | 2019-03-15T20:48:34.000Z | 2019-04-22T15:24:09.000Z | Crashkurs Python/15_Klassen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | Crashkurs Python/15_Klassen.py | slogslog/Coding-Kurzgeschichten | 9b08237038147c6c348d4cf4c69567178e07dd1d | [
"Unlicense"
] | null | null | null | # Übungsaufgabe: Auto mit Booster in Python
class Booster:
powerOn = False # erzeugt und initialisiert eine Instanzvariable
def __init__(self, stufe): # Konstruktor
self.stufe = stufe # self ist 'this' in Java/C# -> erzeugt eine Instanzvariable
def getPower(self): # Meth... | 28.75 | 92 | 0.654261 |
001cb3e6ae1e004358513b4e6dc15fc1d9d2807e | 1,957 | py | Python | src/main/main/exceptions.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/main/exceptions.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/main/exceptions.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | from django.http import (
JsonResponse,
response,
)
from rest_framework.authentication import TokenAuthentication
from rest_framework.exceptions import APIException
from rest_framework import status
from typing import (
Generic,
TypeVar,
)
SELFCLASS = TypeVar('SELFCLASS')
DEFAULT_DETAIL = {"error": "An ... | 34.333333 | 119 | 0.690342 |
4e398e7861d9b6eb98f8610acc894a67fe987e59 | 259 | py | Python | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/08-Branching-with-if-Statements.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/08-Branching-with-if-Statements.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Crash-Course-on-Python.Google/week-2-Basic-Python-Syntax/08-Branching-with-if-Statements.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | def hint_username(username: str) -> bool:
if len(username) < 3:
return False
elif len(username) > 15:
return False
else:
return True
def is_even(number: int):
if number % 2 == 0:
return True
return False
| 17.266667 | 41 | 0.571429 |
9def106ffeb8eff87b70f1efbd79bb7f9294bfc2 | 3,324 | py | Python | pyntcloud/utils/array.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | pyntcloud/utils/array.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | pyntcloud/utils/array.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import numpy as np
def cartesian(arrays, out=None):
"""Generate a cartesian product of input arrays.
Parameters
----------
arrays : list of array-like
1-D arrays to form the cartesian product of.
out : ndarray
Array to place the cartesian product in.
Returns
-------
o... | 26.380952 | 88 | 0.573406 |
c9dc21179d0d444d32b461996eff7c31632ea278 | 636 | py | Python | src/onegov/agency/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/forms/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.agency.forms.agency import ExtendedAgencyForm
from onegov.agency.forms.agency import MoveAgencyForm
from onegov.agency.forms.membership import MembershipForm
from onegov.agency.forms.mutation import AgencyMutationForm
from onegov.agency.forms.mutation import ApplyMutationForm
from onegov.agency.forms.mutati... | 30.285714 | 59 | 0.795597 |
4ec330620040a5e122a8ffc3010495618f3d8492 | 1,487 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/02_pdf_zusammen_verbinden_und_seitenrotation/02_pdf_zusammen_verbinden_und_seitenrotation.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/02_pdf_zusammen_verbinden_und_seitenrotation/02_pdf_zusammen_verbinden_und_seitenrotation.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/02_pdf_zusammen_verbinden_und_seitenrotation/02_pdf_zusammen_verbinden_und_seitenrotation.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 02_pdf_zusammen_verbinden.py
# In diesem Beispiel geht es Darum zwei PDF's miteinander zu verschmelzen
import os, PyPDF2
os.chdir(os.path.dirname(__file__))
source_file_1='.\\meetingminutes.pdf'
source_file_2='.\\meetingminutes2.pdf'
output_file='.\\meetingminutes_merged.pdf'
output_file_2='.\\meetingminutes_rotate... | 31.638298 | 73 | 0.814391 |
1129e8fa7316d1f0da2a3d417d7d5488c380b97d | 549 | py | Python | python/en/archive/dropbox/python-python_speech_features/test_python_speech_features.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/python-python_speech_features/test_python_speech_features.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/python-python_speech_features/test_python_speech_features.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# test_python_speech_features.py
from python_speech_features import mfcc
from python_speech_features import delta
from python_speech_features import logfbank
import scipy.io.wavfile as wav
( rate, sig ) = wav.read( 'english.wav' )
mfcc_feat = mfcc( sig, rate )
d_mfcc_feat = delta( mf... | 24.954545 | 44 | 0.701275 |
11613d7d1f347f8409051bc2b8ea2b1322ec4d30 | 2,078 | py | Python | deprecated/benchmark/ps/ctr/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/ctr/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/ctr/network_conf.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | import paddle.fluid as fluid
import math
dense_feature_dim = 13
def ctr_dnn_model_dataset(dense_input, sparse_inputs, label,
embedding_size, sparse_feature_dim):
def embedding_layer(input):
return fluid.layers.embedding(
input=input,
is_sparse=True,
... | 51.95 | 94 | 0.620789 |
fed1dead0c7d17ab5895340b0d529a8c229b99e9 | 9,841 | py | Python | research/cvtmodel/vgg/src/vgg19_bn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cvtmodel/vgg/src/vgg19_bn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cvtmodel/vgg/src/vgg19_bn.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... | 51.794737 | 119 | 0.564374 |
3a74fd2b881927d6d0c7fa67cc96cf2a465c88ca | 93 | py | Python | year_3/numanalysis_2/lab23/djapp/integrals/apps.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | year_3/numanalysis_2/lab23/djapp/integrals/apps.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | 21 | 2020-03-24T16:26:04.000Z | 2022-02-18T15:56:16.000Z | year_3/numanalysis_2/lab23/djapp/integrals/apps.py | honchardev/KPI | f8425681857c02a67127ffb05c0af0563a8473e1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class IntegralsConfig(AppConfig):
name = 'integrals'
| 15.5 | 33 | 0.763441 |
6c07ec7595443293ec46761c1ea10a43bebc964e | 968 | py | Python | BIZa/2014/Zyabko_A_A/Task_9_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_9_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BIZa/2014/Zyabko_A_A/Task_9_45.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 9
#Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать отгадать слово.
... | 33.37931 | 309 | 0.727273 |
6c14e30dc5a97bddb46d87c5b01b3e8db4734ace | 2,407 | py | Python | Cat/Cat/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | Cat/Cat/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | Cat/Cat/urls.py | qq453388937/drf | 63ef7c5f89cf8f597fd09828f8ce94ce809ce287 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""Cat URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, na... | 33.901408 | 195 | 0.714582 |
dd7e672fca09348d4a35306bb9a2c144a2bd85cd | 511 | py | Python | scripts/component_graph/server/util/logging.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/component_graph/server/util/logging.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/component_graph/server/util/logging.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python3
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides default logging configuration for the project. """
import logging
def get_logger(name):
""" Returns a default logger ... | 31.9375 | 78 | 0.714286 |
b0b1a59689922a1227ddf195a549354688474e22 | 1,336 | py | Python | Beginner/03. Python/pyLdapBind.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-04T05:41:43.000Z | 2021-10-04T05:41:43.000Z | Beginner/03. Python/pyLdapBind.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/pyLdapBind.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | import os
from pyad import pyad
import pyad.adquery
def prRed(msg):
print("\033[91m{}\033[00m" .format(msg))
def prGreen(msg):
print("\033[92m{}\033[00m" .format(msg))
def prYellow(msg):
print("\033[93m{}\033[00m" .format(msg))
def getGroups(userName):
''' Query for logged in user AD group membe... | 26.72 | 79 | 0.60479 |
b0b9c8d2b28bd680221f6d4817efe9b99d0b4e36 | 1,021 | py | Python | index-renamer.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | index-renamer.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | index-renamer.py | wille430/index-renamer | 95b925a26d7db2b4dc4365107368c7ea8e9b24f7 | [
"MIT"
] | null | null | null | import os
import re
import click
def get_abs_path(path: str) -> str:
if os.path.isabs(path):
return path
else:
return os.path.realpath(path)
def rename_in_dirs(dir_path: str):
# rename recursively in folders
for dir in os.listdir(dir_path):
full_dir = os.path.join(dir_path, dir... | 29.171429 | 118 | 0.602351 |
bbbb5e8746774878e15b8d7ed5339916741149cd | 1,537 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_most_common.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_most_common.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_most_common.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformMostCommon(unittest.TestCase):
def setUp(self):
self.data = {
"test": ["Canada", "Schweden", "Canada", "Schweden", "Canada", "Canada", "Schweden", "Canada"]
}
... | 30.74 | 111 | 0.500976 |
b1f04c1327483626a64870b3f216f65924db7ac3 | 92 | py | Python | 2014/04/table-subminimum-wages/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/04/table-subminimum-wages/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/04/table-subminimum-wages/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 = '1DTjU8IM4rryCHOKXHAzz06egQV7jVVCJgpKoCXJyB18'
| 23 | 68 | 0.847826 |
ab9c21ce16d3fb724e9e05713c4b540c61c06b29 | 233 | py | Python | webapp/hackers_and_slack/first_flask_application/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/hackers_and_slack/first_flask_application/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/hackers_and_slack/first_flask_application/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__,
instance_relative_config=False,
template_folder='templates',
static_folder='static')
@app.route('/')
def hello():
return 'Hello World'
| 21.181818 | 44 | 0.600858 |
e62d947304c084f7f41c0893ba19e00e5773d7dd | 598 | py | Python | code/products/mysql/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 13 | 2021-05-04T07:46:38.000Z | 2022-03-31T15:46:59.000Z | code/products/mysql/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 656 | 2021-04-16T12:05:11.000Z | 2022-03-31T19:33:26.000Z | code/products/mysql/connect.py | cutinha/devportal | fc564c7f0f779bba6a9713c27470d40a96fbc37a | [
"CC-BY-4.0"
] | 24 | 2021-04-21T04:17:13.000Z | 2022-03-31T19:14:39.000Z | import pymysql
timeout = 10
connection = pymysql.connect(
charset="utf8mb4",
connect_timeout=timeout,
cursorclass=pymysql.cursors.DictCursor,
db="defaultdb",
host=MYSQL_HOST,
password=MYSQL_PASSWORD,
read_timeout=timeout,
port=MYSQL_PORT,
user=MYSQL_USERNAME,
write_timeout=timeo... | 23.92 | 66 | 0.698997 |
058004e8706a67f59ebb0175bbcd94a1a74813d3 | 346 | py | Python | backend/api/urls.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/urls.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | backend/api/urls.py | giacomooo/CASFEE_Project2 | 420ff488d6b9deefe6623a45ecfed299f97a4639 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from rest_framework import routers
from . import views
# pylint: disable=invalid-name
app_name = 'api'
router = routers.DefaultRouter()
router.register(r'parking', views.ParkingViewSet)
router.register(r'reservation', views.ReservationViewSet)
urlpatterns = [
url( r'^',... | 21.625 | 57 | 0.760116 |
55b8e9f88211d42abeb05e16feab4d8e2d7b4e9a | 627 | py | Python | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-while_break_continue_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-while_break_continue_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/udemy-AutomateTheBoringStuffWithPythonProgramming/Ch02-FlowControl-while_break_continue_statements.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # Ch02-FlowControl-while_break_continue_statements.py
# This is an example for while, break, continue statements.
#
# https://automatetheboringstuff.com/chapter2/
# Flow Control Statements: Lesson 6 - while Loops, break, and continue
#
# I changed the original code slightly.
count = 0
while True:
print('What is y... | 26.125 | 70 | 0.645933 |
e95c521ec7e01dec6f378813e28026de64964c1c | 6,378 | py | Python | projects/controllers/projects.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/projects.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | projects/controllers/projects.py | Matheus158257/projects | 26a6148046533476e625a872a2950c383aa975a8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Projects controller."""
import re
from datetime import datetime
from os.path import join
from sqlalchemy import func
from sqlalchemy.exc import InvalidRequestError, ProgrammingError
from werkzeug.exceptions import BadRequest, NotFound
from .experiments import create_experiment
from ..databa... | 32.876289 | 113 | 0.68313 |
e983e7ba4f6a877ebd6df9433aca6044125791c8 | 774 | py | Python | BITs/2014/Abdrahmanova_G_I/task_6_1.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Abdrahmanova_G_I/task_6_1.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | BITs/2014/Abdrahmanova_G_I/task_6_1.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача 6. Вариант 1.
#Создайте игру, в которой компьютер загадывает имя одного из трех мушкетеров - товарищей д'Артаньяна, а игрок должен его угадать.
import random
guessesTaken=0
print('Компьютер загадал имя одного из трех мушкетеров - товарищей д`Артаньяна. \nТвоя цель отгадать имя загаданного мушкетера.')
musketry=... | 36.857143 | 129 | 0.711886 |
75a7677c1708739d2100642d686c9f578c44055d | 1,500 | py | Python | Aufgaben/abgabe5/main.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe5/main.py | JoshuaJoost/GNN_SS20 | 6b905319f2e51b71569354c347805abce9df3cb1 | [
"MIT"
] | null | null | null | Aufgaben/abgabe5/main.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-06-24"
__version__ = "1.0"
__status__ = "Ready"
# kernel import
import numpy as np
import math
from matplotlib import pyplot as plt
# constants
## funct... | 26.315789 | 121 | 0.696 |
f96d35234a53cd83f18ac3c80b689cbdba19f166 | 18,746 | py | Python | examples/nowcoder/SQL7/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | examples/nowcoder/SQL7/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | examples/nowcoder/SQL7/tests.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from datetime import date
from django.db import connections
from django.test import TestCase, TransactionTestCase
from .models import salaries
from django.db.models.aggregates import Count
# Create your tests here.
class SimpleTest(TransactionTestCase):
reset_sequences = True
def prepare_data(self):
... | 99.712766 | 139 | 0.672357 |
ddf0226893e4da0579d3c058e212abac52d2cbce | 1,042 | py | Python | web/MicroservicesAsAservice/MAAS1.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | web/MicroservicesAsAservice/MAAS1.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | web/MicroservicesAsAservice/MAAS1.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import string
import aiohttp
import asyncio
import sys
if len(sys.argv) < 2:
print("Usage: solve.py http://host:port/")
exit()
url = sys.argv[1]
w = string.ascii_lowercase + ''.join([str(x) for x in range(0, 10)]) + '{}_'
check = "1 if open('/flag.txt', 'r').read()[{}] == '{}' else None"
... | 26.717949 | 133 | 0.540307 |
3490ae6d764ad80342a7e630d4bd02ec30a74a92 | 8,522 | py | Python | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/hvac.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/hvac.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_panel/esp32/code/hvac.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | import lvgl as lv
# RESOURCES_ROOT = "S:/Users/liujuncheng/workspace/iot/esp32/solution/MicroPython/smart_panel/smart_panel/"
RESOURCES_ROOT = "S:/data/pyamp/"
environment_alive = False
functionImage = [
RESOURCES_ROOT + "images/refrigeration.png",
RESOURCES_ROOT + "images/heating.png",
RESOU... | 40.00939 | 107 | 0.660174 |
9b701f85472e679985df8373a66454121e2cdc7a | 18,960 | py | Python | tests/test_krotov.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | tests/test_krotov.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | tests/test_krotov.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | """High-level tests for `krotov` package."""
import io
import logging
import os
from copy import deepcopy
from shutil import copyfile
import numpy as np
import pytest
import qutip
from pkg_resources import parse_version
import krotov
def test_valid_version():
"""Check that the package defines a valid __version... | 35.84121 | 95 | 0.627795 |
32f3277ed1a1a78217cb5298788ebeb15eb0af09 | 561 | py | Python | common/models/pay/OauthAccessToken.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | 2 | 2019-06-10T08:57:47.000Z | 2021-06-12T16:22:15.000Z | common/models/pay/OauthAccessToken.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | common/models/pay/OauthAccessToken.py | yao6891/FlaskOrdering | cbd24bd8d95afaba91ce4d6b1b3548c4e82e3807 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.schema import FetchedValue
from application import db
class OauthAccessToken(db.Model):
__tablename__ = 'oauth_access_token'
id = db.Column(db.Integer, primary_key=True)
access_token = db.Column(db.String(600), nulla... | 40.071429 | 103 | 0.773619 |
bd39e7b7bbb4ac75868e2d24926af6d23e341c10 | 191 | py | Python | Hackergame_2020/火星文/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Hackergame_2020/火星文/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Hackergame_2020/火星文/index.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | from pathlib import Path
p = Path("gibberish_message.txt")
with p.open(encoding="utf-8") as f:
txt = f.read()
print(txt.encode("gbk").decode("utf-8").encode("latin1").decode("gbk"))
| 27.285714 | 75 | 0.659686 |
c845950c51ed0377e95fb45cba502f3afea7b193 | 486 | py | Python | 7-assets/past-student-repos/_DS-Python/Algorithms-master/recipe_batches/recipe_batches.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/_DS-Python/Algorithms-master/recipe_batches/recipe_batches.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/02_algorithms/Algorithms/recipe_batches/recipe_batches.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import math
def recipe_batches(recipe, ingredients):
pass
if __name__ == '__main__':
# Change the entries of these dictionaries to test
# your implementation with different inputs
recipe = { 'milk': 100, 'butter': 50, 'flour': 5 }
ingredients = { 'milk': 132, 'butter': 48, 'flour': 51 ... | 34.714286 | 164 | 0.716049 |
23deb3c099e189ac7a14ca2459782869915a6728 | 909 | py | Python | src/makedata_classification.py | B1T0/DeUs | 392f3bd3a97190cc2bc5dda9385b9728252cb975 | [
"MIT"
] | 2 | 2018-03-13T06:49:32.000Z | 2018-03-16T16:04:06.000Z | src/makedata_classification.py | B1T0/DeUs | 392f3bd3a97190cc2bc5dda9385b9728252cb975 | [
"MIT"
] | null | null | null | src/makedata_classification.py | B1T0/DeUs | 392f3bd3a97190cc2bc5dda9385b9728252cb975 | [
"MIT"
] | null | null | null | import os
import tensorflow as tf
def sliding(string, wnSize, step):
list = []
start = 0
while start + wnSize < len(string):
list.append(string[start:start+wnSize])
start = start + step
return list
def make(filename):
path = "../resources/texts"
author_ctr = 1
allAuthors ... | 31.344828 | 98 | 0.606161 |
9b22e2adf66de77669946f1fd21c3e0cfe6c5f03 | 2,750 | py | Python | packages/watchmen-storage/src/watchmen_storage/snowflake.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage/src/watchmen_storage/snowflake.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-storage/src/watchmen_storage/snowflake.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from time import time
from .snowflake_worker_id_generator import WorkerIdGenerator
# noinspection SpellCheckingInspection
TWEPOCH = 1420041600000
# 0 - 3, 4 data centers maximum
DATACENTER_ID_BITS = 2
# 0 - 1023, 1024 workers maximum per data center
WORKER_ID_BITS = 10
# 0 - 1023, 1024 sequence numbers per millisecon... | 29.255319 | 110 | 0.740727 |
b5a96df15f559edfc6903f6e1ea80362f6e3476c | 1,384 | py | Python | Problems/Breadth-FirstSearch/01Matrix/01_matrix.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Breadth-FirstSearch/01Matrix/01_matrix.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Breadth-FirstSearch/01Matrix/01_matrix.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from collections import deque
from typing import List
# DP - Bottom up
def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
m, n = len(mat), len(mat[0])
for r in range(m):
for c in range(n):
if mat[r][c] > 0:
top = mat[r - 1][c] if r > 0 else float('inf')
... | 30.755556 | 84 | 0.439306 |
a5e1f585ebf83b076e2b7ea2748341db624fa2e1 | 198 | py | Python | vorl7.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl7.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl7.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # 7. Vorlesung 20.11.2020, Skript Python 5 (07_Python_05.pdf)
#
import cv2
img = cv2.imread("belarus.jpg", cv2.IMREAD_COLOR)
cv2.imshow("myimage",img)
cv2.waitKey(0)
cv2.destroyWindow("myimage")
| 19.8 | 61 | 0.732323 |
8b5aad11059c2defe0d2fef8207f90569c163521 | 410 | py | Python | Python1/aula9.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula9.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | Python1/aula9.py | Belaschich/SoulON | 9f908b025b34fc79187b4efd5ea93a78dca0ef7e | [
"MIT"
] | null | null | null | '''
1-Crie uma função que receba dois parâmetros e realize sua soma, subtração, adição e multiplicação.
2-Informe esses resultados através de um print ao usuário dentro da função.
'''
def operacoes(a,b):
soma = a + b
sub = a - b
mult = a * b
div = a / b
print("Soma: ", soma)
print("Subtraç... | 24.117647 | 99 | 0.626829 |
7be8b83b3a19ebde1540633334bed60cd49e93ba | 741 | py | Python | beispielanwendungen/sound/main.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/sound/main.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/sound/main.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
#!/usr/bin/env python
from PyQt4 import QtMultimedia
device = QtMultimedia.QAudioDeviceInfo.defaultOutputDevice()
info = QtMultimedia.QAudioDeviceInfo(device)
codecs = info.supportedCodecs()
print u"Device {0} unterstützt folgende Codecs:".format(device.deviceName())
for c in codecs... | 29.64 | 77 | 0.765182 |
d0e2c1d06caecd5fb736078844ff93ac352ba206 | 892 | py | Python | kts/core/lists.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/lists.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/lists.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from kts.core.cache import CachedMapping
from kts.settings import cfg
class SyncedList(CachedMapping):
def sync(self, scope=None):
if scope is None:
scope = cfg.scope
for name, value in self.items():
scope[name] = value
class FeatureList(SyncedList):
def __init__(self)... | 27.030303 | 83 | 0.660314 |
d0ee636661fbe13a616e7d53650dd18b0a46098c | 3,917 | py | Python | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionCI/ExpanseAggregateAttributionCI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionCI/ExpanseAggregateAttributionCI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionCI/ExpanseAggregateAttributionCI.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """ExpanseAggregateAttributionCI
"""
import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
from CommonServerUserPython import * # noqa
from typing import Dict, Any, Tuple, Optional
import traceback
''' STANDALONE FUNCTION '''
def deconstruct_entry(Servic... | 36.95283 | 111 | 0.606331 |
ef2846d1f59a95b5686d4c092b3179677fd5b4ed | 796 | pyde | Python | sketches/codingtrain_unicorn_rainbow_2/codingtrain_unicorn_rainbow_2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/codingtrain_unicorn_rainbow_2/codingtrain_unicorn_rainbow_2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/codingtrain_unicorn_rainbow_2/codingtrain_unicorn_rainbow_2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from unicornrainbow import UnicornRainbow
from codingtrain import CodingTrain
trains = []
NO_TRAINS = 2
def setup():
global unicorn, trains
size(720, 360)
this.surface.setTitle("Coding Train Unicorn Rainbow Stage 2")
unicorn = UnicornRainbow()
for i in range(NO_TRAINS):
train = CodingTrain... | 22.111111 | 65 | 0.624372 |
325e3f33826f50bad6d2a194f7974ca30c952619 | 1,728 | py | Python | nz_crawl_demo/day7/demo1.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day7/demo1.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day7/demo1.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | import requests
import re
from urllib import request
from fontTools.ttLib import TTFont
def get_doutin():
headers = {
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36",
}
url = "https://www.iesdouyin.com/share/user/8844... | 37.565217 | 139 | 0.604167 |
32afe23bfbc64666963c0e0dc4191162f991abf5 | 7,278 | py | Python | event_detector/gttm/nlp/clean_text.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/nlp/clean_text.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/nlp/clean_text.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | import re
import string
import pycountry
import spacy
from nltk.corpus import wordnet
from spacy.lang.xx import MultiLanguage
from spacy.lang.en import English
punct = list(string.punctuation)
extended_stop_words = ['rt', 'via', 'http', 'https', '...']
class TextCleaner:
def __init__(self):
pass
@st... | 40.659218 | 131 | 0.583952 |
32b0e73932f02bc98b8a41d8e70e7de88ef226e6 | 474 | py | Python | posts/feeds.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/feeds.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | posts/feeds.py | alien3211/lom-web | c7971238b0dd043854c911a0b9126b84d7deed4a | [
"MIT"
] | null | null | null | from django.contrib.syndication.views import Feed
from django.template.defaultfilters import truncatewords_html
from .models import Post
class LatestPostFeed(Feed):
title_template = 'LOM'
link = '/post/'
description = 'Nowe posty na LOM'
def items(self):
return Post.objects.published()[:5]
... | 26.333333 | 61 | 0.708861 |
3e9c519c6b455545cec89cd412677cbb9d1ea94e | 574 | py | Python | 413-arithmetic-slices/413-arithmetic-slices.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 413-arithmetic-slices/413-arithmetic-slices.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 413-arithmetic-slices/413-arithmetic-slices.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def numberOfArithmeticSlices(self, nums: List[int]) -> int:
if len(nums)<3:
return 0
output=[]
slices=[nums[0], nums[1]]
for num in nums[2:]:
if num-slices[-1]==slices[1]-slices[0]:
slices.append(num)
else:
... | 31.888889 | 63 | 0.470383 |
9d2635ca7956d2e8ad8a04be2b1407151757a1d7 | 4,798 | py | Python | rpc.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | rpc.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | rpc.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | import logging, inspect, sys, traceback, pickle
import messages_pb2 as msg
import guid as Guid
# MethodInfo={
# "NewChunk": (msg.NewChunk_Request, msg.NewChunk_Response),
# "DeleteChunk": (msg.DeleteChunk_Request, msg.DeleteChunk_Response),
# "NewVolume": (msg.NewVolume_Request, ... | 29.435583 | 86 | 0.693414 |
3e2821161c00ac74ae976524f3be83965ac6b0a7 | 128 | py | Python | quantel/exceptions.py | RatherBland/Quantel-py | abb4ec3c1f72a7409aea3eb0a5e0f1ad5c6dbbe1 | [
"MIT"
] | 37 | 2021-08-13T09:23:17.000Z | 2021-12-15T17:25:05.000Z | quantel/exceptions.py | RatherBland/Quantel-py | abb4ec3c1f72a7409aea3eb0a5e0f1ad5c6dbbe1 | [
"MIT"
] | 1 | 2021-08-24T05:51:08.000Z | 2021-09-27T05:15:50.000Z | quantel/exceptions.py | RatherBland/Quantel-py | abb4ec3c1f72a7409aea3eb0a5e0f1ad5c6dbbe1 | [
"MIT"
] | 2 | 2021-09-19T09:50:00.000Z | 2021-10-31T18:21:09.000Z | class InvalidAPIKey(Exception):
pass
class GatewayError(Exception):
pass
class TooManyRequests(Exception):
pass
| 11.636364 | 33 | 0.734375 |
e41822a9aec32432039b1cba93278697689d361d | 92 | py | Python | 2014/08/pork-beef-prices/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/08/pork-beef-prices/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/08/pork-beef-prices/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 = '1agUUCq1UQbqO0djnWyUoeHbR9TKlYQkeuofdi8cKU5Y'
| 23 | 68 | 0.847826 |
e43b09d7f86bf2bb453d6f44fcfb1c37f9236473 | 267 | py | Python | frds/mktstructure/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/mktstructure/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | frds/mktstructure/__init__.py | mgao6767/wrds | 7dca2651a181bf38c61ebde675c9f64d6c96f608 | [
"MIT"
] | null | null | null | __version__ = "0.2.0"
__description__ = "Download data from Refinitiv Tick History and compute some market microstructure measures."
__author__ = "Mingze Gao"
__author_email__ = "mingze.gao@sydney.edu.au"
# __github_url__ = "https://github.com/mgao6767/mktstructure"
| 44.5 | 110 | 0.786517 |
900cb60800d95660f5f1e3ce05f7e58d3e5daed4 | 2,835 | py | Python | cryptoauthlib/python/cryptoauthlib/iface.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 12 | 2017-11-15T08:29:03.000Z | 2021-05-22T04:57:20.000Z | cryptoauthlib/python/cryptoauthlib/iface.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 2 | 2019-09-22T12:02:07.000Z | 2021-09-09T22:38:25.000Z | cryptoauthlib/python/cryptoauthlib/iface.py | PhillyNJ/SAMD21 | 0f123422ed0ad183d510add8f5d3472a16f1e8cb | [
"MIT"
] | 5 | 2019-04-05T13:46:44.000Z | 2020-11-25T08:58:32.000Z | from ctypes import Structure, Union, c_uint16, c_int, c_uint8, c_uint32, c_void_p
from .atcab import get_cryptoauthlib
# The following must match atca_iface.h exactly
class _ATCAI2C(Structure):
_fields_ = [('slave_address', c_uint8),
('bus', c_uint8),
('baud', c_uint32)]
class _A... | 32.215909 | 85 | 0.628219 |
5fc0019c7f91971a70e7e27182e7d804e5736e98 | 308 | py | Python | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/11.01-Constructor.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/11.01-Constructor.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Courses/Python-Tutorials.Telusko/01.Object-Oriented-Programming/11.01-Constructor.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | class Computer:
def __init__(self):
self.name = "Shihab"
self.age = 18
def compare(self, other):
return self.age == other.age
c1 = Computer()
c1.age = 30
c2 = Computer()
c1.name = "Rashi"
if c1.compare(c2):
print("They are same")
else:
print("They are not same")
| 15.4 | 36 | 0.587662 |
841a80d5a0a85c6fb523f7bb2f0505a0bd84af24 | 1,068 | py | Python | app/cardreader.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/cardreader.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | app/cardreader.py | openbikebox/websocket-client | 50b61a70ffcff1acdc13ba69c017e671bd3f983f | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
openbikebox websocket-client
Copyright (c) 2021, binary butterfly GmbH
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.
"""
import asyncio
from base64 import b64encode
from .config import Config
from .system import system
class Cardreader:
... | 27.384615 | 104 | 0.650749 |
29d3f788cc3a778223b65045045c05076f12627d | 1,968 | py | Python | showcase1/com/aaron/Hex2BytesExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/Hex2BytesExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/Hex2BytesExample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- codiing:utf-8 -*-
"""regular expressions example
十进制
to
八进制: oct()
十进制
to
十六进制: hex()
"""
__author__="aaron.qiu"
import re
import binascii
import struct
import string
base = [str(x) for x in range(10)] + [ chr(x) for x in range(ord('A'),ord('A')+6)]
def hexStr2Byte(str):
"""从16进制字符串转byte"""
return b... | 21.866667 | 82 | 0.567581 |
8a31982fca0c3348f4be5aec725f0de4af24e8ef | 42,445 | py | Python | myems-api/reports/equipmentsaving.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-api/reports/equipmentsaving.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-api/reports/equipmentsaving.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import falcon
import simplejson as json
import mysql.connector
import config
from datetime import datetime, timedelta, timezone
from core import utilities
from decimal import Decimal
import excelexporters.equipmentsaving
class Reporting:
@staticmethod
def __init__():
""""Initializes Reporting"""
... | 62.23607 | 120 | 0.523972 |
8a95719e5030328913d27fe4f88e2c358b35f8e6 | 3,426 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/vultr_os_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/vultr_os_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/vultr_os_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright (c) 2019, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_functio... | 24.297872 | 99 | 0.659078 |
6adffe44dff1653fe7a821e33246e6d34f3ab867 | 7,762 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/os_port_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/os_port_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/os_port_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2016 IBM
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 34.345133 | 161 | 0.604097 |
6aee1f114938d88fc3386903948be863baf8fe4e | 5,780 | py | Python | tests/nlu/extractors/test_crf_entity_extractor.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 37 | 2019-06-07T07:39:00.000Z | 2022-01-27T08:32:57.000Z | tests/nlu/extractors/test_crf_entity_extractor.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 209 | 2020-03-18T18:28:12.000Z | 2022-03-01T13:42:29.000Z | tests/nlu/extractors/test_crf_entity_extractor.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 65 | 2019-05-21T12:16:53.000Z | 2022-02-23T10:54:15.000Z | from pathlib import Path
from typing import Dict, Text, List, Any
import pytest
from rasa.nlu.components import ComponentBuilder
from rasa.nlu import train
from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.model import Interpreter
from rasa.nlu.featurizers.dense_featurizer.spacy_featurizer import SpacyFea... | 30.744681 | 88 | 0.57301 |
7c376704850d31364a9e5a80b3c6ddd4d9278679 | 1,263 | py | Python | completion of paratrom.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | completion of paratrom.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | completion of paratrom.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
'''
Given "aacecaaa", return "aaacecaaa".
Given "abcd", return "dcbabcd".
'''
class Solution:
# @param {string} s
# @return {string}
def shortestPalindrome(self, s):
self.stringlist=list(s)
self.result=''
self.compare(self.stringlist)
return self.result
def compare(self,string):
if... | 22.157895 | 60 | 0.676168 |
86a77d0c6ae35ab97b77056b41654bec1444158c | 56 | py | Python | tests/test_arena.py | python-upskill/levelup | 89655a560b83956e4d696914907158177ce47c1e | [
"BSD-3-Clause"
] | 1 | 2020-04-24T05:47:20.000Z | 2020-04-24T05:47:20.000Z | tests/test_arena.py | radowit/levelup | 89655a560b83956e4d696914907158177ce47c1e | [
"BSD-3-Clause"
] | 7 | 2020-04-27T16:16:05.000Z | 2020-04-28T13:46:21.000Z | tests/test_arena.py | radowit/levelup | 89655a560b83956e4d696914907158177ce47c1e | [
"BSD-3-Clause"
] | null | null | null | import arena
def test_dummy():
assert arena.WORKS
| 9.333333 | 22 | 0.714286 |
71f918b790a450575acb17dd742b2aa179831105 | 203 | py | Python | MainProject/MainApp/views.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | MainProject/MainApp/views.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | MainProject/MainApp/views.py | DarishkaAMS/Django_Projects-Django_Food_Delivery_App | 2a1014c05ca628ba6bd9aefd2aae307e9d95c5c2 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def home_page_view(request):
template = 'MainApp/index.html'
return render(request, template)
| 22.555556 | 36 | 0.773399 |
92ef405304c388a3551077edbd2a4a95179b5450 | 15,443 | py | Python | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/data.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/data.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Inspur/openbmc/poky/bitbake/lib/bb/data.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | """
BitBake 'Data' implementations
Functions for interacting with the data structure used by the
BitBake build tools.
The expandKeys and update_data are the most expensive
operations. At night the cookie monster came by and
suggested 'give me cookies on setting the variables and
things will work out'. Taking this sug... | 35.257991 | 150 | 0.572751 |
92f2bac8f861981f4072d1fce732e4c8272bed5b | 154 | py | Python | Contests/Ren Ashbell.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/Ren Ashbell.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/Ren Ashbell.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = int(input())
c = int(input())
s = True
for b in range(a - 1):
if int(input()) >= c:
s = False
if s:
print("YES")
else:
print("NO") | 15.4 | 25 | 0.487013 |
135c5686ea5e76d06f234ff8e8a1c26cca052440 | 1,334 | py | Python | src/tango_sdp_subarray/tests/conftest.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/tango_sdp_subarray/tests/conftest.py | rtobar/sdp-prototype | 9f1527b884bf80daa509a7fe3722160c77260f4f | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/tango_sdp_subarray/tests/conftest.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | # coding: utf-8
"""Pytest plugins."""
# from unittest.mock import MagicMock
import pytest
from tango.test_context import DeviceTestContext
from SDPSubarray import SDPSubarray
from SDPSubarray.release import VERSION
@pytest.fixture(scope='session', autouse=True)
def tango_context():
"""Fixture that creates SDPS... | 33.35 | 71 | 0.693403 |
6a37aaa5b88b4d3688165013b44e9a666b13d61a | 1,520 | py | Python | test/test_tag11.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag11.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | test/test_tag11.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch, mock_open
try:
from pyventskalender import tag11_loesung as heute
except ImportError:
from pyventskalender import tag11 as heute
class Tag11Tests(TestCase):
def test_10_adressbuch(self):
self.assertIn("Wolfgang", heute.adressbuch)
... | 34.545455 | 70 | 0.642105 |
16532895b4779db943fea2886912f96584b515d3 | 1,631 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_logentry.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_logentry.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/commonapi/controls/manage_logentry.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# 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 2
# of the License, or (at your option) any later version.
#!/usr/bin... | 32.62 | 95 | 0.632128 |
4c2adb6129284ad6763291505fd016b574d0fab5 | 1,075 | py | Python | CodeChef_problems/uncle_jhony/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | CodeChef_problems/uncle_jhony/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | CodeChef_problems/uncle_jhony/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # cook your dish here
t = int(input()) # Taking the Number of Test Cases
for i in range(t): # Looping over test cases
n = int(input()) # Taking the length of songs input
p = [int(i) for i in input().split()] # Taking the list of song... | 59.722222 | 177 | 0.552558 |
91333341e264ce6d8b49f97fb6dc226143c957e9 | 513 | py | Python | PMIa/2015/Velyan_A_S/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Velyan_A_S/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PMIa/2015/Velyan_A_S/task_3_6.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 3. Вариант 6.
# Напишите программу, которая выводит имя "Самюэл Ленгхорн Клеменс", и запрашивает его псевдоним. Программа должна сцеплять две эти строки и выводить полученную строку, разделяя имя и псевдоним с помощью тире.
# Velyan A. S.
# 27.05.2016
print("Герой нашей сегодняшней программы - Сэмюэл Ленгхор... | 46.636364 | 209 | 0.766082 |
e6ddd58a5d1bca3269797e210f69a6d17edf724e | 551 | py | Python | Contests/CCC/CCC '10 J5 - Knight Hop.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '10 J5 - Knight Hop.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '10 J5 - Knight Hop.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | y_a = [2, 2, -2, -2, -1, -1, 1, 1]
x_a = [1, -1, 1, -1, 2, -2, 2, -2]
s = []
start = list(map(int, input().split()))
stop = list(map(int, input().split()))
q = [start, None]
c = 0
def add_8_paths(p):
for a in range(8):
np = [p[0] + x_a[a], p[1] + y_a[a]]
if np not in q and np not in s and np[0] >... | 19.678571 | 67 | 0.453721 |
fc59ea037d6526648755b25f4fb9aba7764b26c7 | 344 | py | Python | src/network/bo/messages/connection_accepted.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 2 | 2021-11-08T12:00:02.000Z | 2021-11-12T18:37:52.000Z | src/network/bo/messages/connection_accepted.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | null | null | null | src/network/bo/messages/connection_accepted.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 1 | 2022-03-28T13:49:37.000Z | 2022-03-28T13:49:37.000Z | from .message import Message
class Connection_accepted(Message):
def __init__(self) -> None:
super().__init__()
self._name = "connection-accepted"
def to_dict(self):
return {
"name": self.get_name()
}
@staticmethod
def from_dict(dict):
return Conne... | 20.235294 | 42 | 0.590116 |
5d1831eb1ce2cc4139f684a7d70a97df2fd8824e | 2,056 | py | Python | tests/test_event.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | 2 | 2016-08-28T21:32:39.000Z | 2016-09-02T05:56:53.000Z | tests/test_event.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | 7 | 2016-09-01T22:03:13.000Z | 2019-06-13T21:38:05.000Z | tests/test_event.py | JeFaProductions/TextAdventure2 | 4ae690a1e41f30a564a77015f76346d55466c325 | [
"MIT"
] | null | null | null | import unittest
import tead.event as evt
class TestEventSystem(unittest.TestCase):
def myCallback(self, event):
self.called = self.called + 1
self.assertEqual('test', event.type)
self.assertIn('foo', event.userParam)
self.assertEqual('bar', event.userParam['foo'])
def setUp(s... | 35.448276 | 95 | 0.678502 |
53fbb49791e6b36bafc57121006da7c1a2c869ad | 7,875 | py | Python | bearpi-hm_nano-oh_flower/00_src/bearpi-hm_nano_oh_fun/build/lite/hb/build/build_process.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.3/build/lite/hb/build/build_process.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/build/lite/hb/build/build_process.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020 Huawei Device 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
... | 37.5 | 79 | 0.570286 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.