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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
435fb33de3c06a4b40d090a7030114a347ab7b78 | 109 | py | Python | Algorithms/Implementation/beautiful-days-at-the-movies.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful-days-at-the-movies.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful-days-at-the-movies.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | i,j,k = map(int, input().split())
s = sum([(i - int(str(i)[::-1])) % k == 0 for i in range(i,j+1)])
print(s) | 27.25 | 65 | 0.495413 |
1ca0b8492e4d9a8f4f677b0bf3a8b5c77693a2f3 | 4,734 | py | Python | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/feature_analysis.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/feature_analysis.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/Santander-Customer-Satisfaction/scripts/feature_analysis.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 31 22:30:05 2016
@author: abhishek
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# load train and test set
train = pd.read_csv('./data/train.csv', index_col='ID')
test = pd.read_csv('./data/test.csv', index_col='ID')
... | 43.036364 | 119 | 0.561681 |
1caef160f2bf4b949e3e573a0703308a50d07f6a | 179 | py | Python | data_tests/saved__backend__py3.9/cython/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | data_tests/saved__backend__/cython/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | data_tests/saved__backend__py3.9/cython/classic.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | try:
import cython
except ImportError:
from transonic_cl import cython
import numpy as np
def func(a, b):
return (a * np.log(b)).max()
__transonic__ = ("0.3.3",)
| 12.785714 | 35 | 0.648045 |
1cbb92228f5d3cc3958dad2d181475c75463f94e | 4,333 | py | Python | Imagenes/FC72/Fint/Coexistencia/postMaxwell.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/FC72/Fint/Coexistencia/postMaxwell.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | Imagenes/FC72/Fint/Coexistencia/postMaxwell.py | efogliatto/Tesis | 058fa0c2e23cd538621d17d41bb216a4db4d211a | [
"CC0-1.0"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
import argparse
import collections
import glob
import MaxwellConstruction as mx
from paraview.simple import *
import locale
if __name__ == "__main__":
# Argumentos de consola
parser = argparse.ArgumentParser(description='Resoluci... | 18.921397 | 143 | 0.507039 |
1c4da3832f44f7ebae697ad4460865496cff4030 | 6,159 | py | Python | gui/minimalGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | 1 | 2022-01-18T12:53:17.000Z | 2022-01-18T12:53:17.000Z | gui/minimalGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | gui/minimalGUI.py | lhalb/gfmanager | 449f071b3239faa672b7f06122dfc9bc23e68d79 | [
"MIT"
] | null | null | null | from PyQt5 import QtGui, QtWidgets
from gui import mingui as GUI
from lib import gfDatabase as DB
from lib import gfHelper as gfh
from gui.trimGui import TrimDialog as TD
from gui.plotUI import PlotDialog as PD
from gui.exportGUI import SaveDialog as SD
from gui import boxes as BOX
class App(QtWidgets.QMainWindow, GU... | 32.246073 | 124 | 0.59068 |
98ca53184ad7e570a0ccd90a8a1c006fa47bf36c | 3,145 | py | Python | research/hpc/pfnn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pfnn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pfnn/src/callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.440476 | 104 | 0.631161 |
c78daee1f769abd113fb87a98f7e06476c10e035 | 3,759 | py | Python | official/recommend/wide_and_deep_multitable/src/callbacks.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/recommend/wide_and_deep_multitable/src/callbacks.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/recommend/wide_and_deep_multitable/src/callbacks.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.752577 | 110 | 0.651503 |
907ac4be9dec398aaa9f6bd18f204ee9b081550e | 461 | py | Python | angstrom/2018/crypto/gmx/gen.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | angstrom/2018/crypto/gmx/gen.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | angstrom/2018/crypto/gmx/gen.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from Crypto import Random
import aes
import gm
flag = open('flag').read()
key = Random.new().read(16)
pk, sk = gm.generate()
encflag = aes.encrypt(key, flag)
enckey = gm.encrypt(key, pk)
with open('pk', 'w') as f:
f.write('\n'.join([str(x) for x in pk]))
with open('sk', 'w') as f:
f.write('\n'.join([str(x) for ... | 19.208333 | 45 | 0.611714 |
90feb622dea9e20f7fb94eb1de62c9630e3ae1bf | 1,061 | py | Python | Webpage/jollen/urls.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/jollen/urls.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/jollen/urls.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | """Django URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 37.892857 | 93 | 0.711593 |
295c4e89bfa5d1b6397b0af7cf982e5ef0d003d2 | 822 | py | Python | py-td3-cinema/gui/index.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/gui/index.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/gui/index.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from gi.repository import Gtk
from . import edit
from . import new
newID = 0
def index(builder, db):
global newID
builder.get_object("editZone").hide()
builder.get_object("menuZone").hide()
builder.get_object("newZone").hide()
builder.get_object("save").hide()
bu... | 24.909091 | 86 | 0.701946 |
46a37ae556a9c55b38f402950f968de3c20bf7b3 | 652 | py | Python | Algorithms/Warmup/Birthday Cake Candles.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Warmup/Birthday Cake Candles.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Warmup/Birthday Cake Candles.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/birthday-cake-candles/problem?h_r=internal-search
def birthdayCakeCandles(arr, s):
counter = 0
m = max(arr)
c = arr.count(m)
if c > 1:
counter = c
return counter
pass
size = int(input())
a = input().split()
ar = []
for j in a:
ar.append(int(j... | 18.111111 | 89 | 0.533742 |
31875301b513ac3087d34e27b0b5df24a30aeabb | 528 | py | Python | Code/inv_func_1d.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/inv_func_1d.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/inv_func_1d.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | import numpy as np
UNDEFINED = 10
def expo(x):
return 1 - np.exp(-x)
# x = log(1/y)
# e^x = 1/y
# ye^x = 1
# y = e^-x
def expo_inv(U):
try:
return np.log(1/U)
except ZeroDivisionError:
return UNDEFINED
def logistic(x):
return 1/(1 + np.exp(-x))
def logistic_inv(U):
... | 16.5 | 43 | 0.547348 |
730ed0747ffb781b0ff3d4522ba9f333ffceaefc | 309 | py | Python | Licence 1/I11/TP2/tp2_8_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 1/I11/TP2/tp2_8_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 1/I11/TP2/tp2_8_2.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | value = str(input("Entrer un entier: "))
tmp = value
while len(tmp) > 1:
sum = 0
sign = 1
for i in range(0, len(tmp)):
sum += sign * int(tmp[i])
sign *= -1
tmp = str(sum)
if int(tmp) == 0: print(value, "est divisible par 11")
else: print(value, "n'est pas divisible par 11")
| 22.071429 | 54 | 0.559871 |
b42285b95eb5a67d0574463f32b1e8130dbb042c | 10,119 | py | Python | Packs/Maltiverse/Integrations/Maltiverse/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Maltiverse/Integrations/Maltiverse/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Maltiverse/Integrations/Maltiverse/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | EXPECTED_IP_RESULT = {
'IP(val.Address && val.Address == obj.Address)': [
{
'Address': '1.1.1.0',
'Geo': {
'Country': 'AU'
},
'PositiveDetections': 1,
'Malicious': {
'Description': ['Anonymizer']
},
... | 40.967611 | 120 | 0.475541 |
c30ba0f06b8d9dcd62dea5687c653454c71a79a6 | 2,060 | py | Python | Base/main.py | AlanDeveloper/Flask-Mail | f2d9245f4614d99645b480a861b311f56f274af1 | [
"MIT"
] | null | null | null | Base/main.py | AlanDeveloper/Flask-Mail | f2d9245f4614d99645b480a861b311f56f274af1 | [
"MIT"
] | null | null | null | Base/main.py | AlanDeveloper/Flask-Mail | f2d9245f4614d99645b480a861b311f56f274af1 | [
"MIT"
] | null | null | null | from flask import Flask, flash, render_template, request, redirect, url_for, session
from flask_mail import Mail, Message
from threading import Thread
from server import ServerDAO
app = Flask(__name__, template_folder='template')
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/')
def index():
return render_tem... | 27.837838 | 84 | 0.691262 |
5edfc981e526de42e8ca5c4aff978259050186b6 | 9,758 | py | Python | Library/jose/jwk.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null | Library/jose/jwk.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null | Library/jose/jwk.py | TrojanCrypto/Dashboard | 3af795980c7aa90505afae684297e43366cb6ee5 | [
"MIT"
] | null | null | null |
import base64
import hashlib
import hmac
import struct
import six
import sys
import Crypto.Hash.SHA256
import Crypto.Hash.SHA384
import Crypto.Hash.SHA512
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Util.asn1 import DerSequence
import ecdsa
from jose.constants import ALGORI... | 29.659574 | 116 | 0.62933 |
6f79ba79518899d43ccbc33db1b2f9f728fd2c87 | 354 | py | Python | backend/products/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/products/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | backend/products/urls.py | saulhappy/drf | 5e62da54cdf0f0fead742c891d34e7eacd488a1b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("", views.product_list_create_view, name="product-list"),
path("<int:pk>/", views.ProductDetailAPIView.as_view(), name="product-detail"),
path("<int:pk>/update/", views.product_update_view, name="product-edit"),
path("<int:pk>/delete... | 35.4 | 83 | 0.70339 |
48a4fbc0fac210f2fa12ebc87606cb1dca88935b | 213 | py | Python | Python/Itertools/itertools_combinations_with_replacement.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Itertools/itertools_combinations_with_replacement.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Itertools/itertools_combinations_with_replacement.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | from itertools import combinations_with_replacement
word, k = input().strip().split()
word = ''.join(sorted(word))
p = [''.join(a) for a in combinations_with_replacement(word, int(k))]
print('\n'.join(sorted(p))) | 35.5 | 69 | 0.713615 |
82cce5d0ce81ec96fec4fa2542352e3d8973f132 | 213 | py | Python | python/python_new/Python 3/elif.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_new/Python 3/elif.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_new/Python 3/elif.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | #Program checks if the number is positive or negative# And displays an appropriate message
num=3.4
#num=0
#num=-4.5
if num>=0:
print("Positive number")
elif num==0:
print("Zero")
else:
print("Negative number")
| 19.363636 | 90 | 0.723005 |
c4e9f073f8ca0f8d2404252e2c7bb35c51346b4c | 791 | py | Python | INBa/2015/Kishukov_N/task_6_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Kishukov_N/task_6_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Kishukov_N/task_6_10.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 10
# Создайте игру, в которой компьютер загадывает название одного из девяти действующих вокзалов Москвы, а игрок должен его угадать.
# Кишуков Назир
# 16.04.2016
import random
print("Компьютер загадал название одного из девяти вокзалов Москвы, а Вы должны его угадать.")
vokzals = ('Рижский вок... | 27.275862 | 181 | 0.728192 |
485d17f9e4c28f6459cfbb14ac9f98d98c410161 | 320 | py | Python | python/image_processing/gaussian_blur.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/gaussian_blur.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/gaussian_blur.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread('city2.jpg')
blur = cv2.GaussianBlur(img,(5,5),0)
plt.subplot(121),plt.imshow(img),plt.title('Original')
plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(blur),plt.title('Blurred')
plt.xticks([]), plt.yticks([])
plt.show()
| 22.857143 | 54 | 0.703125 |
b50cc2d9a18bdf19151da1d3105ad018a36740f2 | 10,924 | py | Python | tests/views/test_admin_unit_member_invitation.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | tests/views/test_admin_unit_member_invitation.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | tests/views/test_admin_unit_member_invitation.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | import pytest
def test_create(client, app, utils, seeder, mocker):
seeder.create_user()
user_id = utils.login()
admin_unit_id = seeder.create_admin_unit(user_id, "Meine Crew")
url = "/manage/admin_unit/%d/members/invite" % admin_unit_id
response = client.get(url)
assert response.status_code =... | 30.946176 | 87 | 0.640882 |
82fa2bf30dd5cbee9d62274a4d49f679ec72c26c | 22,503 | py | Python | src/onegov/search/indexer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/search/indexer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/search/indexer.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import platform
import re
from collections import namedtuple
from copy import deepcopy
from elasticsearch.helpers import streaming_bulk
from elasticsearch.exceptions import NotFoundError
from langdetect.lang_detect_exception import LangDetectException
from onegov.core.utils import is_non_string_iterable
from onegov.se... | 30.004 | 79 | 0.558814 |
d283ea3b583056713c503786e14582db97406bae | 7,998 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/fortimanager/test_fmgr_ha.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/fortimanager/test_fmgr_ha.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/network/fortimanager/test_fmgr_ha.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | # Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | 36.857143 | 147 | 0.63866 |
9643c7c46fc6c554420dd30d585a020986e0f6fb | 6,935 | py | Python | official/cv/crnn_seq2seq_ocr/src/seq2seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/crnn_seq2seq_ocr/src/seq2seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/crnn_seq2seq_ocr/src/seq2seq.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.794118 | 117 | 0.656669 |
969729bee523fc26fe64865db50dc96105264eb2 | 1,261 | py | Python | Curso_Python/Secao7-Bases-de-dado-com-Python/149-SqlLite_usando_modulo_sql3/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao7-Bases-de-dado-com-Python/149-SqlLite_usando_modulo_sql3/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao7-Bases-de-dado-com-Python/149-SqlLite_usando_modulo_sql3/main.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import sqlite3
conexao = sqlite3.connect('basededados.db')
cursor = conexao.cursor()
# Cria o banco de dados
# cursor.execute('CREATE TABLE IF NOT EXISTS clientes ('
# 'id INTEGER PRIMARY KEY AUTOINCREMENT,'
# 'nome TEXT,'
# 'peso REAL'
# ')')
# Adiciona va... | 30.02381 | 108 | 0.589215 |
7389d14357d6906d6934b9765fa9bf4e7c9dd8f3 | 2,116 | py | Python | Blaschke/01/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 11 | 2017-04-21T11:39:55.000Z | 2022-02-11T20:25:18.000Z | Blaschke/01/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 69 | 2017-04-26T09:30:38.000Z | 2017-08-01T11:31:21.000Z | Blaschke/01/ex1.py | appfs/appfs | 8cbbfa0e40e4d4a75a498ce8dd894bb2fbc3a9e3 | [
"MIT"
] | 53 | 2017-04-20T16:16:11.000Z | 2017-07-19T12:53:01.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 26 16:34:16 2017
@author: Lana
"""
import sys
import csv
def checkRow(row, seqNr):
# check if a row has 3 entries before any comments
# empty lines are ok
if not row:
return [0, 0, 0]
# if not empty, line must have 3 entries with
# 1.) s... | 24.604651 | 74 | 0.524575 |
73b7b422c13faa178218619b77b6b213d3436166 | 1,017 | py | Python | python-publisher/src/app.py | LukasHenzel/BigDataWWI19DSB | 790f4ad40596f82b07481b1a3550565235230f60 | [
"Apache-2.0"
] | 1 | 2021-11-30T14:42:42.000Z | 2021-11-30T14:42:42.000Z | python-publisher/src/app.py | LukasHenzel/BigDataWWI19DSB | 790f4ad40596f82b07481b1a3550565235230f60 | [
"Apache-2.0"
] | null | null | null | python-publisher/src/app.py | LukasHenzel/BigDataWWI19DSB | 790f4ad40596f82b07481b1a3550565235230f60 | [
"Apache-2.0"
] | null | null | null | import time
from kafka import KafkaProducer
import requests
import pandas as pd
# Timer damit ein CrashLoopbackoof vermieden wird
time.sleep(40)
#Producer erzeugen
producer = KafkaProducer(
bootstrap_servers='my-cluster-kafka-bootstrap:9092')
while True:
# Daten abrufen und umwandeln sodass sie in Spark gestr... | 32.806452 | 104 | 0.679449 |
fb78fafe6c2cf3635b16911c957276c05b675078 | 1,575 | py | Python | python/course/leetcode/28. Implement strStr()_0421.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/course/leetcode/28. Implement strStr()_0421.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/course/leetcode/28. Implement strStr()_0421.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/6/23 16:10
# @Author:TimVan
# @File:28. Implement strStr().py
# @Software:PyCharm
# 28. Implement strStr()
# Implement strStr().
# Return the index of the first occurrence of needle in haystack,
# or -1 if needle is not part of haystack.
# Example 1:
# Input: haystack = "hello", nee... | 27.155172 | 83 | 0.56 |
83b1a76a546da3c23d528077813d1c2bdc94ed8b | 385 | py | Python | elements/python/5/7/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/5/7/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/5/7/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
def pow(x, y):
p = 1
while y != 0:
if y&1 == 1:
p *= x
x = x*x
y >>= 1
return p
def test(trials=100):
for trial in range(trials):
x = random.getrandbits(32)
y = random.getrandbits(16)
assert pow(x, y) == x**y
def main():
... | 13.75 | 34 | 0.467532 |
83c824aed77fb426141bd1c65a98db54519b7dfd | 691 | py | Python | Algorithms/5_Searching/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/5_Searching/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/5_Searching/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/minimum-loss/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'minimumLoss' function below.
#
# The function is expected to return an INTEGER.
# The function accepts LONG_INTEGER_ARRAY price as parameter.
#
def minimumLoss(p):
... | 20.939394 | 82 | 0.65123 |
83e983d552e333031c803a7dd8047a92e803b77d | 440 | py | Python | src/testProgram.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 11 | 2018-01-16T06:39:00.000Z | 2021-11-28T11:46:41.000Z | src/testProgram.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | null | null | null | src/testProgram.py | Times125/Emotion-Analyse | b5d9f23fdf6c75f57f5cf20d58834a095b0c7e1e | [
"Apache-2.0"
] | 2 | 2019-08-16T14:53:37.000Z | 2019-08-17T02:01:22.000Z | import socket
sock =socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1',9797))
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) #在客户端开启心跳维护
"""
sock.send('auto')
res = sock.recv(1024)
print res
"""
path = r'E:\Repositories\Emotion-Analyse\Long-Reviews-Emotion-Analyse\test\neg\0_2.txt'... | 24.444444 | 87 | 0.713636 |
f795af652fe7a20c2248cb0f5c23efd4e2e27bf9 | 1,996 | py | Python | bin/cls/parser.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | 2 | 2018-03-27T21:11:20.000Z | 2018-11-11T19:49:55.000Z | bin/cls/parser.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | 9 | 2018-03-18T19:14:04.000Z | 2018-06-29T07:35:00.000Z | bin/cls/parser.py | rongworks/open-gecko-de | 37ec52bbea1fa13fbb44bbd7162c96afffcf9f16 | [
"MIT"
] | null | null | null | from cls.repository import Repository
from cls.package import Package
from cls.custom_file import CustomFile
class Parser:
def __init__(self,data):
self.data = data
def repositories_from_yaml(self):
key = 'repositories'
repositories = []
data = self.data
for rkey in da... | 32.721311 | 79 | 0.598697 |
e3c221da7d44f699bfa92d193136554eed26b37a | 392 | py | Python | src/ztc_time.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc_time.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc_time.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/python
"""
ZTC ntp jitter item script
Copyright (c) 2010-2012 Vladimir Rusinov <vladimir@greenmice.info>
Copyright (c) 2010 Murano Software [http://muranosoft.com]
Copyright (c) 2010 Docufide, Inc. [http://docufide.com]
Copyright (c) 2011 Wrike, Inc [http://www.wrike.com]
License: GNU GPL v3
"""
from ztc.s... | 23.058824 | 66 | 0.721939 |
54a1f4a760ebb5dad472c36e509ec9b223912779 | 232 | py | Python | ___Python/Carsten/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Carsten/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/Carsten/p03_lambda/m01_filtern.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | celsius = [0.7, 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3]
# Alle Temperaturen größer gleich 15
gefiltert = []
for month in celsius:
if month >= 15:
gefiltert.append(month)
print(gefiltert)
| 21.090909 | 76 | 0.581897 |
4de75a2d43799f09a7f9078a6013d7414f7736e7 | 835 | py | Python | combine_names.py | rabramley/name_combinator | 3f181df671e719d3d2ca9953575434dd8e51e258 | [
"MIT"
] | null | null | null | combine_names.py | rabramley/name_combinator | 3f181df671e719d3d2ca9953575434dd8e51e258 | [
"MIT"
] | null | null | null | combine_names.py | rabramley/name_combinator | 3f181df671e719d3d2ca9953575434dd8e51e258 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import random
parser = argparse.ArgumentParser()
parser.add_argument("language", help="language of the names")
parser.add_argument("--sex", "-s", choices=['female', 'male'], help="sex of names")
parser.add_argument("--count", "-c", type=int, default=100, help="number of names to ... | 30.925926 | 93 | 0.701796 |
42891371bad89cd864b2f36d4a0e17ad0e658a2a | 1,942 | py | Python | src/blockchain/blockchain.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 2 | 2021-11-08T12:00:02.000Z | 2021-11-12T18:37:52.000Z | src/blockchain/blockchain.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | null | null | null | src/blockchain/blockchain.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 1 | 2022-03-28T13:49:37.000Z | 2022-03-28T13:49:37.000Z | from src.blockchain.block import Block
from src.db.mapper import Mapper
from src.network.conversations.block_broadcasting import Block_broadcasting
import hashlib
import os
class Blockchain():
def add_block(self, transactions, node=None):
pred_hash = Mapper().read_latest_block_hash()
b... | 33.482759 | 96 | 0.629763 |
42977743f2ca44566409c5aa32735e9c608c2458 | 4,310 | py | Python | awsrun/aws/aws_sns.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | null | null | null | awsrun/aws/aws_sns.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | null | null | null | awsrun/aws/aws_sns.py | eec289q-f21/stdsw | 93604a1b947e39496e6559982eea6d41c77d0204 | [
"MIT"
] | 1 | 2021-10-07T23:10:33.000Z | 2021-10-07T23:10:33.000Z | import json
import logging
from boto3_type_annotations.sns import ServiceResource, Topic, Subscription, Client
from botocore.exceptions import ClientError
from aws import AWSBackend
def sns_resource():
sns: ServiceResource = AWSBackend().get_resource('sns')
return sns
def sns_logger():
return logging.g... | 30.352113 | 89 | 0.647332 |
42a09cad9e2f83458d0c8d9f69c8c8fcf15d5441 | 5,971 | py | Python | bach_code/decoder.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 5 | 2015-12-08T21:47:41.000Z | 2020-10-28T12:39:08.000Z | bach_code/decoder.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | null | null | null | bach_code/decoder.py | glasperfan/thesis | aead2dfb8052afbff4d05203a0be5b0b7ef69462 | [
"Apache-2.0"
] | 1 | 2020-10-28T12:39:09.000Z | 2020-10-28T12:39:09.000Z | # decoder.py
# Generate the musical scores for a Bach chorale and its prediction harmonization
import numpy as np
from music21 import *
from logit import load_dataset, encode, score_with_padding
from ordered_set import OrderedSet
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import One... | 31.760638 | 111 | 0.706079 |
6719a0a7b82e9e5fc52095400e78b40caa8f9b5f | 10,238 | py | Python | deprecated/benchmark/ps/distribute_ctr/tensorflow/ctr_dnn_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | deprecated/benchmark/ps/distribute_ctr/tensorflow/ctr_dnn_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | deprecated/benchmark/ps/distribute_ctr/tensorflow/ctr_dnn_distribute.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | #!/usr/bin/env python
# coding=utf-8
# from __future__ import absolute_import
# from __future__ import division
# from __future__ import print_function
import time
import sys
import os
import glob
import json
from datetime import date, timedelta
import tensorflow as tf
#################### CMD Arguments ###########... | 46.748858 | 185 | 0.583512 |
6794010b0fd7263f6d91f4906bedeeacb5d43a75 | 4,220 | py | Python | Packs/FireEyeEX/Integrations/FireEyeEX/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FireEyeEX/Integrations/FireEyeEX/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FireEyeEX/Integrations/FireEyeEX/test_data/result_constants.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | GET_ALERTS_CONTEXT = [
{'ack': 'no',
'action': 'notified',
'alertUrl': 'https://FireEyeEX/emps/eanalysis?e_id=9&type=url',
'applianceId': 'appid',
'attackTime': '2021-02-14 09:42:43 +0000',
'dst': {'smtpTo': 'test@actualdomain.org'},
'explanation': {'malwareDetected': {'malware': [{'md... | 34.876033 | 134 | 0.522512 |
c0659f84399e34dc2e4f87dbcb48dc772b36f53a | 1,287 | py | Python | marketPriceOracle.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | marketPriceOracle.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | marketPriceOracle.py | millsmgb/cfdBacktester | 1958c401f189b90f3d106cb63c872b1aac925569 | [
"MIT"
] | null | null | null | # Author: Matthew Mills
# Copyright 2016
# The purpose of this class is to provide the pricing oracle required to feed market data
# We write this in a similar fashion to how it would operate in Ethereum
# Hence the constructor initiates the oracle, which then refreshes when told
# ---
# This is the oracle to interf... | 20.428571 | 89 | 0.678322 |
451c686adb3fbed82f55e5c138a08242da549014 | 378 | py | Python | algorithms/ar-expsq/python3/exponentiation_by_squaring.py | NuclearCactus/FOSSALGO | eb66f3bdcd6c42c66e8fc7110a32ac021596ca66 | [
"MIT"
] | 59 | 2018-09-11T17:40:25.000Z | 2022-03-03T14:40:39.000Z | algorithms/ar-expsq/python3/exponentiation_by_squaring.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 468 | 2018-08-28T17:04:29.000Z | 2021-12-03T15:16:34.000Z | algorithms/ar-expsq/python3/exponentiation_by_squaring.py | RitvikDayal/FOSSALGO | ae225a5fffbd78d0dff83fd7b178ba47bfd7a769 | [
"MIT"
] | 253 | 2018-08-28T17:08:51.000Z | 2021-11-01T12:30:39.000Z | def exponentiation_by_squaring(base, power):
res = 1
while(power > 0):
if(power % 2 != 0):
res *= base #if power is ODD, multiply res with base
base *= base # square the base
power = power // 2 # halving power (integer)
return res
def main():
print(exponentiation... | 27 | 65 | 0.587302 |
beda4da42c7a1dd4a2901a8a114cc06f2facb14d | 11,276 | py | Python | src/compgen2/gov/matcher.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/gov/matcher.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/gov/matcher.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | """This module contains the Matcher class that provides the main logic to match names against the Gov database.
Examples:
```Python
m = Matcher(gov)
m.get_match_for_locations(["Aachen", "aarösund, flensburg"])
print(m.results)
```
"""
import difflib
import logging
from itertools import product
from operator import ite... | 42.550943 | 113 | 0.6152 |
3677f1ad96747ed198278dbceb839dbc5ad2d27d | 947 | py | Python | sketches/natureOfCode/chapter01/mover2/mover.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/natureOfCode/chapter01/mover2/mover.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/natureOfCode/chapter01/mover2/mover.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | class Mover(object):
def __init__(self):
self.location = PVector(width/2, height/2)
self.velocity = PVector(0, 0)
self.acceleration = PVector(-0.001, 0.01)
self.topspeed = 10
self.r = 15
def update(self):
self.velocity.add(self.acceleration)
self... | 28.69697 | 69 | 0.542767 |
369956f86635186054836c1fba0f1b8521013259 | 46 | py | Python | scripts/hello_world_udit-001.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2020-05-31T09:24:51.000Z | 2020-05-31T09:24:51.000Z | scripts/hello_world_udit-001.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 33 | 2019-04-21T13:22:03.000Z | 2022-03-06T12:11:18.000Z | python-demos/hello_world/hello_world_p2.py | zdenek-nemec/sandbox | 31572cb790869c4c2036c0a0902c1a054a9043d5 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | #!/usr/bin/env python2
print "Hello, World!"
| 11.5 | 22 | 0.673913 |
36c71446dbd80e2980d1e932b4f0bc9bdffa3050 | 14,821 | py | Python | src/ownfunctions.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | src/ownfunctions.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | src/ownfunctions.py | S0S-90/geocachingTooly | a6ed356d0187dd517a9436a83bded3752d488db5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""This file contains some functions that can be used everywhere in the program."""
import math
import datetime
from html.parser import HTMLParser
import unicodedata
import urllib.request
import user_io
def connected(website):
"""prueft, ob Internetverbindung vorhanden... | 33.1566 | 122 | 0.587005 |
36d758438cdc2701c825b0aaec3af965819d51a9 | 2,409 | py | Python | backend/match4healthcare/settings/production.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/match4healthcare/settings/production.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | backend/match4healthcare/settings/production.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | from match4healthcare.settings.common import *
from django.utils.log import DEFAULT_LOGGING
import logging
logger = logging.getLogger('django')
DEFAULT_LOGGING['handlers']['console']['filters'] = []
DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']
ALLOWED_HOSTS = ['matchmedisvsvirus.dynalias.org', 'helping-hea... | 28.011628 | 103 | 0.64176 |
62bd2fe037664b392414330c3bd93658a1471fed | 44,362 | py | Python | migrate.py | arslogavitabrevis/FreeCAD-documentation | 8166ce0fd906f0e15672cd1d52b3eb6cf9e17830 | [
"CC0-1.0"
] | null | null | null | migrate.py | arslogavitabrevis/FreeCAD-documentation | 8166ce0fd906f0e15672cd1d52b3eb6cf9e17830 | [
"CC0-1.0"
] | null | null | null | migrate.py | arslogavitabrevis/FreeCAD-documentation | 8166ce0fd906f0e15672cd1d52b3eb6cf9e17830 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
#***************************************************************************
#* Copyright (c) 2021 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or... | 36.693135 | 145 | 0.531942 |
3dd1e33516d875f588aab94d157acc222a1e007c | 2,527 | py | Python | Liter_Client/TMessage.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TMessage.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | Liter_Client/TMessage.py | Drelf2018/Liter | e12ffdd22ee7b2724722c38e852fc9c1b2f180ad | [
"MIT"
] | null | null | null | from PyQt5.QtWidgets import (QLabel)
from PyQt5.QtCore import (Qt, QRect)
from PyQt5.QtGui import (QPainter, QFont, QFontMetricsF, QBrush)
from .TMessageLabel import TMessageLabel
from .PicBase64 import get
class TMessage(QLabel):
'单条消息'
def __init__(self, massage, rwidth, parent=None):
super(TMessage... | 39.484375 | 115 | 0.619311 |
029574d78eaba8fb9f687d5c6148f77e1e1946d8 | 3,848 | py | Python | SVMBow.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | SVMBow.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | SVMBow.py | saikat-d/DIP2018-Midterm | 06c3a74ae4fefc2ec6d47d970bf86ab8062df1bf | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 27 09:34:30 2018
@author: Saikat
"""
import numpy as np
import cv2
from cv2 import ml
from matplotlib import pyplot as plt
from sklearn.metrics import roc_curve, auc
from os.path import isfile,join
class choices:
def _init_(self):
self.imgname = ' '
... | 30.0625 | 69 | 0.640852 |
02c2e70050c3470ef493ceb6bb2229becb5954a6 | 1,582 | py | Python | lib/python/qmk/makefile.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | 2 | 2021-04-16T23:29:01.000Z | 2021-04-17T02:26:22.000Z | lib/python/qmk/makefile.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | lib/python/qmk/makefile.py | fzf/qmk_toolbox | 10d6b425bd24b45002555022baf16fb11254118b | [
"MIT"
] | null | null | null | """ Functions for working with Makefiles
"""
from pathlib import Path
def parse_rules_mk_file(file, rules_mk=None):
"""Turn a rules.mk file into a dictionary.
Args:
file: path to the rules.mk file
rules_mk: already parsed rules.mk the new file should be merged with
Returns:
a dic... | 30.423077 | 76 | 0.459545 |
02f811374d59c9fb1408adac6af32337f1e0aa24 | 1,113 | py | Python | demos/Multiscale/amm_mechanism/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/Multiscale/amm_mechanism/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/Multiscale/amm_mechanism/model/partial_state_update_block.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | """
Partial state update block.
Here the partial state update blocks are configurated by setting
- policies
- variables
for each state update block individually
"""
from .parts.uniswap import *
from .parts.metrics import *
from .parts.action_list import *
partial_state_update_block = [
{
# uniswap.py a... | 24.195652 | 64 | 0.548967 |
02fbfa3a5f58712789d3f1b6876626825ace6451 | 2,448 | py | Python | pelicanconf.py | Alucarxd/alucarxd.github.io | 69a509957cec73a7cafe70e5e0afdfb0ed136614 | [
"MIT"
] | null | null | null | pelicanconf.py | Alucarxd/alucarxd.github.io | 69a509957cec73a7cafe70e5e0afdfb0ed136614 | [
"MIT"
] | null | null | null | pelicanconf.py | Alucarxd/alucarxd.github.io | 69a509957cec73a7cafe70e5e0afdfb0ed136614 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
AUTHOR = 'Gabriel Garcia'
SITENAME = 'Sitio Personal'
SITEURL = ''
PATH = 'content'
OUTPUT_PATH = 'docs/'
THEME= "MinimalXY"
TIMEZONE = 'America/Guayaquil'
DEFAULT_LANG = 'es'
# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED... | 24.237624 | 77 | 0.658088 |
b8597cef1b9e897077eb5e4f549cae34d40e0715 | 32,928 | py | Python | src/hospitalization_nowcast2.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | 1 | 2021-05-02T09:53:25.000Z | 2021-05-02T09:53:25.000Z | src/hospitalization_nowcast2.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | src/hospitalization_nowcast2.py | icestorm972/Covid19-PyAnalysis-Collection | 16127e9c590d37d3dfc89ec9877c52e6336d7d30 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 7 21:33:48 2021
@author: David
"""
import sys
sys.path.append('.')
# import os
# import inspect
from datetime import date
from pathlib import Path
import locale
import pandas as pd
import numpy as np
import scipy.signal as sig
import matplotlib.pyplot as plt
import m... | 34.807611 | 153 | 0.631256 |
a2f01db8674580ffd7a5629d11e3764bb6c09719 | 2,577 | py | Python | Liquid-experiments/pre_schedule/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | 2 | 2021-08-30T14:12:09.000Z | 2022-01-20T02:14:22.000Z | Liquid-experiments/pre_schedule/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | Liquid-experiments/pre_schedule/launcher.py | PasaLab/YAO | 2e70203197cd79f9522d65731ee5dc0eb236b005 | [
"Apache-2.0"
] | null | null | null | import random
import json
import time
def train(jm=None, api=None, seed=2020, case=None):
api.conf_reset()
api.conf_update('pool.pre_schedule.enable_threshold', 1.75)
conf = {
'candidates': ['neumf'],
'jm': jm,
'api': api,
'seed': seed,
'job_num': 100,
}
launch(conf)
def test(jm=N... | 22.80531 | 117 | 0.574311 |
a7410071dd62125b21f66a2a73589b7490f4e9f3 | 164 | py | Python | infrastructure/kctf/samples/xss-bot/healthcheck/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | infrastructure/kctf/samples/xss-bot/healthcheck/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | infrastructure/kctf/samples/xss-bot/healthcheck/exploit/doit.py | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# without this pwntools throws an error
import curses
curses.setupterm('xterm-256color')
from pwn import *
exit(0)
| 14.909091 | 39 | 0.70122 |
38f4b171654111d0018e379630a9789475edc1fb | 1,602 | py | Python | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/obj.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/obj.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Intro-Python-master/src/day-1-toy/obj.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # Make a class LatLon that can be passed parameters `lat` and `lon` to the
# constructor
class LatLon:
def __init__(self, lat, lon):
self.lat = lat
self.lon = lon
def __str__(self):
return f'The latitude is {self.lat} and longitude is {self.lon}'
# Make a class Waypoint that can be passed parameter... | 33.375 | 139 | 0.697253 |
ac3b18ea56b6320f4a1d06f37d28b2d26da47c5a | 1,404 | py | Python | examples/dependency_parsing/ddparser/criterion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dependency_parsing/ddparser/criterion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/dependency_parsing/ddparser/criterion.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.909091 | 74 | 0.711538 |
ce1061d399da1c8d889a11ed25b6f147d083da72 | 17,186 | py | Python | aiotftp/protocols.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | aiotftp/protocols.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | aiotftp/protocols.py | JulianOrteil/aiotftp | 67026f2c43429ee2649d769188fb8121ded6be80 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Async protocols for sending and receiving data."""
import argparse
import asyncio
from dataclasses import asdict, dataclass
from io import TextIOWrapper
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from loguru import logger
from .iofile import FileReader, FileWrit... | 34.166998 | 146 | 0.638427 |
5a22aa454fbe00fd7b8b9b04122fe3c1ee4a0896 | 1,332 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/03_excel_sheet_beschreiben/03_excel_sheet_beschreiben.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/03_excel_sheet_beschreiben/03_excel_sheet_beschreiben.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_12_Arbeiten_mit_Excel-Sheets/03_excel_sheet_beschreiben/03_excel_sheet_beschreiben.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | # 03_excel_sheet_beschreiben.py
# Dieses Script dient als Beispiel wie man Daten in Excel-Dateien schreibt.
import os, openpyxl
os.chdir(os.path.dirname(__file__))
excel_file='.\\test_file.xlsx'
if os.path.exists(excel_file):
os.remove(excel_file)
excel_sheet=openpyxl.Workbook()
sheet_names=excel_sheet.sheetname... | 34.153846 | 139 | 0.81006 |
0cc68f0033a3adb9b3c16477965e8cd8b6e509fc | 2,206 | py | Python | insomniac/tools/spintax.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 533 | 2020-06-01T10:40:11.000Z | 2022-03-29T17:05:50.000Z | insomniac/tools/spintax.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 399 | 2020-06-01T22:01:55.000Z | 2022-03-29T20:39:29.000Z | insomniac/tools/spintax.py | shifenis/Insomniac | 7c9d572b83c29049bc3075073be5549fe821a739 | [
"MIT"
] | 166 | 2020-06-01T21:51:52.000Z | 2022-03-12T14:14:44.000Z | # Taken from https://github.com/AceLewis/spintax/
import random
import re
def _replace_string(match):
"""
Function to replace the spintax with a randomly chosen string
:param match object:
:return string:
"""
global spintax_seperator, random_string
test_string = re.sub(spintax_seperator, ... | 34.46875 | 100 | 0.658205 |
0cec0ab2d6f970fa6616a6d73e55263c48b09d62 | 2,012 | py | Python | K-means/KMeans.py | moeinmd1380/MachineLearning | 3f5490fb379a217be5bca993b6e3983d151db11c | [
"Unlicense"
] | null | null | null | K-means/KMeans.py | moeinmd1380/MachineLearning | 3f5490fb379a217be5bca993b6e3983d151db11c | [
"Unlicense"
] | null | null | null | K-means/KMeans.py | moeinmd1380/MachineLearning | 3f5490fb379a217be5bca993b6e3983d151db11c | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
class KMeans:
def __init__(self, x, k):
self.x = x
self.k = k
self.centers = [list(np.random.randint(np.min(x), np.max(x), 2)) for _ in range(k)]
self.category = self.initializeCategory()
def initializeCategory(self):
... | 31.4375 | 112 | 0.568588 |
e7e57c90eedec969c5b6fc1d0909924aa389f799 | 5,950 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/binary_search_tree.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/binary_search_tree.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62b1/names/binary_search_tree.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import sys
sys.path.append('../queue_and_stack')
from dll_queue import Queue
from dll_stack import Stack
"""
Binary search trees are a data structure that enforce an ordering over the data they store. That ordering in turn makes it a lot more efficient at searching for a particular piece of data in the tree.
This pa... | 34.795322 | 201 | 0.606723 |
650ffdf0869bcdf76a8d390b1008c8782d67841d | 2,221 | py | Python | blender/addon/op/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | blender/addon/op/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | blender/addon/op/__init__.py | cnisidis/DMod | f51fb7928b0cdcde2772432194772b3676e41a12 | [
"MIT"
] | null | null | null | import bpy
import socket
import subprocess
import threading
from struct import unpack
class DmodThread(threading.Thread):
data = None
running = False
sock = None
def __init__(self):
threading.Thread.__init__(self)
self.data = None
def start(self):
# Run an ex... | 25.825581 | 81 | 0.594327 |
651ede829dd7f7a21629d7281999268c587a462d | 1,013 | py | Python | libraries.py | abhisheksharma026/AutoML | cc30d38e9e1a8a885ded15d40ed1584b3a4d6d34 | [
"MIT"
] | null | null | null | libraries.py | abhisheksharma026/AutoML | cc30d38e9e1a8a885ded15d40ed1584b3a4d6d34 | [
"MIT"
] | null | null | null | libraries.py | abhisheksharma026/AutoML | cc30d38e9e1a8a885ded15d40ed1584b3a4d6d34 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import math
import seaborn as sns
import scipy.stats as ss
import matplotlib
matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
import seaborn as sns
from functools import partial
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMax... | 25.974359 | 103 | 0.846989 |
653c0edc90ebde409c4d5bb979fb7adf3704bbe1 | 158 | py | Python | Python/Itertools/itertools_product.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Itertools/itertools_product.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | Python/Itertools/itertools_product.py | rho2/HackerRank | 4d9cdfcabeb20212db308d8e4f2ac1b8ebf7d266 | [
"MIT"
] | null | null | null | from itertools import product
a = set(map(int, input().strip().split()))
b = set(map(int, input().strip().split()))
print(' '.join(map(str, product(a, b)))) | 26.333333 | 42 | 0.632911 |
acb65ad924b273eadd5a761aeed27fe1e703b905 | 2,082 | py | Python | pylvm2/test_lvm.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 1 | 2015-08-02T09:53:18.000Z | 2015-08-02T09:53:18.000Z | pylvm2/test_lvm.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | null | null | null | pylvm2/test_lvm.py | lihuiba/SoftSAN | 1b8ab2cae92b7aac34211909b27d4ebe595275d7 | [
"Apache-2.0"
] | 2 | 2018-03-21T04:59:50.000Z | 2019-12-03T15:54:17.000Z | #!/usr/bin/env python
from lvm_ctrl import *
def help():
print 'your command should be as follow:'
print
print 'lvcreate vg_name(vgx) lv_name(lvx) size(xxxG/M)'
print 'lvremove lv_path(/dev/vgx/lvx)'
print 'lvextend lv_path(/dev/vgx/lvx) [+/-]size(+10G, -128M)'
print 'lvreduce lv_path(/dev/vgx/lvx) [+... | 24.494118 | 89 | 0.587896 |
c59e4bc2ab6730ab5071989ae3a78bb777c4c514 | 8,498 | py | Python | src/Interface.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 1 | 2020-05-29T21:09:33.000Z | 2020-05-29T21:09:33.000Z | src/Interface.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | 3 | 2020-06-14T11:33:54.000Z | 2022-01-13T03:31:06.000Z | src/Interface.py | LukasTinnes/VenturePainter | cb1f24fda2a43d402a9c5a401d713af0c950270b | [
"Unlicense"
] | null | null | null | import datetime
import json
import logging
import os
from tkinter import *
from tkinter import filedialog
from tkinter.messagebox import showinfo
import cv2
import matplotlib
import pygame
from matplotlib.image import imsave
from src.Intrepreter import Interpreter
from src.Loader import Loader
from src.Painter import... | 40.084906 | 104 | 0.600259 |
4f1f0ae6da56a9bbcb4e2c27a5b154a3ef96e989 | 773 | py | Python | src/unittest/python/grundlegend/test_vergleich.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_vergleich.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_vergleich.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: Walter Rafeiner-Magor <wrafeiner-magor@tgm.ac.at>
"""
import unittest
from bruch.Bruch import *
class TestVergleich(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(se... | 18.404762 | 58 | 0.578266 |
4f318a68c8a826496c917bae0e7fd7985f1f9ac0 | 792 | py | Python | interface/main_hass.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | interface/main_hass.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | interface/main_hass.py | hanyanze/FS_AILPB | 7756551cf926aa6296ec851dd696c97d56e06bca | [
"Apache-2.0"
] | null | null | null | import sys
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtWebEngineWidgets import *
class MainWindow(QMainWindow):
def __init__(self,parent = None):
super().__init__(parent)
# self.setGeometry(QApplication.desktop().screenGeometry())
... | 25.548387 | 67 | 0.660354 |
4fa8dcaf3127883e8fac6deaa275206c79ceeb7a | 1,554 | py | Python | haas_lib_bundles/python/libraries/rgb_led/rgbLed.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/rgb_led/rgbLed.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/rgb_led/rgbLed.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from driver import PWM
class RgbLed():
def __init__(self, pwmRObj, pwmGObj, pwmBObj):
if not isinstance(pwmRObj, PWM):
raise ValueError("parameter pwmRObj is not an PWM object")
if not isinstance(pwmGObj, PWM):
raise ValueError("parameter pwmGObj is not an PWM object")
... | 38.85 | 98 | 0.559846 |
4fcbc3c44cd1c9d282413101a6b8982e3646c61a | 4,950 | py | Python | skills/gasoline/gasoline.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | 4 | 2021-01-08T21:08:50.000Z | 2021-12-08T15:30:50.000Z | skills/gasoline/gasoline.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | skills/gasoline/gasoline.py | gidocarper/rhasspy-skills-test | eaf57287a67a0e43a299053cf0b107d61afd9b13 | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# original code from https://github.com/hablijack coverted and adapted to a rhasspy friendly environment by Gido Carper
# Gido also added 100 Cities with lantitude and longtitudes to be able to request gasoline prices in other cities
import requests, os, json
class Gasoli... | 37.218045 | 120 | 0.493737 |
ba1ac6d93a5942fc1f5606dd4c0a8d3909718025 | 4,826 | py | Python | TreeModelLib/BelowgroundCompetition/NetworkOGSLargeScale3DExternal/NetworkOGSLargeScale3DExternal.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/BelowgroundCompetition/NetworkOGSLargeScale3DExternal/NetworkOGSLargeScale3DExternal.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/BelowgroundCompetition/NetworkOGSLargeScale3DExternal/NetworkOGSLargeScale3DExternal.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 6 | 2019-11-12T11:11:41.000Z | 2021-08-12T13:57:22.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@date: 2021-Today
@author: marie-christin.wimmler@tu-dresden.de
"""
import numpy as np
from TreeModelLib.BelowgroundCompetition.OGSLargeScale3DExternal import \
OGSLargeScale3DExternal
from TreeModelLib.BelowgroundCompetition.NetworkOGSLargeScale3D import \
Ne... | 43.477477 | 79 | 0.721923 |
e8c954add1d3de9c4dc66a2c4a4b010b1c884505 | 2,851 | py | Python | test/test_npu/test_network_ops/test_hammingwindow.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_hammingwindow.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_hammingwindow.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... | 43.861538 | 159 | 0.682568 |
ad04202ed4bb3ed60adede44e7789cb64c55f57c | 1,818 | py | Python | 3_DeepLearning-CNNs/02_Convolutional_Neural_Network-Basics/1-Conv_Layer.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 3_DeepLearning-CNNs/02_Convolutional_Neural_Network-Basics/1-Conv_Layer.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 3_DeepLearning-CNNs/02_Convolutional_Neural_Network-Basics/1-Conv_Layer.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | '''
Conv Layer: berechnet mithilfe der Gewichtsmatrizen die Outputmatrix
-> siehe ConvLayer.png
size: Größe des Filters meistens 3x3
depth: Tiefe des Bildes (RGB: 3, Grauwert: 2)
strides: Wert um wieviel der Filter immer verschoben werden soll
Stride = (1,1) 1 nach rechts immer und 1 nach unten wenn Zeile ... | 30.3 | 117 | 0.735974 |
ad2ccf09d3f3c9e0848cdf9e64f7e91c5ce3a0d2 | 19,197 | py | Python | src/aijack/attack/inversion/gradientinversion.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:44.000Z | 2022-03-17T21:17:44.000Z | src/aijack/attack/inversion/gradientinversion.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | null | null | null | src/aijack/attack/inversion/gradientinversion.py | luoshenseeker/AIJack | 4e871a5b3beb4b7c976d38060d6956efcebf880d | [
"MIT"
] | 1 | 2022-03-17T21:17:46.000Z | 2022-03-17T21:17:46.000Z | import copy
import torch
import torch.nn as nn
from ..base_attack import BaseAttacker
from .utils.distance import cossim, l2
from .utils.regularization import (
bn_regularizer,
group_consistency,
label_matching,
total_variation,
)
class GradientInversion_Attack(BaseAttacker):
"""General Gradient... | 37.567515 | 139 | 0.612387 |
0e1fd0511e3102c8661d949f46b9425d7d7c7c0c | 8,709 | py | Python | WebAppExample/WebApp/Main/libDatabase.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null | WebAppExample/WebApp/Main/libDatabase.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null | WebAppExample/WebApp/Main/libDatabase.py | wallamejorge/PepqaWebApp | 20896a1224d1a2cea3a137950c4f0306f0269db7 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#----------------------------------------------------------------------------- #
#--- Title : Authentication
#--- Project : WebApp Server running in Django
#--- Author : Jorge Luis Mayorga Taborda
#--- Python : Runngin en Django 1.6 y Python 2.0
#--- Comments:
#---
#---
#---
#-----... | 36.746835 | 161 | 0.554828 |
0e9fcf11499199ea74e9cc8d52b6f8f69a4451b7 | 18,539 | py | Python | Securinets/2021/Quals/web/Warmup/utils.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Securinets/2021/Quals/web/Warmup/utils.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Securinets/2021/Quals/web/Warmup/utils.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | import urllib
import sys
import urlparse
import os
import time
import types
import shutil
from string import joinfields, split, lower
from xml.dom import minidom
domimpl = minidom.getDOMImplementation()
BUFFER_SIZE = 128 * 1000
class Resource(object):
# XXX this class is ugly
def __init__(self, fp, file_size... | 31.105705 | 80 | 0.515831 |
70db9bc2f3c1a7f3575aeadc59affa0fab3afc91 | 9,457 | py | Python | crowdbike/helpers.py | theendlessriver13/Crowdbike | eb63207d97a2e74ef69ec941efa15756bbfa0fea | [
"MIT"
] | null | null | null | crowdbike/helpers.py | theendlessriver13/Crowdbike | eb63207d97a2e74ef69ec941efa15756bbfa0fea | [
"MIT"
] | null | null | null | crowdbike/helpers.py | theendlessriver13/Crowdbike | eb63207d97a2e74ef69ec941efa15756bbfa0fea | [
"MIT"
] | null | null | null | from __future__ import annotations
import importlib.resources
import logging
import math
import os
import re
import shutil
import socket
import subprocess
import uuid
from typing import Any
import RPi.GPIO as GPIO
from tkinter import Label
from tkinter import messagebox
from tkinter import Tk
from tkinter import ttk
... | 31.31457 | 93 | 0.503965 |
cb0b315804eb3881321d2c90fb31f742643530c9 | 2,615 | py | Python | hausse/plugins/metadata/metadata_markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | null | null | null | hausse/plugins/metadata/metadata_markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-30T21:41:46.000Z | 2021-08-30T21:41:46.000Z | hausse/plugins/metadata/metadata_markdown.py | andrenasturas/hausse | 58e7cb71d5105cf1d6ec7d294e85668855bf8336 | [
"MIT"
] | 1 | 2021-08-31T19:27:32.000Z | 2021-08-31T19:27:32.000Z | from typing import List
import markdown2
from hausse.lib import SelectorPlugin, Element
from hausse.lib.selector import All
class MetadataMarkdown(SelectorPlugin):
"""
MetadataMarkdown
================
Parse elements metadata as Markdown to HTML.
This plugin accepts any number of keys at initia... | 32.283951 | 142 | 0.619503 |
cbb303fbd77487bf42f8d4af2065c3d5dba2f526 | 2,363 | py | Python | components/py_engine/tests/haas/HaaSEdu/python-apps/speech/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 4,538 | 2017-10-20T05:19:03.000Z | 2022-03-30T02:29:30.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/speech/main.py | ekmixon/AliOS-Things | 00334295af8aa474d818724149726ca93da4645d | [
"Apache-2.0"
] | 1,088 | 2017-10-21T07:57:22.000Z | 2022-03-31T08:15:49.000Z | components/py_engine/tests/haas/HaaSEdu/python-apps/speech/main.py | willianchanlovegithub/AliOS-Things | 637c0802cab667b872d3b97a121e18c66f256eab | [
"Apache-2.0"
] | 1,860 | 2017-10-20T05:22:35.000Z | 2022-03-27T10:54:14.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : haas_speech.py
@Description: file description
@Date : 2021/04/19 13:56:50
@Author :
@version : 1.0
'''
import iot
import utime
import http
import ujson as json
from speech_utils import *
# from const import *
# 语音播放相关的音频资源文件... | 24.873684 | 88 | 0.627169 |
69770a56e1e3de8ba20a5365aad4943c94925be9 | 124,117 | py | Python | Packs/DevSecOps/Integrations/DockerEngine/DockerEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/DevSecOps/Integrations/DockerEngine/DockerEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/DevSecOps/Integrations/DockerEngine/DockerEngine.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import urllib3
from CommonServerPython import *
class Client:
def __init__(self, server_url, verify, proxy, headers, client_cert, client_key):
self._base_url = server_url
self._verify = verify
self._proxy = proxy
self._headers = headers
self._client_cert = client_cert
... | 41.636028 | 120 | 0.649822 |
2d65337ea365049abb81833096249de77579f9e7 | 17,818 | py | Python | feedcrawler/common.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 16 | 2021-04-06T07:37:18.000Z | 2022-03-27T15:05:32.000Z | feedcrawler/common.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 17 | 2021-06-09T10:37:49.000Z | 2022-03-31T07:29:36.000Z | feedcrawler/common.py | rix1337/FeedCrawler | 6c104c39f1bd45e5d49c02c90bb8d9fd35f9709e | [
"MIT"
] | 3 | 2021-05-22T13:49:57.000Z | 2022-01-05T11:15:47.000Z | # -*- coding: utf-8 -*-
# FeedCrawler
# Projekt von https://github.com/rix1337
import base64
import datetime
import os
import re
import socket
import sys
from feedcrawler import internal
from feedcrawler import myjdapi
from feedcrawler.config import CrawlerConfig
from feedcrawler.db import FeedDb
from feedcrawler.db ... | 36.81405 | 606 | 0.516669 |
fab8b092b51ed0825c56a813ce80aaf580e9209c | 22 | py | Python | html_generiloj/__init__.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 124 | 2016-03-22T16:53:28.000Z | 2022-03-10T15:10:10.000Z | html_generiloj/__init__.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 55 | 2016-02-01T19:47:49.000Z | 2022-02-23T00:00:15.000Z | html_generiloj/__init__.py | junefish/kurso-zagreba-metodo | d057192dd28b85710614cdf2425bebd52d04b775 | [
"CC-BY-4.0"
] | 55 | 2016-02-16T19:18:49.000Z | 2021-07-04T22:33:33.000Z | from .generi import *
| 11 | 21 | 0.727273 |
87ba7fa1989b7ece309fdc4dfaeea5a1d1a1fc70 | 426 | py | Python | day21/inheritance.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day21/inheritance.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day21/inheritance.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | class Animal:
def __init__(self) -> None:
self.num_eyes = 2
def breathe(self):
print("inhale... exhale...")
class Fish(Animal):
def __init__(self) -> None:
super().__init__()
def swim(self):
print("moving in water")
def breathe(self):
super().breathe(... | 16.384615 | 38 | 0.57277 |
356ba4e1c4c84f537f89e305591dffdcdd9d35db | 1,372 | py | Python | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/language_features/__init__.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/language_features/__init__.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | .vscode/extensions/ms-python.python-2021.6.944021595/pythonFiles/lib/jedilsp/pygls/lsp/types/language_features/__init__.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | null | null | null | # flake8: noqa
from pygls.lsp.types.language_features.code_action import *
from pygls.lsp.types.language_features.code_lens import *
from pygls.lsp.types.language_features.color_presentation import *
from pygls.lsp.types.language_features.completion import *
from pygls.lsp.types.language_features.declaration import *
f... | 57.166667 | 66 | 0.852041 |
ea020d254a399ec8735976c7e58c6f1403106064 | 9,696 | py | Python | research/cv/MaskedFaceRecognition/model/stn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/MaskedFaceRecognition/model/stn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/MaskedFaceRecognition/model/stn.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.550173 | 94 | 0.578383 |
ea03809da8bcdf8d58281b4eca56682a0cc88dbe | 2,303 | py | Python | src/slopecharts/slopechart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/slopecharts/slopechart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/slopecharts/slopechart.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | import matplotlib.lines as mlines
# Import Data
df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/gdppercap.csv")
left_label = [str(c) + ', '+ str(round(y)) for c, y in zip(df.continent, df['1952'])]
right_label = [str(c) + ', '+ str(round(y)) for c, y in zip(df.continent, df['1957'])]
klass ... | 46.06 | 129 | 0.667825 |
ea92f5b77f68d302e3c6b59625388618159e9d35 | 1,146 | py | Python | exercises/fr/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/exc_02_13.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("fr_core_news_sm")
doc = nlp(
"Twitch Prime, le programme pour les membres d'Amazon destiné aux "
"fans de jeux vidéos, arrête l'une de ses fonctionnalités les plus "
"appréciées de cette offre tout-compris : l'absence de publicité. "
"La ... | 40.928571 | 84 | 0.713787 |
575b36ffcac03f29a9bfe5f587928afabbb41507 | 819 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex04_remove_duplicates_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex04_remove_duplicates_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch05_datastructures/ex04_remove_duplicates_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch05_datastructures.solutions.ex04_remove_duplicates import remove_duplicates, remove_duplicates_with_dict
def inputs_and_expected():
return [([1, 1, 2, 3, 4, 1, 2, 3], [1, 2, 3, 4]),
([7, 5, 3,... | 26.419355 | 111 | 0.661783 |
57dd8dd22a3ad989c8d61515a941b227e3cbad0b | 930 | py | Python | src/test/tests/session/selection.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/session/selection.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/session/selection.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: selection.py
#
# Tests: mesh - 2D curvilinear, multiple domain
# plots - FilledBoundary, Mesh, Pseudocolor
#
# Notes: This test case makes sure that VisIt can read sessio... | 32.068966 | 80 | 0.531183 |
f499ffcab7eaa5b3a5ecf3e084623fd2e29dc68b | 3,431 | py | Python | Lab2/task[4-6].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | Lab2/task[4-6].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | Lab2/task[4-6].py | ValeriyMartsyshyn/HelloPython | badcf85bc54e889eed0286b420e5cabe68da8572 | [
"MIT"
] | null | null | null | # Task 4
"""Write a program that asks the user how many items they are buying and prints the total cost."""
amount = int(input("How many items do you want to purchase?: "))
if 0 <= amount < 10:
print("Your amount is:", amount, ".", "The cost is: $", amount * 12, ".")
elif 10 <= amount < 100:
print("Your amo... | 28.831933 | 133 | 0.59487 |
52657c593fe3c0e0fd9c237f07bacc0bb9a7baba | 4,758 | py | Python | redpwn/2021/misc/the-substitution-game/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | redpwn/2021/misc/the-substitution-game/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | redpwn/2021/misc/the-substitution-game/chall.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
from random import SystemRandom
rand = SystemRandom()
def test_substitution(substitutions, string):
def substitute(s, a, b):
initial = s
s = s.replace(a, b)
return (s, not s == initial)
# s ^ 2 rounds for string of length s
for _ in range(len(string) ** 2)... | 28.836364 | 78 | 0.615385 |
5eb73324adb363f76cec0d7f5ce6f2093371c137 | 535 | py | Python | source/pkgsrc/math/py-numpy/patches/patch-numpy_linalg_setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/math/py-numpy/patches/patch-numpy_linalg_setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/math/py-numpy/patches/patch-numpy_linalg_setup.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-numpy_linalg_setup.py,v 1.1 2021/05/03 17:15:22 adam Exp $
Use C language (not F77 from lapack_info); fixes library name on Darwin.
--- numpy/linalg/setup.py.orig 2021-04-22 17:45:05.000000000 +0000
+++ numpy/linalg/setup.py
@@ -54,6 +54,8 @@ def configuration(parent_package='', top
se... | 33.4375 | 73 | 0.66729 |
338f5d02eadcaaf22214e63b95a1f01352cc8400 | 133 | py | Python | python/python_backup/PRAC_PYTHON/ww.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ww.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ww.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | a=input("enter apurchase")
if a<=10000:
d=(a*10)/100
if a<=25000:
d=(a*15)/100
if a<=50000:
d=(a*25)/100
print "discount",d | 16.625 | 27 | 0.593985 |
1d5f65a3e47b4a351128ca12d1fbc6958ca2c9fd | 64 | py | Python | etl/mappings/active_procedure_names.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/mappings/active_procedure_names.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/mappings/active_procedure_names.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | active_procedure_names = [
{ 'fid':'name', 'pos':'name'},
]
| 16 | 34 | 0.5625 |
899807e731bf11dcf307abbd32d5b8af2316cb1f | 398 | py | Python | tasks/nominatim.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | tasks/nominatim.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | tasks/nominatim.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | import requests
def find_coordinates(query):
response = requests.get('https://nominatim.openstreetmap.org/search', params={
'format': 'json',
'q': query
})
if not response.status_code == requests.codes.ok:
return False
places = response.json()
if len(places) > 0:
p... | 23.411765 | 82 | 0.603015 |
63f1b7d83c6a738275dc43d537d52d3e6ad6dc70 | 1,006 | py | Python | src/skidesign.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/skidesign.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | src/skidesign.py | xiaonanln/python-usaco | 8f0fef19cb5f89232d985f79d955f0de5ef4e10d | [
"MIT"
] | null | null | null | """
ID: isaiahl1
LANG: PYTHON2
TASK: skidesign
"""
TASK = 'skidesign'
def readints(fin):
return tuple(int(x) for x in fin.readline().split())
def readint(fin):
return int(fin.readline())
def main(fin, fout):
N = readint(fin)
hills = []
for _ in xrange(N):
hills.append(readint(fin))
print N, hills
hills.sor... | 20.530612 | 55 | 0.67495 |
61865a5d5278700f145852f59d9c18e69e754dcd | 1,778 | py | Python | python/advanced_sw/GIT-SCRAPER/jgd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/GIT-SCRAPER/jgd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/GIT-SCRAPER/jgd.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import json
from pprint import pprint
from selenium import webdriver
from bs4 import BeautifulSoup
from pathlib import Path
from tqdm import tqdm
import json
import time
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import wget
import os
def get_files(get_file_names,ret_da... | 29.633333 | 130 | 0.618673 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.