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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e8b690221b7fbd9f92ff75e247394263774270f2 | 4,399 | py | Python | research/cv/Neighbor2Neighbor/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/Neighbor2Neighbor/postprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/Neighbor2Neighbor/postprocess.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... | 43.554455 | 119 | 0.653785 |
ad58c8b7c581f17315cb4e94682018f1ca541478 | 411 | py | Python | pacman-arch/test/pacman/tests/sync134.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/sync134.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/sync134.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sysupgrade with a set of sync packages replacing a local one"
sp1 = pmpkg("pkg2")
sp1.replaces = ["pkg1"]
sp2 = pmpkg("pkg3")
sp2.replaces = ["pkg1"]
for p in sp1, sp2:
self.addpkg2db("sync", p)
lp = pmpkg("pkg1")
self.addpkg2db("local", lp)
self.args = "-Su"
self.addrule("PACMAN_RETCODE=0")... | 18.681818 | 81 | 0.676399 |
0f8699a052c2f1e60330b69ef82ad268455aaae7 | 3,482 | py | Python | easyp2p/ui/Ui_credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 4 | 2019-07-18T10:58:28.000Z | 2021-11-18T16:57:45.000Z | easyp2p/ui/Ui_credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 1 | 2019-07-05T09:21:47.000Z | 2019-07-05T09:21:47.000Z | easyp2p/ui/Ui_credentials_window.py | Ceystyle/easyp2p | 99c32e3ec0ff5a34733f157dd1b53d1aa9bc9edc | [
"MIT"
] | 2 | 2019-07-05T08:56:34.000Z | 2020-06-09T10:03:42.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/credentials_window.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_CredentialsWindow(object):
def setupUi(self, Credent... | 53.569231 | 112 | 0.759334 |
7e386eee8b49341c49c7022404ac3ae2424b96eb | 894 | py | Python | INBa/2015/RotkinAM/Zadacha_6_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/RotkinAM/Zadacha_6_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/RotkinAM/Zadacha_6_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 21.
# Создайте игру, в которой компьютер загадывает название одной из семи основных физических единиц, согласно Международной системы единиц , а игрок должен его угадать.
# Rotkin A.M.
# 20.04.2016
import random
a = ("Длинна", "Масса", "Время", "Энергия","Температура","Объем","Скорость")
b = random... | 34.384615 | 166 | 0.597315 |
7eb1b88604312ca6e7ee31266dfe6eb0f8b76cb9 | 161 | py | Python | BrickHack8/BrickHack8/views.py | aeh2657/BrickHack-8 | 3712d42613da7c5485815e1350e107db6bab8564 | [
"Apache-2.0"
] | null | null | null | BrickHack8/BrickHack8/views.py | aeh2657/BrickHack-8 | 3712d42613da7c5485815e1350e107db6bab8564 | [
"Apache-2.0"
] | 1 | 2022-03-06T01:20:18.000Z | 2022-03-06T01:20:18.000Z | BrickHack8/BrickHack8/views.py | aeh2657/BrickHack-8 | 3712d42613da7c5485815e1350e107db6bab8564 | [
"Apache-2.0"
] | 2 | 2022-03-05T21:06:41.000Z | 2022-03-05T21:10:51.000Z | from django.http import HttpResponse
from manage import main
def home(request):
return HttpResponse("Hello, Django!")
if __name__ == '__main__':
main() | 20.125 | 41 | 0.726708 |
0e3558c49f0e0de3ba0b88f02174cc6c48ebc0a4 | 48 | py | Python | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/common/exception.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | class PipelineKernelException(Exception):
pass
| 16 | 41 | 0.854167 |
0e6bdced0eabe10c59cb982a84a23580ebee6296 | 1,015 | pyde | Python | sketches/text03/text03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/text03/text03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/text03/text03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | font = None
pangramme = [u"Zwölf Boxkämpfer jagen Eva quer über den großen Sylter Deich.",
u"Jörg bäckt quasi zwei Haxenfüße vom Wildpony.",
u"Falsches Üben von Xylophonmusik quält jeden größeren Zwerg.",
u"Schweißgequält zündet Typograph Jakob verflixt öde Pangramme an.",
... | 33.833333 | 84 | 0.62069 |
bc252855d710f5c0424dcfcbcdc879a6d1ba1663 | 186 | py | Python | python/coursera_python/MICHIGAN/WEB/test/Special.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/WEB/test/Special.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/WEB/test/Special.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | # If we want the special regular expression to just behave normally we prefix it with '\'
import re
x = 'We just recieved $10.00 for cookies.'
y = re.findall('\$[0-9.]+',x)
print(y)
| 20.666667 | 89 | 0.672043 |
70fbe9b65ad044f963ad73da37f7fb684dbf42cb | 2,397 | py | Python | src/features/kf_frequency.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | 1 | 2015-11-30T09:27:51.000Z | 2015-11-30T09:27:51.000Z | src/features/kf_frequency.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | src/features/kf_frequency.py | Somsubhra/Enrich | cf1e69b86ceb64c8b09c98b442e09c1196b50125 | [
"MIT"
] | null | null | null | # Headers
__author__ = 'Somsubhra Bairi'
__email__ = 'somsubhra.bairi@gmail.com'
# All imports
from os import walk, path, stat
from extras import Logger
# The Kucera Francis frequency class
class KFFrequency:
# Constructor for the Kucera Francis frequency class
def __init__(self, in_dir, out_file, dict_fi... | 28.879518 | 78 | 0.604923 |
69ddaba5c2071055684fdc4ef8ae02fa3c1e87c0 | 882 | py | Python | Chapter7_CNN/Chapter7_1_CNN_Layers/cnnConvolutionalSolution.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter7_CNN/Chapter7_1_CNN_Layers/cnnConvolutionalSolution.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter7_CNN/Chapter7_1_CNN_Layers/cnnConvolutionalSolution.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.datasets import mnist
def conv2D(image: np.ndarray, kernel: np.ndarray) -> np.ndarray:
rows, cols = image.shape # 28x28
k_size, _ = kernel.shape # 2x2
conv_image = np.zeros(shape=(rows, cols), dtype=np.float32) # 28x28
... | 27.5625 | 84 | 0.614512 |
3881cf5adda65b81ab68529bbda297e7d815abca | 100 | py | Python | Online-Judges/CodingBat/Python/Logic-01/Logic_1-07-love6.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Logic-01/Logic_1-09-near_ten.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Logic-01/Logic_1-09-near_ten.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def love6(a, b):
if a == 6 or b == 6 or a+b == 6 or abs(a-b) == 6:
return True
return False
| 20 | 51 | 0.52 |
93307a8972d2c9eb70a7b13470c398b6dd9f186d | 7,148 | py | Python | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/inspector/scripts/codegen/generate_js_backend_commands.py | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | 1 | 2019-01-25T13:55:25.000Z | 2019-01-25T13:55:25.000Z | #!/usr/bin/env python
#
# Copyright (c) 2014, 2016 Apple Inc. All rights reserved.
# Copyright (c) 2014 University of Washington. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributio... | 48.958904 | 170 | 0.659905 |
87d1f0fa41c7f393494dc93bd8d6a1e42d293dcd | 11,555 | py | Python | mt_utils.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | mt_utils.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | mt_utils.py | SevenDaysDA/MetaScience_Datenaufbereitung | a7a68c59dc96fa0b56c85a29505f8cb4fc06ccb1 | [
"Apache-2.0"
] | null | null | null | import glob
from io import StringIO
import pandas as pd
import os
from scipy.stats import pearsonr
def find_corpus(name):
WMT2017 = dict({
"newstest2017-csen-ref.en": "cs-en",
"newstest2017-deen-ref.en": "de-en",
"newstest2017-fien-ref.en": "fi-en",
"newstest2017-lven-ref.en": "lv-... | 34.085546 | 157 | 0.459368 |
87e5a1724254ae9b07eb252430107e3d10e1e684 | 1,198 | py | Python | test/test_npu/test_network_ops/test_indexing.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_indexing.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_indexing.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... | 41.310345 | 87 | 0.732888 |
35dfef04b87cb2549cadfc95ad9b4d1f4043db62 | 160 | py | Python | Project Euler/Problem_1/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 26 | 2019-07-17T11:05:43.000Z | 2022-02-06T08:31:40.000Z | Project Euler/Problem_1/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 7 | 2019-07-16T19:52:25.000Z | 2022-01-08T08:03:44.000Z | Project Euler/Problem_1/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 19 | 2020-01-14T02:44:28.000Z | 2021-12-27T17:31:59.000Z | def main():
sum = 0
for i in range(1000):
if i%3 == 0 or i%5 == 0:
sum = sum+i
print(sum)
if __name__ == '__main__':
main() | 17.777778 | 32 | 0.45625 |
ea1043d1cbd1ae0e9540dcfa28d51e04e7950d83 | 3,182 | py | Python | src/bo4e/com/zeitraum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/zeitraum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/zeitraum.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Zeitraum class
and corresponding marshmallow schema for de-/serialization
"""
from datetime import datetime
from decimal import Decimal
from typing import Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSc... | 34.967033 | 171 | 0.730044 |
a4c710b4be85c701f6eac6090454d3493bd4cff7 | 1,313 | py | Python | Python/Sonstige_Uebungen/loadingbar.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/loadingbar.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/loadingbar.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | from time import sleep
def loading():
# Setze globale Variablen
global current_direction
global current_position
# Defniere Aussehen des Ladebalkens
loading_bar = "[ ]"
# Definiere das zu bewegende Objekt
loading_symbol_fw = ">++('>"
loading_symbol_bw = "<... | 31.261905 | 130 | 0.656512 |
352ee8311129b7cd7f1b74735cd4c6fe5900e4c6 | 2,632 | py | Python | app/controllers/auth/UserController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/auth/UserController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/controllers/auth/UserController.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | from flask import render_template, request, jsonify, redirect, session
from app import app
from app.models.auth.User import User
from app.models.auth.Bussiness import Bussiness
from app.models.auth.Encrypto import Encrypto
@app.route("/auth/login/", methods=["POST"])
def login():
email = request.form.get("email")... | 21.225806 | 82 | 0.616261 |
0db07caa5c0a61026b5c4daef51ec48c90132d0b | 228 | py | Python | exercises/ja/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_02_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert 'spacy.load("ja_core_news_md")' in __solution__, "中サイズのモデルをロードしましたか?"
assert "doc[7].vector" in __solution__, "正しいベクトルを取得しましたか?"
__msg__.good("Well done!次章では、単語ベクトルを用いたdoc、スパン、トークン間の類似度の予測を行います。")
| 45.6 | 80 | 0.741228 |
1d07a34f9ad7aab1642f573b2ee114915f78f449 | 5,718 | py | Python | official/cv/crnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/crnn/src/dataset.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/crnn/src/dataset.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... | 38.12 | 119 | 0.656348 |
df6be670787e306b49f03dd9a82eeb00bc73ffb9 | 983 | py | Python | leetcode/680-Valid-Palindrome-II/bruce_force_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/680-Valid-Palindrome-II/bruce_force_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/680-Valid-Palindrome-II/bruce_force_optimized.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # my original version
def is_palindrome(st):
l, r = 0, len(st) - 1
while l < r:
if st[l] != st[r]:
return False
l += 1
r -= 1
return True
class Solution:
def validPalindrome(self, s: str) -> bool:
if is_palindrome(s):
return True
l, r = ... | 20.479167 | 77 | 0.436419 |
33f66980a755462e8a3b327ca7c48a1d6d176209 | 95 | py | Python | python/pathlib/origin/read_text.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pathlib/origin/read_text.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/pathlib/origin/read_text.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from pathlib import Path
path = Path('words.txt')
contents = path.read_text()
print(contents) | 15.833333 | 27 | 0.747368 |
d585a892a6e661692ae4213ad553e2eaa7d78a11 | 147 | py | Python | manager.py | FlaskTeam/FlaskAXF | 7b8c4128ca8339397274ab89ba2035768f16aa92 | [
"Apache-2.0"
] | 2 | 2018-04-23T08:44:44.000Z | 2018-04-23T08:44:51.000Z | manager.py | FlaskTeam/FlaskAXF | 7b8c4128ca8339397274ab89ba2035768f16aa92 | [
"Apache-2.0"
] | null | null | null | manager.py | FlaskTeam/FlaskAXF | 7b8c4128ca8339397274ab89ba2035768f16aa92 | [
"Apache-2.0"
] | null | null | null | from flask_script import Manager
from App import create_app
app = create_app()
manager = Manager(app)
if __name__ == '__nain__':
manager.run | 16.333333 | 32 | 0.748299 |
635c0f1fd69ff1c6ed02004f96168b920fb39f65 | 1,442 | py | Python | Packs/FeedGCPWhitelist/Integrations/FeedGoogleIPRanges/FeedGoogleIPRanges.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FeedGCPWhitelist/Integrations/FeedGoogleIPRanges/FeedGoogleIPRanges.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FeedGCPWhitelist/Integrations/FeedGoogleIPRanges/FeedGoogleIPRanges.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 JSONFeedApiModule import * # noqa: E402
feed_config = {
'All GCP customer global and regional external IP ranges':
dict(CIDR={
'url': 'https://www.gstatic.com/ipranges/cloud.json',
'extractor': "prefixes[]",
... | 34.333333 | 81 | 0.588766 |
63babe5273bd424afbcbdf2b3342a550664b24af | 1,017 | py | Python | jumeaux/addons/final/viewer.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/addons/final/viewer.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/addons/final/viewer.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
import os
import shutil
from jumeaux.addons.final import FinalExecutor
from jumeaux.models import FinalAddOnPayload, FinalAddOnReference
from jumeaux.logger import Logger
logger: Logger = Logger(__name__)
LOG_PREFIX = "[final/viewer]"
VIEWER = os.path.abspath(f"{os.path.dirname(__file__)}/../.... | 36.321429 | 140 | 0.712881 |
9849fdae143cabee22666f63f3a723f775d995dd | 3,375 | py | Python | test/test_npu/test_network_ops/test_max_pool3d_withindices_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_max_pool3d_withindices_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_max_pool3d_withindices_backward.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... | 45 | 107 | 0.649185 |
120810f70a31cb9a17e5848d016e79d501d729cc | 2,542 | py | Python | python_experiments/run_parallel_local_push.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/run_parallel_local_push.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/run_parallel_local_push.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from exec_utilities import time_out_util
from exec_utilities.exec_utils import *
def run_exp():
our_exec_path = '/homes/ywangby/workspace/yche/git-repos/SimRank/LPMC-Parallel-Profile/build-icc'
data_set_lst = [
'ca-GrQc', 'ca-HepTh', 'p2p-Gnutella06', 'wiki-Vote',
# 'email-Enron', 'email-EuAl... | 37.940299 | 120 | 0.568057 |
1215119d74657a4c46b248b6948ba18e7e02d0bf | 961 | py | Python | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_unixccompiler.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_distutils_unixccompiler.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/lang/python27/patches/patch-Lib_distutils_unixccompiler.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-Lib_distutils_unixccompiler.py,v 1.4 2016/07/02 15:05:43 adam Exp $
* from cygport 2.7.3-dylib.patch
--- Lib/distutils/unixccompiler.py.orig 2016-06-25 21:49:30.000000000 +0000
+++ Lib/distutils/unixccompiler.py
@@ -84,6 +84,7 @@ class UnixCCompiler(CCompiler):
xcode_stub_lib_format = dylib_lib_fo... | 35.592593 | 82 | 0.586889 |
1ae4b14ac41ff779f1ef9892c3915cf592f9e279 | 2,201 | py | Python | scripts/tms_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | scripts/tms_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | scripts/tms_writer.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
import os
import sys
import getopt
from textwrap import dedent
from forge.lib.tiler import TilerManager
from forge.lib.helpers import error
def usage():
print(dedent('''\
Usage: venv/bin/python scripts/tms_writer.py
[-d database.cfg|--database=database.cfg]
... | 29.346667 | 75 | 0.566561 |
dcda1893c3c1cdd38a0dafbaba2592a65dcaa64d | 83 | py | Python | buzzer/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | buzzer/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | buzzer/__init__.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._buzzer_callback import BuzzerCallback
from ._buzzer_core import BuzzerCore
| 20.75 | 44 | 0.86747 |
b4d848ba1e3e3c6af0c3e6717eabdec0798778cc | 2,301 | py | Python | morse.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | morse.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | morse.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # -*- coding: utf-8 -*-
# @Author: lock
# @Date: 2017-12-15 15:39:07
# @Last Modified by: lock
# @Last Modified time: 2017-12-15 16:13:19
# 摩斯密码是由美国的三缪摩斯发明的一套加密算法,是一种断断续续的信号代码。
import optparse
# 摩斯代码表
CODE_TABLE = {
# 26 个英文字符
'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F... | 28.407407 | 89 | 0.3794 |
2e99732b5e4d35104be8185e584067e4f91a82b6 | 854 | py | Python | LDA/wikifetcher.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | 1 | 2018-05-14T10:02:54.000Z | 2018-05-14T10:02:54.000Z | LDA/wikifetcher.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null | LDA/wikifetcher.py | Wurmloch/TopicModeling | e8c0b933a0e7dc9e668f6ad3ab371c7f2b84becc | [
"MIT"
] | null | null | null | import wikipedia
import ldabuilder
import re
sentence_pat = re.compile(r'([A-Z][^\.!?]*[\.!?])', re.M)
doc_list = []
wikipedia.set_lang('de')
def get_random_page():
return(wikipedia.random.content)
def get_page(name):
first_found = wikipedia.search(name)[0]
try:
return(wikipedia.page(first_found)... | 28.466667 | 83 | 0.725995 |
2c1922ce6a6f03eac43f857b5d20e68ea84f64d4 | 164 | py | Python | python/shlex/shlex_split.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/shlex/shlex_split.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/shlex/shlex_split.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # shlex_split.py
import shlex
text = """This text has "quoted parts" inside it."""
print(f"ORIGINAL: {text!r}")
print()
print("TOKENS:")
print(shlex.split(text))
| 16.4 | 52 | 0.682927 |
25d8d9d8ec40b215f1cd15df051010597867b55f | 10,006 | py | Python | Packs/AccentureCTI/Integrations/ACTIVulnerabilityQuery/ACTIVulnerabilityQuery.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 1 | 2022-03-15T13:16:24.000Z | 2022-03-15T13:16:24.000Z | Packs/AccentureCTI/Integrations/ACTIVulnerabilityQuery/ACTIVulnerabilityQuery.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/AccentureCTI/Integrations/ACTIVulnerabilityQuery/ACTIVulnerabilityQuery.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | null | null | null | import demistomock as demisto
from CommonServerPython import * # noqa # pylint: disable=unused-wildcard-import
import requests
import traceback
from typing import List
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%d %H:%... | 37.197026 | 220 | 0.624625 |
25edb2d83864353504471177364e3d8fa3976e5e | 1,554 | py | Python | pytestDemo/common/mysql_operate.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/common/mysql_operate.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | pytestDemo/common/mysql_operate.py | lthinktime/testdemo | 509656d62535ed06e222c08671db11e31d9b3162 | [
"Apache-2.0"
] | null | null | null | import pymysql
import os
from common.read_data import data
from common.logger import logger
BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
data_file_path = os.path.join(BASE_PATH, "config", "setting.ini")
data = data.load_ini(data_file_path)["mysql"]
DB_CONF = {
"host": data["MYSQL_HOST"... | 26.338983 | 72 | 0.593951 |
2c399793654938b9bfa06a8ac3bd0bbc7b8657de | 1,474 | py | Python | python_schools/iterators.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | python_schools/iterators.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | python_schools/iterators.py | nussbrot/code-exchange | 3427798c4391e5f9c17cd19399ac56997c091ee2 | [
"MIT"
] | null | null | null | # the iterator protocol needs functions __iter__() and __next__()
class iterator_protocol(object):
def __init__(self, *args):
self._data = args
self._idx = 0
def __iter__(self):
return self
def __next__(self):
if self._idx < len(self._data):
tmp = self._data[se... | 21.676471 | 81 | 0.612619 |
1a79c60ba3f77d4a5a7a0316b28e63c6f1464408 | 1,288 | py | Python | DataStructures/DisjoinSet/Tree.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/DisjoinSet/Tree.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | DataStructures/DisjoinSet/Tree.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
def find(disjoin_set, i):
if disjoin_set[i] <= -1:
return i
else:
disjoin_set[i] = find(disjoin_set, disjoin_set[i])
return disjoin_set[i]
N = int(raw_input())
#这一行非常耗时
#sum_num = factorial(N) / (factorial(3)*factorial(N-3))
disjoin_set = [-1] * (N+1)
for _ in xrange(N-... | 21.466667 | 68 | 0.542702 |
1a8b5317dbb89490ca839d24cc62b19561b6caee | 1,005 | py | Python | Packs/NCSCCyberAsssessmentFramework/Scripts/EntryWidgetNCSCResultsA/EntryWidgetNCSCResultsA.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/EntryWidgetNCSCResultsA/EntryWidgetNCSCResultsA.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/NCSCCyberAsssessmentFramework/Scripts/EntryWidgetNCSCResultsA/EntryWidgetNCSCResultsA.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
incident = demisto.incidents()
cafaresult = incident[0].get("CustomFields", {}).get("cafaresultraw", {})
if type(cafaresult) != dict:
cafaresult = json.loads(cafaresult)
total = len(cafaresult)
non_compliant_count = (
le... | 27.916667 | 85 | 0.514428 |
1a9ba56afc748c528dfcb2a1b7a123e3ebc9c190 | 119,619 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/bedtool.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/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/bedtool.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/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/bedtool.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | from __future__ import print_function
import tempfile
from textwrap import dedent
import shutil
import subprocess
import operator
import os
import sys
import random
import string
import pprint
from itertools import islice
import multiprocessing
import six
import gzip
import pysam
from .helpers import (
get_tempdir... | 34.935456 | 110 | 0.551083 |
b382e3d1a2df1aacde5c376b2575e3193fba796b | 973 | py | Python | generate.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-08-31T07:16:40.000Z | 2018-08-31T07:16:40.000Z | generate.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | null | null | null | generate.py | yashpatel5400/anonychain | 921804832839f3639477cfc441f138bc2f5ad685 | [
"MIT"
] | 1 | 2018-07-01T18:03:01.000Z | 2018-07-01T18:03:01.000Z | """
__author__ = Yash Patel
__name__ = generate.py
__description__ = Generates the tests to be run given a file in root directory
"""
import os
def generate(in_fn="tests.txt",out_fn="tests.sh"):
if not os.path.isfile(in_fn):
print("No test file found! Exiting now...")
template = "python... | 28.617647 | 79 | 0.509764 |
03eb1d3f5c17df12f26974552e341796948b7785 | 824 | py | Python | scripts/convert_location.py | chikeabuah/reach-lang | 933111af6770ff226f37019b09893ee79ba10144 | [
"Apache-2.0"
] | 525 | 2019-09-03T09:52:41.000Z | 2022-03-30T19:42:32.000Z | scripts/convert_location.py | chikeabuah/reach-lang | 933111af6770ff226f37019b09893ee79ba10144 | [
"Apache-2.0"
] | 305 | 2020-01-23T23:54:31.000Z | 2022-03-31T16:31:57.000Z | scripts/convert_location.py | chikeabuah/reach-lang | 933111af6770ff226f37019b09893ee79ba10144 | [
"Apache-2.0"
] | 148 | 2019-11-13T14:36:18.000Z | 2022-03-30T08:24:14.000Z | import requests
import csv
import json
import sys
def getInfo(ip):
url = "http://api.ipstack.com/" + ip + "?access_key=5abb1d1c4e614029ec30c94dee269d19"
response = requests.request("GET", url, params={"format":"json"})
return json.loads(response.text)
filename = sys.argv[1]
inputFile = open(filename, newline='... | 24.235294 | 89 | 0.694175 |
45ada870e059df65671420e2f84f1fcf85a4036d | 2,244 | py | Python | tools/gen_licenses.py | mgr-lhm/UnicodeEingabeKiwi2 | 5b577d662f3eb5987fa17c68ea5c9eb4f94badbe | [
"MIT"
] | null | null | null | tools/gen_licenses.py | mgr-lhm/UnicodeEingabeKiwi2 | 5b577d662f3eb5987fa17c68ea5c9eb4f94badbe | [
"MIT"
] | 1 | 2022-03-29T09:55:30.000Z | 2022-03-29T09:55:30.000Z | tools/gen_licenses.py | mgr-lhm/UnicodeEingabeKiwi2 | 5b577d662f3eb5987fa17c68ea5c9eb4f94badbe | [
"MIT"
] | 1 | 2021-12-17T09:23:53.000Z | 2021-12-17T09:23:53.000Z | #!/usr/bin/python3
#
# setup:
# 1. Install tools
# - npm install -g license-checker
# 2. Run script in webapp root dir
# - ./tools/generate_licenses >{basename outputfile}
#
#
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
#
import sys
import json
import subprocess
import pprint
import re
import urllib
... | 24.391304 | 84 | 0.608289 |
6403824e82519d9e9b96f9b67539e17b5a3f80f4 | 2,324 | py | Python | official/cv/yolov3_darknet53/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/yolov3_darknet53/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/yolov3_darknet53/ascend310_quant_infer/export_bin.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.098361 | 115 | 0.670396 |
64170cb72cdd883a9fc614e292978e46ac8e19e3 | 419 | py | Python | ib_connection/IBApi.py | nic-fillion/SMALET | 011844a2ee23383f4cbd9df4f394de086f873fc6 | [
"MIT"
] | null | null | null | ib_connection/IBApi.py | nic-fillion/SMALET | 011844a2ee23383f4cbd9df4f394de086f873fc6 | [
"MIT"
] | null | null | null | ib_connection/IBApi.py | nic-fillion/SMALET | 011844a2ee23383f4cbd9df4f394de086f873fc6 | [
"MIT"
] | null | null | null | from ibapi.client import EClient
from ibapi.wrapper import EWrapper
class IBApi(EWrapper, EClient):
def __init__(self):
EWrapper.__init__(self)
EClient.__init__(self, self)
def tickPrice(self, reqId, tickType, price, attrib):
print(reqId)
print(tickType)
print(price)
... | 27.933333 | 56 | 0.630072 |
929beac27f40b697b3cbd026da649db0415960ef | 306 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_1/set_sales_person_status.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/v7_1/set_sales_person_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_1/set_sales_person_status.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('setup','doctype','sales_person')
frappe.db.sql("""update `tabSales Person` set enabled=1
where (employee is null or employee = ''
or employee IN (select employee from tabEmployee where status != "Left"))""")
| 34 | 80 | 0.735294 |
2ba3a8fa83ce4ef4a0ed7af0714a73f907105599 | 1,780 | py | Python | Chapter5_DNN/Chapter5_6_NeuralNetworkMath/visualizeActivations2.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter5_DNN/Chapter5_6_NeuralNetworkMath/visualizeActivations2.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | Chapter5_DNN/Chapter5_6_NeuralNetworkMath/visualizeActivations2.py | thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | [
"MIT"
] | null | null | null | from typing import Tuple
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import Adam
def f(x: float) -> float:
return x ** 2 + x + 10
def r... | 25.428571 | 73 | 0.592697 |
a6722c6b8c5acfb9c743a1e8dcf621f5ae93d70d | 15,574 | py | Python | Packs/PrismaSaasSecurity/Integrations/SaasSecurity/SaasSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PrismaSaasSecurity/Integrations/SaasSecurity/SaasSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PrismaSaasSecurity/Integrations/SaasSecurity/SaasSecurity_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import io
from freezegun import freeze_time
import pytest
import json
from CommonServerPython import DemistoException, EntryType, EntryFormat
from datetime import datetime
from SaasSecurity import Client
import demistomock as demisto
def util_load_json(path):
with io.open(path, mode='r', encoding='utf-8') as f:
... | 41.978437 | 127 | 0.655837 |
a6c72c02690180700d8cc8ff8c2f8d6b3a1bc65a | 1,620 | py | Python | PythonAPI/util/osm2xodr.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | PythonAPI/util/osm2xodr.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | PythonAPI/util/osm2xodr.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | # coding: utf-8
import argparse
import glob
import os
import sys
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.name == 'nt' else 'linux-x86_64'))[0])
except IndexError:
pass
import carla
# import... | 27.931034 | 112 | 0.669136 |
5ba0955530f34ed14212b65ac939a8d2a69a1726 | 1,403 | py | Python | .arch/plugins/doc_lcdoc/py_tst.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | .arch/plugins/doc_lcdoc/py_tst.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | .arch/plugins/doc_lcdoc/py_tst.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Allows to run the full cycle for autodocs generation
"""
from plugins import _tools as tools
from devapp.app import app
from devapp import tools as datools
import os, sys, json
# ------------------------------------------------------------------------------ config
class Flags(tools.DfltFl... | 23.779661 | 89 | 0.534569 |
f3b8ef67a9041ab4faeb1748639d5716688d33a1 | 459 | py | Python | scripts/component_graph/server/net/__init__.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/net/__init__.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/component_graph/server/net/__init__.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.
"""The net module is a namespace for network handlers used by the graph server.
The net module provides:
1. The ApiHandler which imple... | 35.307692 | 79 | 0.784314 |
3411433fa0a8f56d33c5f5aa532b1988bfb27a3e | 367 | py | Python | pacman-arch/test/pacman/tests/config001.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/config001.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/config001.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Quick check for Include being parsed in [options]"
self.option['Include'] = ['/dev/null']
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"
self.addpkg2db("local", p)
self.args = "-Qi ... | 20.388889 | 70 | 0.656676 |
1b26d04c198461c62641c40e52926fd45d1244fd | 5,768 | py | Python | autojail/model/jailhouse.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/model/jailhouse.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/model/jailhouse.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | # FIXME: Dicts should be replaced by OrderedDict when 3.6 support is dropped
from pathlib import Path
from typing import Dict, List, Optional, Union
from pydantic import BaseModel
from pydantic.networks import IPvAnyInterface, IPvAnyNetwork
from typing_extensions import Literal
from .board import (
Board,
De... | 25.522124 | 79 | 0.641297 |
84e685cde3c7d90ee3368925a302317baa7fbb68 | 406 | py | Python | testfilter.py | tfragner/hugo-website | 872c58ba4a90cbd414d554bde16637caa68b8f27 | [
"MIT"
] | null | null | null | testfilter.py | tfragner/hugo-website | 872c58ba4a90cbd414d554bde16637caa68b8f27 | [
"MIT"
] | null | null | null | testfilter.py | tfragner/hugo-website | 872c58ba4a90cbd414d554bde16637caa68b8f27 | [
"MIT"
] | null | null | null | import glob
import panflute as pf
def prepare(doc):
pass
def action(elem, doc):
if isinstance(elem, pf.Image):
elem.url = "../" + elem.url
def finalize(doc):
pass
def main(doc=None):
return pf.run_filter(action,
prepare=prepare,
finaliz... | 14.5 | 43 | 0.522167 |
04c0009e083cb5ddf7dd3cf2522b5129fee6fa58 | 1,673 | py | Python | csp1/app.py | wectf/2021 | 333086b618aae8f95449265b6ec94eb6db4e57a9 | [
"MIT"
] | 26 | 2021-06-20T17:01:16.000Z | 2022-02-22T03:13:18.000Z | WeCTF/2021/CSP1/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | WeCTF/2021/CSP1/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 4 | 2021-06-20T17:08:19.000Z | 2021-07-04T08:36:56.000Z | import urllib.parse
import uuid
from flask import Flask, render_template, request, redirect, make_response
from bs4 import BeautifulSoup as bs
from peewee import *
app = Flask(__name__)
db = SqliteDatabase("core.db")
class Post(Model):
id = AutoField()
token = CharField()
content = TextField()
cl... | 24.602941 | 102 | 0.622236 |
f3ec1648c504cfd20c80743523ceec4f14fb647a | 3,380 | py | Python | soundcloud-dl-master/soundcloud-dl.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 331 | 2018-09-01T18:59:15.000Z | 2022-03-25T09:23:28.000Z | soundcloud-dl.py | si3mshady/soundcloud-dl | 75c17559fc626508a8f8f4a2469df447923c4eac | [
"MIT"
] | 5 | 2018-09-01T19:02:18.000Z | 2019-05-12T12:39:28.000Z | soundcloud-dl.py | si3mshady/soundcloud-dl | 75c17559fc626508a8f8f4a2469df447923c4eac | [
"MIT"
] | 43 | 2018-09-01T20:42:15.000Z | 2022-02-09T14:35:50.000Z | #!/usr/bin/env python3
import re
import urllib.request
import json
import codecs
import os
import sys
import argparse
import requests
import mutagen
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3, APIC
CLIENTID = "Oa1hmXnTqqE7F2PKUpRdMZqWoguyDLV0"
API = "https://api.soundcloud.com/i1/tracks/{0}/strea... | 24.671533 | 112 | 0.636982 |
edfbaf646535d7e6b8307d29af3f35e636744f5b | 527 | py | Python | pyventskalender/tag17_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag17_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null | pyventskalender/tag17_loesung.py | kopp/pyventskalender | 6f6455f3c1db07f65a772b2716e4be95fbcd1804 | [
"MIT"
] | null | null | null |
class Katze:
def __init__(self, name):
self.name = name
self.magen = []
def macht_ton(self):
return "{} macht Miauuuuu".format(self.name)
def frisst(self, essen: str) -> str:
self.magen.append(essen)
return "{} mag {}".format(self.name, essen)
katzen = [
Katz... | 19.518519 | 52 | 0.563567 |
b68b384a4c3f02d4ba025912bc7d180989227419 | 678 | py | Python | semdial_proceedings_code/extract_meta.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | null | null | null | semdial_proceedings_code/extract_meta.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | null | null | null | semdial_proceedings_code/extract_meta.py | briemadu/semdial-proceedings | 59f13adcc73dc9433c3c07ee929fadd8d271b022 | [
"Apache-2.0"
] | 2 | 2021-09-16T07:16:15.000Z | 2021-10-30T06:41:55.000Z | #!/bin/env python
"""from toc.tex generated by easychair, extract metadata necessary for toc generation: title, authors"""
import sys
toc = [x.strip() for x in open(sys.argv[1]).readlines()]
index = {}
for line in toc:
if line.startswith("\\tocTitle{"):
#print line
title = "}".join(line.split("}... | 26.076923 | 104 | 0.538348 |
b68eade69175ac38a7abdf373f9d84e9373a4cae | 8,485 | py | Python | Packs/AWS-SNS/Integrations/AWSSNS/AWSSNS.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | Packs/AWS-SNS/Integrations/AWSSNS/AWSSNS.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 40 | 2022-03-03T07:34:00.000Z | 2022-03-31T07:38:35.000Z | Packs/AWS-SNS/Integrations/AWSSNS/AWSSNS.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | null | null | null | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
def create_entry(title, data, ec):
return {
'ContentsFormat': formats['json'],
'Type': entryTypes['note'],
'Contents': data,
'ReadableContentsFormat': formats['markdown'],
'HumanReada... | 37.378855 | 118 | 0.62145 |
1e101aa7d9c673256874cd7f530a94ca8cf7b010 | 5,126 | py | Python | test/test_npu/test_network_ops/test__Ixor__.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test__Ixor__.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test__Ixor__.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... | 39.430769 | 95 | 0.655287 |
1e224fe04f97810e05142a6b522fbd6fbd99d626 | 460 | py | Python | vorl1-ueb3.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl1-ueb3.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl1-ueb3.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # Übung/Aufgabe 3: Fibonacci Folge bis zu Zahl
def fib(fibMax):
fibZuvor = 0
fibAktuell = 1
while fibAktuell < fibMax:
fibTmp = fibZuvor + fibAktuell
fibZuvor = fibAktuell
fibAktuell = fibTmp
print (str(fibAktuell))
while True:
fibMax = input ("Bitte die gewünschte höch... | 27.058824 | 90 | 0.667391 |
1e56aa63a1f6e6806bc1f069f5d9b6082b753cee | 302 | py | Python | Project Euler/Problem_4/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 26 | 2019-07-17T11:05:43.000Z | 2022-02-06T08:31:40.000Z | Project Euler/Problem_4/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 7 | 2019-07-16T19:52:25.000Z | 2022-01-08T08:03:44.000Z | Project Euler/Problem_4/solution.py | Nidita/Data-Structures-Algorithms | 7b5198c8d37e9a70dd0885c6eef6dddd9d85d74a | [
"MIT"
] | 19 | 2020-01-14T02:44:28.000Z | 2021-12-27T17:31:59.000Z | def is_palindrome(n):
n = str(n)
return n == n[::-1]
def main():
max = 0
for i in range(999, 99, -1):
for j in range(999, 99, -1):
if is_palindrome(i*j):
if i*j>max:
max = i*j
print(max)
if __name__ == '__main__':
main() | 20.133333 | 36 | 0.44702 |
78112d11908cddf7e6d81688bd8e5f89b08a42ad | 207 | py | Python | 1572-matrix-diagonal-sum/1572-matrix-diagonal-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1572-matrix-diagonal-sum/1572-matrix-diagonal-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1572-matrix-diagonal-sum/1572-matrix-diagonal-sum.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def diagonalSum(self, mat: List[List[int]]) -> int:
n = len(mat)
output = sum([mat[i][i]+mat[i][n-1-i] if n!=2*i+1 else mat[i][i] for i in range(n)])
return output | 41.4 | 92 | 0.555556 |
7848a100a4d5346eeec5d90ae4080d89dbd0efc2 | 2,816 | py | Python | Utils/github_workflow_scripts/delete_stale_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/github_workflow_scripts/delete_stale_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/github_workflow_scripts/delete_stale_contrib_branches.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | #!/usr/bin/env python3
import os
import sys
import urllib3
from blessings import Terminal
from github import Github, enable_console_debug_logging
from github.Repository import Repository
from typing import List
from dateparser import parse
from datetime import datetime, timezone
from utils import timestamped_print
ur... | 37.052632 | 105 | 0.67223 |
158159f954c2bfad69dc6b64541ba7d22602eebc | 11,087 | py | Python | core/window.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | core/window.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | core/window.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | import tkinter as tk
from tkinter import *
from tkinter import ttk
import tkinter.messagebox as mb
from core.execute import *
class Window:
def __init__(self):
# build ui
self.root = tk.Tk()
self.root.title("Auto Work")
self.root.geometry(f"{int(pyautogui.size()[0] / 3)}"
... | 41.062963 | 152 | 0.598449 |
eca47d79657d63891f30d22ccb0a8d55f1016936 | 1,095 | py | Python | src/bo4e/enum/rechnungstyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/rechnungstyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/rechnungstyp.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint: disable=missing-module-docstring, line-too-long
from bo4e.enum.strenum import StrEnum
class Rechnungstyp(StrEnum):
"""
Abbildung verschiedener Rechnungstypen zur Kennzeichnung von Rechnungen
"""
ENDKUNDENRECHNUNG = (
"ENDKUNDENRECHNUNG" #: Eine Rechnung vom Lieferanten an einen End... | 54.75 | 208 | 0.769863 |
bd5af33b46c89fb62386b91124f5b347498ad1df | 1,270 | py | Python | setup.py | ruum42/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | 12 | 2015-02-14T15:15:40.000Z | 2020-06-23T12:32:05.000Z | setup.py | hassoon1986/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | null | null | null | setup.py | hassoon1986/pySchloss | f1415b48187ef0966019051e7681ae59a274215b | [
"Apache-2.0"
] | 7 | 2015-07-29T18:54:37.000Z | 2021-01-27T17:24:37.000Z | from distutils.core import setup
setup(
name='pySchloss',
version='0.2',
packages=['pySchloss'],
url='https://github.com/PJaros/pySchloss',
license='Apache License, Version 2.0',
author='Paul Jaros',
author_email='jaros.paul@gmail.com',
description='Programm zum Schlosssystem im Ruum42'... | 33.421053 | 77 | 0.628346 |
da18c4fd926a03285cb41f190ddbbe166aa1f6c7 | 557 | py | Python | ebenezer/atencion/views/diagnostic_tag/view.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | ebenezer/atencion/views/diagnostic_tag/view.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | 3 | 2020-02-11T23:15:00.000Z | 2021-06-10T20:52:17.000Z | ebenezer/atencion/views/diagnostic_tag/view.py | davrv93/ebenezer-backend | d3db4dafd9a8c35bea9f32afe2be1dd451f64298 | [
"Apache-2.0"
] | null | null | null | from ...models.diagnostic_tag import DiagnosticTag
from django_filters import rest_framework as django_filters
from rest_framework import serializers, viewsets
from .serializer import DiagnosticTagSerializer
# from .filters import DiagnosticTagFilter
class DiagnosticTagViewSet(viewsets.ModelViewSet):
queryset = ... | 34.8125 | 59 | 0.809695 |
e50751a8752b48f207b42acfad883ab73416851a | 337 | py | Python | leetcode/231-Power-of-Two/PowofTwo_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/231-Power-of-Two/PowofTwo_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/231-Power-of-Two/PowofTwo_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution:
# @param {integer} n
# @return {boolean}
def isPowerOfTwo(self, n):
if n < 1:
return False
while n != 1:
after = n >> 1
new = after << 1
if new != n:
return False
else:
n = after
... | 19.823529 | 30 | 0.397626 |
e51f11d8170f367d45060190ed790985ea3874ba | 1,414 | py | Python | ui/ecManProgressDialog.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | ui/ecManProgressDialog.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | 9 | 2019-05-11T19:53:01.000Z | 2020-11-10T07:24:14.000Z | ui/ecManProgressDialog.py | greenorca/ECMan | 744cb2ec97d52a68d45cf40a967ac60b92dafbb4 | [
"MIT"
] | null | null | null | '''
Created on Jan 28, 2019
@author: sven
'''
from PySide2.QtWidgets import QDialog
from ui.progressDialog import Ui_progressDialog
class EcManProgressDialog(QDialog):
'''
QDialog based Configuration dialog for ECMan app
adapted from https://www.codementor.io/deepaksingh04/design-simple-dialog-using-pyq... | 32.136364 | 113 | 0.676803 |
00f100ca4e7e80f7f28acb8c005201db51e2a577 | 1,548 | py | Python | log.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | log.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null | log.py | 15menou/srocket | 7650d25ef03499ce38ae957cd6ce356541f6cf61 | [
"Apache-2.0"
] | null | null | null |
class Log:
HIDE_ALL = False
SHOW_FATAL = True
SHOW_ERROR = True
SHOW_WARNING = True
SHOW_DEBUG = True
SHOW_COMMENT = True
@classmethod
def set_level(cls, lvl):
"""
lvl is either :
- 'none'
- 'fatal',
- 'error',
- 'warning',
... | 22.434783 | 69 | 0.507752 |
97a2e00c69a7268485f3a840d3a168115632489d | 1,751 | py | Python | Incremental/incremental/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Incremental/incremental/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | Incremental/incremental/__init__.py | austinmh12/DiscordBots | 55550b68a7ad6423de55e62dbbff93fd88f08ff2 | [
"MIT"
] | null | null | null | from psycopg2 import connect, ProgrammingError
import pandas as pd, numpy as np
# ENV
with open('../.env') as f:
ENV = {l.strip().split('=')[0]: l.strip().split('=')[1] for l in f.readlines()}
# Global Utilities
def sql(q, args):
conn = connect(database='pisscord', host='localhost', port='5432', user=ENV['DBUSER'],... | 25.75 | 111 | 0.680754 |
8ae97ff5832d7623df8419bcbc585c0c79d5176c | 3,794 | py | Python | phypidaq/MAX31865Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | phypidaq/MAX31865Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | phypidaq/MAX31865Config.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, unicode_literals
from __future__ import absolute_import
import numpy as np, time, sys, spidev, math
class MAX31865Config(object):
'''RTD-to-Digital Converter - configuration and interface'''
def __init__(self, confdict = None):
if conf... | 31.355372 | 162 | 0.599367 |
8af4f909d7893aeb182099f4d13d1cfa4ed05b47 | 86,758 | py | Python | tests/onegov/activity/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/activity/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/activity/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from unittest.mock import patch
import pytest
import sqlalchemy
import transaction
from datetime import datetime, date, timedelta
from freezegun import freeze_time
from sedate import standardize_date
from onegov.activity import ActivityCollection, OccasionNeed, Volunteer
from onegov.activity import ActivityFilter
fr... | 29.937198 | 110 | 0.640817 |
c19a57ef5622d4f9d384f89a0877e8c099fd187e | 426 | py | Python | ___Python/Thomas/pycurs_180625/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Thomas/pycurs_180625/p07_file_io/m00_rekursion.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | # 1) Fakultät
# iterative Definition
# n! =1*2*...* (n-1) *n
# 5! =1*2*3*4*5
# 4! =1*2*3*4
# ...
# 1! = 1
# 0! = 1
# rekursive Definition
# n! = n*(n-1)!, für n>=1
# 0! =1
#rekursiv
def fak(n):
if n == 0:
return 1
else:
return n * fak(n-1)
print(fak(4))
#iterativ
def f... | 13.741935 | 28 | 0.446009 |
413e8014a2bc458023b6451c084180ea396f7698 | 491 | py | Python | webapp/flask_deploy_model/model.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/flask_deploy_model/model.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/flask_deploy_model/model.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn import linear_model
import matplotlib.pyplot as plt
df = pd.read_csv('homeprices.csv')
x = df[['area']]
y = df[['price']]
# Training our model
reg = linear_model.LinearRegression()
reg.fit(x, y)
print(f'reg score: {reg.score(x,y)}')
print(f'predict for 3300 area:... | 20.458333 | 56 | 0.706721 |
ec0c3a988a6bad292fe1355f1f3d089ef42659a6 | 1,926 | py | Python | scripts/get_city_shapes.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | scripts/get_city_shapes.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | scripts/get_city_shapes.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | # Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com>
# Michele Ferretti <mic.ferretti@gmail.com>
"""
Script to fetch city shapes from Nominatim
And save them as geojson
"""
import argparse
import pandas as pd
import geopandas as gpd
from geol.utils import utils
import os
import sys
# recast the columns ... | 29.181818 | 98 | 0.595535 |
ec133435fdf1ad2fade3fefac8c3ab94a888e2fb | 1,395 | py | Python | cogs/ip.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | 1 | 2021-04-21T09:01:26.000Z | 2021-04-21T09:01:26.000Z | cogs/ip.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | cogs/ip.py | DestinyofYeet/antonstechbot | b01372431a3a2b51fb83180cf8caa1a168e294ad | [
"MIT"
] | null | null | null | from discord.ext import commands
import discord
from botlibrary import constants
import requests
class Ip(commands.Cog):
def __init__(self, client):
self.client = client
self.ipdata = constants.ipdata_token
self.base_url = constants.ipdata_url
@commands.command(name="ip")
async de... | 31.704545 | 73 | 0.607168 |
ec2337ed9e2e75bd0e36601ed1026b2185a3cf7d | 933 | py | Python | INBa/2014/MOCHALOV_V_V/task_4_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_4_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2014/MOCHALOV_V_V/task_4_15.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
# Задача 4. Вариант 15.
# Напишите программу, которая выводит имя, под которым скрывается Анри Мари Бейль. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти).... | 44.428571 | 437 | 0.757771 |
6b8272a09cd7d24654b000309f58c3a4397344df | 134 | py | Python | Produkte/admin.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Produkte/admin.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Produkte/admin.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | from django.contrib import admin
from .models import Spendenstufe, Kauf
admin.site.register(Spendenstufe)
admin.site.register(Kauf)
| 19.142857 | 38 | 0.820896 |
2e5272ea00597381cce749009e214e7d0d8a7f20 | 146 | py | Python | puat/db.py | Pelleplutt/PUAT | b083d2ec5776bb73f6ba83a5ddab271a7b742e89 | [
"MIT"
] | null | null | null | puat/db.py | Pelleplutt/PUAT | b083d2ec5776bb73f6ba83a5ddab271a7b742e89 | [
"MIT"
] | null | null | null | puat/db.py | Pelleplutt/PUAT | b083d2ec5776bb73f6ba83a5ddab271a7b742e89 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import psycopg2
class DB(object):
def __init__(self):
self.conn = psycopg2.connect()
| 14.6 | 38 | 0.616438 |
cf1c63d0259b83e59e279275df2ad16a8fb3415e | 897 | py | Python | showcase1/com/aaron/zipexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | showcase1/com/aaron/zipexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | showcase1/com/aaron/zipexample.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""zip usage example"""
__author__="Aaron.Qiu"
def make_iterator():
"""做迭代器"""
colors = ['red','green','blue']
indexs = [34,45,22,67]
for col,index in zip(colors,indexs):
print(col,index)
def puts(arg1,arg2):
print(arg1)
print(arg2)
def split_list(dots):
x_l... | 19.5 | 43 | 0.536232 |
d84d5cc01d2ca6b4a1af6841381431c8cd034f58 | 231 | py | Python | src/server/app/endpoints/privacy_policy/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/privacy_policy/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/endpoints/privacy_policy/controllers.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Flask, Blueprint, render_template, abort, g, request
privacy_policy = Blueprint("privacy_policy", __name__)
@privacy_policy.route('/')
def loadTerms():
return render_template('/privacy_policy/index.html')
| 23.1 | 70 | 0.766234 |
d85d572384f3b145f1fdd84684905f1224e8e7fd | 386 | py | Python | nz_django/day1/template_demo1/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day1/template_demo1/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day1/template_demo1/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.http import HttpResponse
from django.shortcuts import render
from django.template.loader import render_to_string
# Create your views here.
def index(request):
#先将模板找到 然后编译渲染成python的字符串
#然乎通过 HttpResponse包装成一个HttpResponse 返回给浏览器
html = render_to_string('index.html')
return HttpResponse(html) ... | 35.090909 | 51 | 0.787565 |
41dcae898a85f7b96ddcc8412a785f1bae5d178d | 2,372 | py | Python | diversos/ExtratorTabelasOracle.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 1 | 2021-12-18T15:29:24.000Z | 2021-12-18T15:29:24.000Z | diversos/ExtratorTabelasOracle.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | null | null | null | diversos/ExtratorTabelasOracle.py | lcarlin/guppe | a0ee7b85e8687e8fb8243fbb509119a94bc6460f | [
"Apache-2.0"
] | 3 | 2021-08-23T22:45:20.000Z | 2022-02-17T13:17:09.000Z | import datetime
import configparser
import cx_Oracle
import csv
config = configparser.ConfigParser()
try:
print('Lendo arquivo de configuracao...')
with open('conf/config.ini') as f:
config.read_file(f)
user = config['oracle']['user']
passwd = config['oracle']['password']
db = config['o... | 30.025316 | 104 | 0.602024 |
7a6479a98ec29b51170db5c1fadcc9ff25533256 | 313 | py | Python | exercises/de/exc_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_01_08_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_01_08_02.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")
text = "Apple wurde 1976 von Steve Wozniak, Steve Jobs und Ron Wayne gegründet."
# Verarbeite den Text
doc = ____
# Iteriere über die vorhergesagten Entitäten
for ent in ____.____:
# Drucke den Text und das Label der Entität
print(ent.____, ____.____)
| 22.357143 | 80 | 0.741214 |
64fc4dbfff3ae080f7e5a2559153c36a9de6e7ae | 246 | py | Python | Problems/SlidingWindow/MaxConsecutiveOnesIII/max_consecutive_ones_iii.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/MaxConsecutiveOnesIII/max_consecutive_ones_iii.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/SlidingWindow/MaxConsecutiveOnesIII/max_consecutive_ones_iii.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def longestOnes(self, nums: List[int], k: int) -> int:
l, r = 0, 0
while r < len(nums):
k -= 1 - nums[r]
if k < 0:
k += 1 - nums[l]
l += 1
r += 1
return r - l
| 17.571429 | 54 | 0.418699 |
56e4dbfd59008b68860331cd8dfd2f3e57a0e1db | 1,557 | py | Python | src/bo4e/com/geraeteeigenschaften.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/geraeteeigenschaften.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/geraeteeigenschaften.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Geraeteeigenschaften and corresponding marshmallow schema for de-/serialization
"""
from typing import Optional
import attr
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.enum.geraetemerkmal import Geraetemerkmal
from bo4e.enum.geraetetyp i... | 33.12766 | 195 | 0.766217 |
855d40cae6aeb379e17a1a4ab735f33a469b6032 | 230 | py | Python | 1337-the-k-weakest-rows-in-a-matrix/1337-the-k-weakest-rows-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 1337-the-k-weakest-rows-in-a-matrix/1337-the-k-weakest-rows-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 1337-the-k-weakest-rows-in-a-matrix/1337-the-k-weakest-rows-in-a-matrix.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def kWeakestRows(self, mat: List[List[int]], k: int) -> List[int]:
sumMat = [[row, i] for i, row in enumerate(mat)]
sumMat.sort(key=lambda x: sum(x[0]))
return [i for _, i in sumMat[:k]] | 46 | 70 | 0.582609 |
859730c863990d30f1b590b1904f5164543ef247 | 719 | py | Python | nz_django/day3/look_up_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day3/look_up_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day3/look_up_demo/front/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.db import models
# Create your models here.
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return "Category(id:%s,name:%s)" %(self.id,self.name)
class Meta:
db_table = 'category'
class Article(models.Model):
title = models.CharFi... | 29.958333 | 109 | 0.69541 |
a472281a82c1649d6149bfd1b15761cc70ac650d | 376 | py | Python | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', view=views.index, name='index'),
url(r'^construction/', view=views.construction, name='construction'),
url(r'^contact/', view=views.contact, name='contact'),
url(r'^login$', view=views.login, name='login'),
... | 28.923077 | 74 | 0.632979 |
74e23b8d1b665d68fe8b6f0e3840df4cc3a7cc30 | 3,571 | py | Python | aoc2020/day_10/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_10/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_10/part_2.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from collections import deque
from functools import reduce
from aoc2020 import *
class Graph:
def __init__(self):
self._vertex_map = {}
self._vertices = []
self._matrix = []
def __iter__(self):
return iter(self._vertices)
def __contains__(self, item):
return item ... | 29.270492 | 120 | 0.527583 |
77f5dc7f73d3dae5210936c54c55a406107e56fd | 803 | py | Python | Packs/CommonScripts/Scripts/LanguageDetect/LanguageDetect.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/LanguageDetect/LanguageDetect.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/LanguageDetect/LanguageDetect.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
from langdetect import detect_langs
def detect_language(text):
res = detect_langs(text)
md = "### Detected languages (probability):\n"
langs = []
for line in res:
lang = str(line).split(':')[0]
... | 27.689655 | 100 | 0.599004 |
7069d84b8b4f2eee7eaba620e0b5e27a492bec0c | 173 | py | Python | Online-Judges/DimikOJ/Python/19-word-counting-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/DimikOJ/Python/19-word-counting-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/DimikOJ/Python/19-word-counting-1.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | for _ in range(int(input())):
full_str = input()
full_list = list(full_str.split(" "))
#print(full_list)
lenght = len(full_list)
print("Count =", lenght) | 28.833333 | 41 | 0.612717 |
8dce7b93d8090b394f1269c78ec61ef1491b8005 | 3,209 | py | Python | Intro-Python-II/src/adv_utils.py | tobias-fyi/01_intro_python | c56645291b8bce94d8511c3277fefba1fe8add89 | [
"MIT"
] | null | null | null | Intro-Python-II/src/adv_utils.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/adv_utils.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
BeWilder Utilities :: Misc utility functions
"""
# === Formatting variables === #
table_size = 56
table_side = table_size // 2
def justify_center(content: str, width: int, symbol: str):
"""Centers string in symbol - width chars wide.
:param content (str) : String to be centered.
:param width (in... | 32.09 | 84 | 0.623247 |
30970d99a17126234606f3bfa57693122be98f45 | 1,008 | py | Python | Python/M01_ProgrammingBasics/L04_ForLoop/Exercises/Solutions/P03_OddEvenPosition.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Exercises/Solutions/P03_OddEvenPosition.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Exercises/Solutions/P03_OddEvenPosition.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | import sys
number = int(input())
max_odd = -sys.maxsize
max_even = -sys.maxsize
min_odd = sys.maxsize
min_even = sys.maxsize
odd = 0
even = 0
odd_sum = 0
even_sum = 0
for each in range(number):
current = float(input())
if each % 2 == 1:
even_sum += current
if current > max_even:
... | 19.764706 | 37 | 0.59623 |
30a0178c2bec11003cef472629b475e7be1391d6 | 1,866 | py | Python | forge/terrain/metadata.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 31 | 2015-07-13T15:36:50.000Z | 2022-02-07T21:37:51.000Z | forge/terrain/metadata.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 109 | 2015-04-24T10:03:24.000Z | 2019-04-12T13:34:01.000Z | forge/terrain/metadata.py | Pandinosaurus/3d-forge | d631e14a9351911c3e5612c73c1608d97ed547d2 | [
"BSD-3-Clause"
] | 16 | 2015-10-03T06:03:22.000Z | 2022-03-31T08:24:37.000Z | # -*- coding: utf-8 -*-
from forge.lib.tilejson import _TileJSON
class TerrainMetadata(_TileJSON):
def __init__(self, *args, **kwargs):
self.gridOrigin = 'bottomLeft'
self.tileMinZoom = kwargs.get('minzoom')
self.tileMaxZoom = kwargs.get('maxzoom')
self.useGlobalTiles = kwargs.g... | 39.702128 | 84 | 0.564309 |
15cfe515e064daa0ee55077690c3d237b3925c04 | 547 | py | Python | python_reference/useful_scripts/random_string_generator.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | python_reference/useful_scripts/random_string_generator.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | python_reference/useful_scripts/random_string_generator.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-10-14T07:30:18.000Z | 2019-10-14T07:30:18.000Z | import string
import random
def rand_string(length):
""" Generates a random string of numbers, lower- and uppercase chars. """
return ''.join(random.choice(
string.ascii_lowercase + string.ascii_uppercase + string.digits)
for i in range(length)
)
if __name__ == '__ma... | 27.35 | 77 | 0.647166 |
d66581dcf495c65e21df3467b94bb4740e102146 | 7,193 | py | Python | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2019-03-07T08:55:36.000Z | 2019-04-22T18:13:03.000Z | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | null | null | null | Fortgeschrittenenpraktikum/Protokolle/V27_Zeeman-Effekt/Python/auswertung.py | smjhnits/Praktikum | 92c9df3ee7dfa2417f464036d18ac33b70765fdd | [
"MIT"
] | 2 | 2017-10-27T13:26:43.000Z | 2018-01-13T09:12:24.000Z | import numpy as np
from scipy.stats import sem
import scipy.constants as const
from uncertainties import ufloat
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from PIL import Image
import... | 30.478814 | 97 | 0.607813 |
ba8df468ffe50af2996dac74a2c520e88ec46a21 | 3,241 | py | Python | imwievaluation/surveyxml.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/surveyxml.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | null | null | null | imwievaluation/surveyxml.py | ESchae/IMWIEvaluation | 2fa661711b7b65cba25c1fa9ba69e09e75c7655f | [
"MIT"
] | 1 | 2019-10-19T10:11:17.000Z | 2019-10-19T10:11:17.000Z | import xml.etree.ElementTree as ET
class SurveyXML(object):
def __init__(self, survey_xml_file):
self.survey_xml_file = survey_xml_file
self.tree = ET.parse(survey_xml_file)
self.root = self.tree.getroot()
def get_title(self):
return self.tree.find('title').text
def list... | 36.829545 | 76 | 0.579451 |
bab931729ea15696b39996f80c43e58d1fde8300 | 845 | py | Python | usc-20211-csci-170-30111/quiz1/plot.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20211-csci-170-30111/quiz1/plot.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | usc-20211-csci-170-30111/quiz1/plot.py | Floozutter/coursework | 244548f415553f058098cae84ccdd4ce3f58c245 | [
"Unlicense"
] | null | null | null | import matplotlib.pyplot as plt
from math import gamma, log2
from typing import Callable
def linspace(start: float, stop: float, n: int) -> tuple[float, ...]:
if n <= 0:
return ()
elif n == 1:
return (start,)
else:
step = (stop - start) / (n - 1)
return tuple(step * i + star... | 25.606061 | 81 | 0.518343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.