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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3ede85c56fd00539e1922a7277c07841b74d5318 | 468 | py | Python | projects/Lc-Display/b2/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | projects/Lc-Display/b2/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | projects/Lc-Display/b2/script.py | DockerComposeFiles/ARM | b0faddb525ad134ff8c589c370d8e61ab030c216 | [
"MIT"
] | null | null | null | # auslesen
import os
import Adafruit_BBIO.GPIO as GPIO
# Beispiel
#GPIO.setup("P8_10", GPIO.OUT)
#GPIO.output("P8_10", GPIO.HIGH)
# konfiguriere I2C Pins direkt
GPIO.setup("P9_17", GPIO.IN)
GPIO.setup("P9_18", GPIO.IN)
GPIO.setup("P9_19", GPIO.IN)
GPIO.setup("P9_20", GPIO.IN)
GPIO.setup("P9_21", GPIO.IN)
GPIO.setup... | 18 | 33 | 0.715812 |
720018016ce4609b10324d57674386db50ed0edc | 3,011 | py | Python | frappe-bench/env/lib/python2.7/site-packages/github/PullRequestReviewerRequest.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/PullRequestReviewerRequest.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/env/lib/python2.7/site-packages/github/PullRequestReviewerRequest.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2017 Aaron Levine <allevin@sandia.gov> #
# Copyright 2018 Wan Liuyang <tsfdye@gmail.com> ... | 46.323077 | 141 | 0.469279 |
a0dabc3b6d4d43b3a84d2dc16df200a7fde50b0d | 349 | py | Python | src/mycms/admin.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | src/mycms/admin.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | src/mycms/admin.py | daimon99/santicms | 9b113b806cb43e94084ea474ba0aab51b32f9b3c | [
"MIT"
] | null | null | null | # -*- coding:utf8 -*-
from django.contrib import admin
import models as m
# Register your models here.
@admin.register(m.Article, m.ArticleStatistic, m.ArticleStatisticDetail, m.ATag, m.Reply, m.UserATagStatistics,
m.UserBrowseHistory,
m.UserProfile, m.UserStatistics)
class CommonAdmin... | 24.928571 | 111 | 0.704871 |
9d2e5ac0e46e8b9a4d1dcf3049633f8bfe0d0456 | 12,268 | py | Python | examples/language_model/xlm/xnli_train.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/xlm/xnli_train.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/language_model/xlm/xnli_train.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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.218069 | 115 | 0.56733 |
c23b73c3bd87722c7cc3f4505786dbc61f68e8c8 | 310 | py | Python | mitglieder/tests/test_apps.py | mribrgr/StuRa-Mitgliederdatenbank | 87a261d66c279ff86056e315b05e6966b79df9fa | [
"MIT"
] | 8 | 2019-11-26T13:34:46.000Z | 2021-06-21T13:41:57.000Z | src/mitglieder/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 93 | 2019-12-16T09:29:10.000Z | 2021-04-24T12:03:33.000Z | src/mitglieder/tests/test_apps.py | Sumarbrander/Stura-Mitgliederdatenbank | 691dbd33683b2c2d408efe7a3eb28e083ebcd62a | [
"MIT"
] | 2 | 2020-12-03T12:43:19.000Z | 2020-12-22T21:48:47.000Z | from django.apps import apps
from django.test import TestCase
from mitglieder.apps import MitgliederConfig
class ReportsConfigTest(TestCase):
def test_apps(self):
self.assertEqual(MitgliederConfig.name, 'mitglieder')
self.assertEqual(apps.get_app_config('mitglieder').name, 'mitglieder')
| 31 | 78 | 0.774194 |
a070cb0892c2a2c453e40806413e4e11aa16d785 | 1,062 | py | Python | Packs/QRadar/Scripts/QRadarMagnitude/QRadarMagnitude.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/QRadar/Scripts/QRadarMagnitude/QRadarMagnitude.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/QRadar/Scripts/QRadarMagnitude/QRadarMagnitude.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 main():
try:
incident = demisto.incident()
magnitude = incident.get('CustomFields', {}).get('magnitudeoffense', 0) # define which incident field to use
if 8 <= magnitude <= 10:
magn... | 31.235294 | 117 | 0.571563 |
26a5810babcdd18ea9328d7f0497fdfd00279723 | 627 | py | Python | pacman-arch/test/pacman/tests/upgrade059.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade059.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade059.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Upgrade packages which would break a multiple-depend"
lp1 = pmpkg("pkg1")
lp1.depends = ["imaginary"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2", "1.0-1")
lp2.provides = ["imaginary"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3", "1.0-1")
lp3.provides = ["imaginary"]
self.addpkg2db("local... | 23.222222 | 73 | 0.665072 |
f2397266ae92a9c64fe67660cc532ae3cabcfcea | 1,803 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/visualization/plotXMLAttr.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/visualization/plotXMLAttr.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/visualization/plotXMLAttr.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 avail... | 34.018868 | 77 | 0.690516 |
8a881dfb20c71c08b17940895f756f9501a71e98 | 1,868 | py | Python | packages/watchmen-rest-doll/src/watchmen_rest_doll/analysis/pipeline_index_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/analysis/pipeline_index_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-rest-doll/src/watchmen_rest_doll/analysis/pipeline_index_router.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import Optional
from fastapi import APIRouter, Depends
from starlette.responses import Response
from watchmen_auth import PrincipalService
from watchmen_meta.admin import PipelineService
from watchmen_meta.analysis import PipelineIndexService
from watchmen_meta.common import ask_meta_storage, ask_snowflak... | 37.36 | 114 | 0.837794 |
76e57c3745c0184869b4d3564256eddf0620eb0d | 762 | py | Python | Algorithms/Python/BucketSort.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 2 | 2021-12-13T10:09:47.000Z | 2022-01-05T11:04:31.000Z | Algorithms/Python/BucketSort.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 1 | 2021-10-15T17:55:47.000Z | 2021-10-17T20:43:15.000Z | Algorithms/Python/BucketSort.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 4 | 2021-10-12T13:05:10.000Z | 2021-10-16T19:31:46.000Z | from InsertionSort import insertionSort
def bucketSort(x):
arr = []
slot_num = 10 # 10 means 10 slots, each
# slot's size is 0.1
for i in range(slot_num):
arr.append([])
# Put array elements in different buckets
for j in x:
index_b = int(slot_num * j)
... | 25.4 | 45 | 0.538058 |
6a8a7a4b451a95ba0606c3979c1f4a90b1dc1187 | 1,280 | py | Python | display/_main_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_main_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_main_view.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from ._button_lights import ButtonLights
from ._view import View
from ._display import Display
import buzzer as bzr
import logging
main_view_name = "main_view"
class MainView(View, bzr.BuzzerCallback):
_buzzer_1_enabled = False
_buzzer_2_enabled = False
def __init__(self, button_lights: ButtonLights):... | 26.666667 | 97 | 0.642188 |
0addb87a643b9f8d6c04ff06ef8da4ab2c14f5e8 | 3,209 | py | Python | src/gvz/admin.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 7 | 2021-04-24T19:11:15.000Z | 2021-10-30T12:59:16.000Z | src/gvz/admin.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | 10 | 2021-04-25T10:25:12.000Z | 2021-04-26T17:55:20.000Z | src/gvz/admin.py | Integreat/gemeindeverzeichnis-django | 0089b97ea02b4741263c37357260c497b66a306d | [
"Apache-2.0"
] | null | null | null | """
Django admin back end
"""
# pylint: disable=R0903
from django.db.models import Q
from django.contrib import admin
from django import forms
from django.shortcuts import render, redirect
from django.urls import path
from .models import AdministrativeDivision, ZipCode
from .import_helpers import import_gvz_data, imp... | 31.460784 | 83 | 0.620443 |
7c466c6c09eb4cccd9e3fb5c17b72e45317f6293 | 24,930 | py | Python | Packs/CounterCraft/Integrations/CounterCraft/CounterCraft.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CounterCraft/Integrations/CounterCraft/CounterCraft.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CounterCraft/Integrations/CounterCraft/CounterCraft.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import urllib.parse
import requests
import hmac
from datetime import datetime
import time
import binascii
import uuid
from typing import Dict, List
from hashlib import sha1
# Disable insecure warnings
requests.packages.urllib... | 27.395604 | 119 | 0.592539 |
7c56c7f273f437ab6177ddee46e5f55f0b87e637 | 3,191 | py | Python | solvemyproblem/znanija.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | null | null | null | solvemyproblem/znanija.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | null | null | null | solvemyproblem/znanija.py | sah-py/SolveMyProblem | e569027b6aae65a1b7a4d480633adbb32becb329 | [
"MIT"
] | 1 | 2020-03-07T22:03:13.000Z | 2020-03-07T22:03:13.000Z | import sys
import asyncio
import aiohttp
from os import path
from bs4 import BeautifulSoup
from arsenic import get_session, browsers, services
from urllib.parse import quote
from io import BytesIO
from PIL import Image
class AsyncZnanija:
def __init__(self, loop=asyncio.get_event_loop()):
a... | 36.678161 | 102 | 0.587903 |
7cd5cc371beacfe5ec50e50105cee74fcacf5531 | 354 | py | Python | Licence 2/I33/TP 3/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 8 | 2020-11-26T20:45:12.000Z | 2021-11-29T15:46:22.000Z | Licence 2/I33/TP 3/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | null | null | null | Licence 2/I33/TP 3/ex_5.py | axelcoezard/licence | 1ed409c4572dea080169171beb7e8571159ba071 | [
"MIT"
] | 6 | 2020-10-23T15:29:24.000Z | 2021-05-05T19:10:45.000Z | def multbyalpha(b, f):
resultat = b << 1
taille = len(bin(f)) - 3
if ((resultat & (1 << taille)) != 0):
resultat ^= f
return resultat
def multiplication(b, c, f):
produit, aux = 0, c
while (b != 0):
if (b & 1) != 0:
produit ^= aux
aux = multbyalpha(aux, f)
... | 20.823529 | 41 | 0.474576 |
863758db73bb63fe7cc662fb72b20dde795276f4 | 7,873 | py | Python | .venv/Lib/site-packages/ipopt-0.1.9/build/lib.win-amd64-3.7/ipopt/ipopt_wrapper.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/build/lib.win-amd64-3.7/ipopt/ipopt_wrapper.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | .venv/Lib/site-packages/ipopt-0.1.9/build/lib.win-amd64-3.7/ipopt/ipopt_wrapper.py | AI-Assistant/FEMAG-Python | ff86e8f41485ae9df6034e6b8e810b59f8094c70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
cyipopt: Python wrapper for the Ipopt optimization package, written in Cython.
Copyright (C) 2012-2015 Amit Aides
Copyright (C) 2015-2018 Matthias Kümmerer
Author: Matthias Kümmerer <matthias.kuemmerer@bethgelab.org>
(original Author: Amit Aides <amitibo@tx.technion.a... | 32.941423 | 116 | 0.582497 |
865a2d26efd29debeed5fd99be4a1438f49904d5 | 155 | py | Python | HackerP/introduction/hello.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | HackerP/introduction/hello.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | HackerP/introduction/hello.py | JKChang2015/hackerrank | 5e5bd6892d2e4754e73f73eecfa8f4b9f266c3bd | [
"MIT"
] | null | null | null | # hello
# Created by JKChang
# 10/08/2018, 14:13
# Tag:
# Description: https://www.hackerrank.com/challenges/py-hello-world/problem
print('hello HackerP') | 22.142857 | 75 | 0.735484 |
d4d0c054bd8c6ab251cce470a6372d0eed7bc869 | 38,962 | py | Python | app/ariadicom.py | MePyDo/pygqa | 61cde42ee815968fdd029cc5056ede3badea3d91 | [
"MIT"
] | 3 | 2021-02-25T13:19:52.000Z | 2021-03-03T03:46:46.000Z | app/ariadicom.py | MedPhyDO/pygqa | 580b2c6028d2299790a38262b795b8409cbfcc37 | [
"MIT"
] | null | null | null | app/ariadicom.py | MedPhyDO/pygqa | 580b2c6028d2299790a38262b795b8409cbfcc37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = "R. Bauer"
__copyright__ = "MedPhyDO - Machbarkeitsstudien des Instituts für Medizinische Strahlenphysik und Strahlenschutz am Klinikum Dortmund im Rahmen von Bachelor und Masterarbeiten an der TU-Dortmund / FH-Dortmund"
__credits__ = ["R.Bauer", "K.Loot"]
__license__ = "MIT"
__ver... | 35.876611 | 209 | 0.523022 |
1351bc69549c3a7ba0e12ef228cdb697449ed8b0 | 1,460 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/xml/rebuildSchemata.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/xml/rebuildSchemata.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/xml/rebuildSchemata.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) 2011-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... | 47.096774 | 120 | 0.739041 |
13920d35f19ab86cabedfd4db491e778c716a7c5 | 3,772 | py | Python | notebooks/03-xente-model.py | marcusinthesky/UmojaHack | ab25fd7e06bba2d2a5f7a0ce5b676f2e4bd989db | [
"MIT"
] | 2 | 2020-04-02T02:08:57.000Z | 2020-04-21T21:59:55.000Z | notebooks/03-xente-model.py | marcusinthesky/Zindi-UmojaHack-Hackathon | ab25fd7e06bba2d2a5f7a0ce5b676f2e4bd989db | [
"MIT"
] | null | null | null | notebooks/03-xente-model.py | marcusinthesky/Zindi-UmojaHack-Hackathon | ab25fd7e06bba2d2a5f7a0ce5b676f2e4bd989db | [
"MIT"
] | null | null | null | # %%
import logging
from pathlib import Path
import numpy as np
import hvplot.pandas
import holoviews as hv
import pandas as pd
import git
from sklearn.compose import ColumnTransformer, TransformedTargetRegressor
from sklearn.datasets import load_digits
from sklearn.multioutput import MultiOutputRegressor
from sklearn... | 32.239316 | 130 | 0.708643 |
13e999d7a8402627a9336059336c1c25d67abd2b | 1,696 | py | Python | test/multinomial_large_n.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | test/multinomial_large_n.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | 3 | 2020-03-24T18:18:21.000Z | 2021-08-23T20:37:09.000Z | test/multinomial_large_n.py | saeyoung/tslb | 5f52646260e14f44c61a670cfc75509951e5e794 | [
"MIT"
] | null | null | null | ######################################################
#
# Functions for markov processes with large state space
#
######################################################
import numpy as np
import pandas as pd
import random
import copy
import pickle
from matplotlib import pyplot as plt
from sklearn.linear_model import L... | 36.869565 | 122 | 0.645637 |
b95448a25af8c026ce9716a587e7907d51998fd1 | 1,504 | py | Python | educa/courses/urls.py | alvarocneto/educa_packt | 723a0e975ef5a816b6847054d558dcbb5afc3d11 | [
"MIT"
] | null | null | null | educa/courses/urls.py | alvarocneto/educa_packt | 723a0e975ef5a816b6847054d558dcbb5afc3d11 | [
"MIT"
] | null | null | null | educa/courses/urls.py | alvarocneto/educa_packt | 723a0e975ef5a816b6847054d558dcbb5afc3d11 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^mine/$', views.ManageCourseListView.as_view(), name='manage_course_list'),
url(r'^create/$', views.CourseCreateView.as_view(), name='course_create'),
url(r'^(?P<pk>\d+)/edit/$', views.CourseUpdateView.as_view(), name='cou... | 57.846154 | 108 | 0.673537 |
b96543ce12f9f2a8187a17e3e226fde3562bf6f0 | 818 | py | Python | 1_basics/7_variablen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/7_variablen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 1_basics/7_variablen.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Drei Formen mit der gleichen Y-Position
Eine Variable zum Wiederverwenden eines Wertes.
"""
newPage(1000, 1000)
posY = 0
rect(100, posY, 150, 150)
oval(400, posY, 150, 150)
polygon((700, posY), (880, posY), (790, 150), close=True)
"""
«posY» ist eine Variable.
Das Gleichzeichen bewirkt eine Wertzuweisung: Di... | 24.787879 | 60 | 0.754279 |
b96f83fc9d93da1d007b8ba756e1aaa2a3f69f6d | 921 | py | Python | tests/server/handlers/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | tests/server/handlers/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | tests/server/handlers/test_metrics.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import pytest
from server import create_app
METRICS_ENDPOINT = "/v1/api/monitors/{monitor_id}/metrics?metric={metric}&column_name={column_name}"
NUM_METRICS_FOR_MONITOR = 4
@pytest.fixture
def client(tmpdir):
temp_db_file = f"sqlite:///{tmpdir.dirpath()}"
app = create_app()
app.config["TESTING"] = True
... | 23.615385 | 100 | 0.704669 |
0edc670f524468c993a525a0b500e73a50308c03 | 5,964 | py | Python | source/test/test_commentparser.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | source/test/test_commentparser.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | source/test/test_commentparser.py | marctrommen/bloggenerator | 5b4fed4cd12a899829261d492328dfc39a78153d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
import commentparser
import datetime
PARAMETER_BLOGTITLE = "blogtitle"
PARAMETER_BLOGCREATED = "blogcreated"
PARAMETER_BLOGCHANGED = "blogchanged"
PARAMETER_BLOGKEYWORDS = "blogkeywords"
DEFAULT_VALUE_NOKEYWORD = "no_keyword"
class CommentParserTest(u... | 32.237838 | 87 | 0.731556 |
1611525a3c660bd96b945a6a5b7e627e2a1a37f2 | 1,759 | py | Python | coding/util.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 144 | 2018-07-13T07:47:50.000Z | 2022-03-31T06:29:50.000Z | coding/util.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 18 | 2019-03-29T10:37:01.000Z | 2022-03-02T12:47:34.000Z | coding/util.py | Yigit-Arisoy/deep-rts | a5ed2c29b76789830df9f7075480c7229ccf0f4d | [
"MIT"
] | 23 | 2018-11-02T18:12:51.000Z | 2022-02-15T20:32:18.000Z | import logging
import sys
import gym
import numpy as np
def get_available_gpus():
from tensorflow_core.python.client import device_lib
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
def gpu_count():
return len(get_availabl... | 28.370968 | 120 | 0.64241 |
167b527abeba42c6a62af049544f1921ffc86455 | 7,403 | py | Python | Packs/CommonScripts/Scripts/CheckFieldValue/CheckFieldValue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/CheckFieldValue/CheckFieldValue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/CheckFieldValue/CheckFieldValue_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
from CheckFieldValue import poll_field
incident_contains_field_in_custom_fields = {
'id': 1,
'name': 'This is incident1',
'type': 'Phishing',
'severity': 0,
'status': 1,
'created': '2019-01-02',
'closed': '0001-01-01T00:00:00Z',
'labels': [{'type': 'subj... | 30.216327 | 108 | 0.63947 |
d5ebc55ed6401a5451b9343b14174d6681a2ccd9 | 5,006 | py | Python | myspiders/ruia/ruia_pyppeteer/request.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/ruia/ruia_pyppeteer/request.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/ruia/ruia_pyppeteer/request.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | import asyncio
import async_timeout
import pyppeteer
from typing import Optional
from ..request import Request
from ..response import Response
from .response import PyppeteerResponse
class PyppeteerRequest(Request):
def __init__(self, url: str, method: str = 'GET', *,
callback=None,
... | 47.226415 | 105 | 0.460447 |
9137b5aa92d63e799c99eaa3aff38441b3d73a3e | 1,250 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v7_0/migrate_schools_to_erpnext.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/migrate_schools_to_erpnext.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v7_0/migrate_schools_to_erpnext.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe, os
from frappe.installer import remove_from_installed_apps
def execute():
reload_doctypes_for_schools_icons()
frappe.reload_doc('website', 'doctype', 'portal_settings')
frappe.reload_doc('website', 'doctype', 'portal_menu_item')
frappe.reload_doc('buying', 'd... | 39.0625 | 99 | 0.7352 |
fc3a7d5baeb42eea194f63277962144f853c7ce3 | 380 | py | Python | exercises/fr/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/fr/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/fr/solution_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("fr_core_news_sm")
doc = nlp("Berlin est une jolie ville")
# Itère sur les tokens
for token in doc:
# Vérifie si le token courant est un nom propre
if token.pos_ == "PROPN":
# Vérifie si le token suivant est un verbe
if doc[token.i + 1].pos_ == "VERB":
... | 29.230769 | 70 | 0.644737 |
f8f8a207465c2f7cf48762226fe121a089f6b997 | 4,918 | py | Python | flaskapp.py | AP2008/CacheServer | 25ff9077267bb3f68359f7bf2dcb16ad92cbb7f7 | [
"MIT"
] | null | null | null | flaskapp.py | AP2008/CacheServer | 25ff9077267bb3f68359f7bf2dcb16ad92cbb7f7 | [
"MIT"
] | null | null | null | flaskapp.py | AP2008/CacheServer | 25ff9077267bb3f68359f7bf2dcb16ad92cbb7f7 | [
"MIT"
] | null | null | null | from flask import Flask, request
import requests
import os
import time
app = Flask(__name__)
@app.route('/')
def home():
from generate import countries
print(countries)
country=request.args.get("c")
if country and (country in countries):
path = "/home/CacheServer/countries/{}".format(country)
... | 109.288889 | 3,481 | 0.626881 |
5d290e12873eecaaa23f67c9fb5eec059b872b49 | 9,339 | py | Python | json_schemas/generate_json_schemas.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | json_schemas/generate_json_schemas.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | json_schemas/generate_json_schemas.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
This script is run in the tox 'json_schemas' environment.
It creates json schema files as described in the README.md in the same directory.
"""
import json
import pathlib
from typing import List, Type
from marshmallow import Schema, fields
from marshmallow_jsonschema import JSONSchema # type:ignore[import]
from... | 41.878924 | 208 | 0.837991 |
53758e792c46302f3dbe7dc75e1f0bc1454bc3db | 1,968 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/build/build_lite_manager.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/build/build_lite_manager.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/test/developertest/src/core/build/build_lite_manager.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | 32.262295 | 79 | 0.659045 |
073b7ae1dddd7ae146d1776ef1e03bb201e3c084 | 949 | py | Python | migrations/versions/4e913af88c33_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | migrations/versions/4e913af88c33_.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | migrations/versions/4e913af88c33_.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | """empty message
Revision ID: 4e913af88c33
Revises: 67216b6cf293
Create Date: 2020-09-18 15:04:03.359403
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "4e913af88c33"
down_revision = "67216b6cf293"
branch_lab... | 24.973684 | 65 | 0.671233 |
9156ac22f8ef1f4ad7c7ca9316584b4f6ba67c50 | 167 | py | Python | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | 2_postitionierung/3_rotieren.py | Coding-for-the-Arts/drawbot-samples | e37994f3497aca252312431100b53548b4573f15 | [
"CC0-1.0"
] | null | null | null | """
Rotation
"""
newPage(1000, 1000)
rotate(45)
rect(0, 0, 500, 500)
"""
- Was wird durch die Funktion rotate() gedreht?
(Tipp: es ist nicht das Rechteck.)
"""
| 10.4375 | 47 | 0.622754 |
7294651d36080afa92c37e804ab21df79d3928b1 | 1,070 | py | Python | python/oneflow/compatible/single_client/optimizer/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/optimizer/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/optimizer/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 27.435897 | 72 | 0.75514 |
72dbdda0ca3e0e3796c39ef442739a06cbdc3bce | 1,192 | py | Python | robolib/datamanager/atntfaces.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/datamanager/atntfaces.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/datamanager/atntfaces.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import os.path
from urllib.request import urlretrieve
import robolib.datamanager.datamanagerutils as du
import zipfile
ATNT_FACE_URL = "http://www.cl.cam.ac.uk/Research/DTG/attarchive/pub/data/att_faces.zip"
def get_data(model_name, delete=False):
dir_name = du.get_model_filename(model_name)
file_name = dir_... | 39.733333 | 93 | 0.67953 |
72fe7e97cf4d360a1d1b07967630cdd69f4ef5b7 | 2,185 | py | Python | PythonPro/demo/variable.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | PythonPro/demo/variable.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | PythonPro/demo/variable.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | #coding=utf-8
#变量类型
dict = {}
dict['one'] = "This is one"
dict[2] = "This is two"
tinydict = {'name': 'john','code':6734, 'dept': 'sales'}
print dict['one'] # 输出键为'one' 的值
print dict[2] # 输出键为 2 的值
print tinydict # 输出完整的字典
print tinydict.keys() # 输出所有键
print tinydict.values() ... | 19.863636 | 56 | 0.550114 |
be55a8ba0a24fa8c63b12679cdfae33c9608beb4 | 2,172 | py | Python | modeling/head/nonlocalunet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | modeling/head/nonlocalunet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | modeling/head/nonlocalunet.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | """ Full assembly of the parts to form the complete network """
from __future__ import division
import torch
import torch.nn as nn
from torch.nn.functional import upsample
from modeling.model_utils.non_local_parts import *
from modeling.model_utils.unet_parts import *
import torch.nn.functional as F
from modeling.mod... | 35.606557 | 87 | 0.600829 |
fe2be5733ec19bedb612272c4ddd2f74e9c96193 | 3,747 | py | Python | mobile/tools/python/misc/ios-test-server.py | jameswu2014/Paddle-Lite | 827e349ac8eb769a873fe9b3aa961af8b8b20a96 | [
"Apache-2.0"
] | 3 | 2018-08-01T09:45:48.000Z | 2021-01-06T14:55:10.000Z | mobile/tools/python/misc/ios-test-server.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | null | null | null | mobile/tools/python/misc/ios-test-server.py | tao8687/Paddle-Lite | ebc0e39c7e8c09ad2d1b6a2923a420b2c1727635 | [
"Apache-2.0"
] | 5 | 2020-10-13T09:30:16.000Z | 2021-06-08T02:46:17.000Z | # -*- coding: utf-8 -*
import os
import sys
import math
import qrcode
import subprocess
import numpy as np
import paddle.fluid as fluid
from flask import Flask, request, send_from_directory, jsonify, make_response
# sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
# from fluidtools import run
from fluidt... | 29.503937 | 107 | 0.63811 |
fe95253724d2d4330a13d183bbeba5bee3e59a9a | 2,919 | py | Python | tictactoe.py | wukids/sandbox | 8df917785ea866cd362f95fe444378cf82979328 | [
"Unlicense"
] | 1 | 2017-03-20T08:06:22.000Z | 2017-03-20T08:06:22.000Z | tictactoe.py | wukids/sandbox | 8df917785ea866cd362f95fe444378cf82979328 | [
"Unlicense"
] | null | null | null | tictactoe.py | wukids/sandbox | 8df917785ea866cd362f95fe444378cf82979328 | [
"Unlicense"
] | null | null | null | def displayBoard(board):
print(" ", end="")
print(getFieldValue(board[1]), end="")
print("|", end="")
print(getFieldValue(board[2]), end="")
print("|", end="")
print(getFieldValue(board[3]))
print(" ", end="")
print("-", end="")
print("+", end="")
print("-", end="")
print("+... | 26.0625 | 70 | 0.475163 |
229de478b0313177c89aab75ec7588d630bd1f7e | 784 | py | Python | python/en/_packages/mecab/src/test-mecab4gingatetsudouno_yoru.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/mecab/src/test-mecab4gingatetsudouno_yoru.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/mecab/src/test-mecab4gingatetsudouno_yoru.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# -*- coding: utf-8 -*-
'''
packages/mecab/src/test-mecab4gingatetsudouno_yoru.py
* Draft: 2019-12-18(Wed)
* Base code: packages/mecab/src/mecab_basic_usage.py
* Prerequisite
* Install Python Package MeCab
* Usage:
$ python test-mecab4gingatetsudouno_yoru.py
python python python 名詞-固有名詞-組織
が ガ ... | 21.189189 | 57 | 0.678571 |
4318d7e651d7b484595e10907e60adefe1d69f97 | 439 | py | Python | venv/Lib/site-packages/pynance/learn/__init__.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 35 | 2015-03-12T04:16:14.000Z | 2020-12-17T18:10:15.000Z | venv/Lib/site-packages/pynance/learn/__init__.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 31 | 2015-03-16T21:31:04.000Z | 2021-01-26T00:12:34.000Z | venv/Lib/site-packages/pynance/learn/__init__.py | LeonardoHMS/imobi | 6b2b97a05df67ea7d493f7b601382f65c6629cc2 | [
"MIT"
] | 18 | 2015-09-30T10:40:26.000Z | 2021-01-25T21:20:44.000Z | """
.. Copyright (c) 2015, 2016 Marshall Farrier
license http://opensource.org/licenses/MIT
Machine learning (:mod:`pynance.learn`)
=======================================
.. currentmodule:: pynance.learn
:mod:`pynance.learn.linreg`
:mod:`pynance.learn.metrics`
"""
from __future__ import division, absolute_impo... | 19.954545 | 64 | 0.667426 |
4a3d967b2a80717a08e5016de74efda9f6b25c72 | 307 | py | Python | nz_django/day2/db_demo2_curd/book/migrations/0002_auto_20200219_1805.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day2/db_demo2_curd/book/migrations/0002_auto_20200219_1805.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_demo2_curd/book/migrations/0002_auto_20200219_1805.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | # Generated by Django 2.0 on 2020-02-19 10:05
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('book', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='book',
options={},
),
]
| 17.055556 | 45 | 0.566775 |
437395e63f1322facebd9ce15cea96d4e4e363f3 | 403 | py | Python | 0-notes/job-search/Cracking the Coding Interview/C06MathLogicPuzzles/python/6.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C06MathLogicPuzzles/python/6.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 0-notes/job-search/Cracking the Coding Interview/C06MathLogicPuzzles/python/6.3-question.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # 6.3 Dominos
# There is an 8x8 chessboard in which two diagonally opposite corners have been cut off.
# You are given 31 dominos and a single domino can cover exactly 2 squares.
# Can you use the 31 dominos to cover the entire board?
# Prove your answer by providing an example or showing why it's impossible.
# Impos... | 50.375 | 90 | 0.776675 |
43d7288200911fa1d7eb9c8b6e83f99ff182d8fd | 1,675 | py | Python | explore.py | amir1m/dga-detection | 001df4e352a99d345ca3b928d5e946e3b5499829 | [
"MIT"
] | null | null | null | explore.py | amir1m/dga-detection | 001df4e352a99d345ca3b928d5e946e3b5499829 | [
"MIT"
] | null | null | null | explore.py | amir1m/dga-detection | 001df4e352a99d345ca3b928d5e946e3b5499829 | [
"MIT"
] | null | null | null | import pandas as pd
dataset_all = pd.read_csv('data/dataset_all.csv')
dataset_all.head()
dataset_all['class'].value_counts()
matsnu = dataset_all.loc[dataset_all['class'] == 'matsnu']
matsnu.head()
m = matsnu['domain']
m = m.reset_index().drop(['index'], axis=1)
m.columns = ['host']
ramdo = dataset_all.loc[datas... | 20.679012 | 77 | 0.747463 |
609ef23fa2b225afb1afcf31a0077108256ef688 | 742 | py | Python | euler-14.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-14.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | euler-14.py | TFabijo/euler | 58dc07b9adb236890556ccd5d75ca9dbd2b50df9 | [
"MIT"
] | null | null | null | def najdalše_colatzovo_zaporedje_do_n(n):
krajse_poti = set()
dolzina_najdalsega = 1
st_najdalšega = 1
for x in range(2,n+1):
st_clenov = 0
clen = x
if x in krajse_poti:
continue
while clen != 1:
if clen % 2 == 0:
clen //... | 25.586207 | 43 | 0.483827 |
60cbb33b80b792fdb513360d805ca0ad47537627 | 691 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/revert_manufacturers_table_from_item.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/v8_0/revert_manufacturers_table_from_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/revert_manufacturers_table_from_item.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists("DocType", "Item Manufacturer"):
frappe.reload_doctype("Item")
item_manufacturers = frappe.db.... | 31.409091 | 71 | 0.729378 |
71dd90283cd5ba245a59519a6bdbb0010ca15ea2 | 11,607 | py | Python | repo/script.module.urlresolver/lib/urlresolver/__init__.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.module.urlresolver/lib/urlresolver/__init__.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.module.urlresolver/lib/urlresolver/__init__.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | """
URLResolver Addon for Kodi
Copyright (C) 2016 t0mm0, tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | 36.046584 | 180 | 0.648574 |
1ce88f5540a61de2aa84bce3b805dc6fcffff14f | 5,234 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/alternatives.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/alternatives.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/alternatives.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
# Copyright: (c) 2015, David Wittman <dwittman@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
_... | 31.721212 | 125 | 0.617692 |
1c053eb59061bef5bf05e9b25ee95e9737665173 | 2,637 | py | Python | Grundgeruest/forms.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-07-24T10:19:36.000Z | 2017-07-24T10:19:36.000Z | Grundgeruest/forms.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 9 | 2017-07-26T14:16:08.000Z | 2022-03-11T23:14:40.000Z | Grundgeruest/forms.py | wmles/scholarium.at | d2356b3e475df772382e035ddcb839fc7dae4305 | [
"MIT"
] | 1 | 2017-03-07T12:38:23.000Z | 2017-03-07T12:38:23.000Z | from django import forms
from userena.forms import SignupForm
from django.contrib.auth import get_user_model
from .models import ScholariumProfile#, MeinUserenaSignup
from userena.models import UserenaSignup # das ist Absicht, dass das und Mein~ importiert wird
from userena.models import UserenaSignup as MeinUserenaSig... | 35.16 | 115 | 0.67463 |
98ee1a13cad311c11c0cac8634168ef350d86d90 | 42 | py | Python | src/resultate/live_uploader/uploader/__init__.py | N3XT191/olz-website | c5bf80c148fa681b68cef91df9e41a1b105fea3e | [
"MIT"
] | 1 | 2020-02-02T15:00:39.000Z | 2020-02-02T15:00:39.000Z | src/resultate/live_uploader/uploader/__init__.py | N3XT191/olz-website | c5bf80c148fa681b68cef91df9e41a1b105fea3e | [
"MIT"
] | 101 | 2020-02-07T16:16:19.000Z | 2022-03-30T07:18:40.000Z | src/resultate/live_uploader/uploader/__init__.py | N3XT191/olz-website | c5bf80c148fa681b68cef91df9e41a1b105fea3e | [
"MIT"
] | 2 | 2020-08-14T20:06:05.000Z | 2021-04-13T16:31:56.000Z | from . import updater, webui # noqa:F401
| 21 | 41 | 0.714286 |
98f3d961cdec4f539a4b1283e09dc219dc1ea56c | 1,669 | py | Python | Python/Searching/2/binary_search_matrix.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 5 | 2017-08-03T06:33:49.000Z | 2021-08-06T13:20:57.000Z | Python/Searching/2/binary_search_matrix.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | null | null | null | Python/Searching/2/binary_search_matrix.py | Tikam02/Data_Structure_Algorithms | 7c17f744975a72fa42f0f3f892c0b7e041cdef0c | [
"MIT"
] | 6 | 2017-04-27T13:30:49.000Z | 2020-11-01T20:28:55.000Z | #!/usr/bin/env python
__author__ = "bt3"
def binary_search_matrix_rec(m, key, lo=0, hi=None):
'''
>>> m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
>>> binary_search_matrix_rec(m, 6)
(1, 2)
>>> binary_search_matrix_rec(m, 12)
'''
if not m:
return None
rows = len(m)
cols = len(m[0... | 17.946237 | 62 | 0.455362 |
c7e3eed9e02a0adf4a55ab4b0ff4a10a565a66f9 | 2,236 | py | Python | official/cv/deeptext/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/deeptext/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/deeptext/export.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... | 34.4 | 109 | 0.737925 |
c7eb80f45915880a191513fe3e9d97944083284b | 14,068 | py | Python | verto/VertoExtension.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/VertoExtension.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/VertoExtension.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from markdown.extensions import Extension
import markdown.util as utils
from verto.processors.CommentPreprocessor import CommentPreprocessor
from verto.processors.BlockquoteBlockProcessor import BlockquoteBlockProcessor
from verto.processors.VideoBlockProcessor import VideoBlockProcessor
from verto.processors.ImageInl... | 47.050167 | 115 | 0.683679 |
4038119153db6c8974a718ed3e509a75d64fa1f8 | 650 | py | Python | test/unit/tca_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | test/unit/tca_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | test/unit/tca_test.py | hdkai/Raw-IO | f0fa928d7ef59a363c6f4c876d642af6dede6ae4 | [
"Apache-2.0"
] | null | null | null | #
# RawIO
# Copyright (c) 2021 Yusuf Olokoba.
#
from PIL import Image
from pytest import fixture, mark
from torchvision.transforms.functional import to_tensor, to_pil_image
from rawio.lens import tca_model, tca_grid, tca_correction
IMAGE_PATHS = [
"test/media/tca/1.jpg",
"test/media/tca/2.jpg",
]
@mark... | 27.083333 | 69 | 0.726154 |
40f974506d1359766ef2464465fca25ed7bf4a82 | 1,557 | py | Python | loesung/blatt1b_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | 1 | 2019-09-27T13:47:20.000Z | 2019-09-27T13:47:20.000Z | loesung/blatt1b_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | loesung/blatt1b_2.py | dotKuro/vorsemesterWISE19-20 | 436c6d1846b6c1bfb087652e8ca179bd1b12c28e | [
"CC0-1.0"
] | null | null | null | # In dieser Aufgabe wurde ein Zahlentrick beschrieben, in dem sich der gegenber
# eine einstellige Zahl aus denken soll. Dann soll die Person einige Rechnungen
# mit dier Zahl ausführen. Am Ende dieser Rechnungen soll die Zahl immer 5 sein.
# Hier soll ein Programm geschrieben werden, dass eine einstellige Zahl vom Use... | 44.485714 | 80 | 0.752087 |
908fa30ccde0e20cea3556c2dee7182dfd706bad | 550 | py | Python | pacman-arch/test/pacman/tests/upgrade056.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade056.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/upgrade056.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Upgrade a package that removes a provide but another package still provides it"
lp1 = pmpkg("pkg1")
lp1.depends = ["imaginary"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2")
lp2.provides = ["imaginary"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3")
lp3.provides = ["imaginary"]
self.addpkg2d... | 22.916667 | 99 | 0.7 |
294902855be6aa91566b8b04f560b38c31445374 | 340 | py | Python | exercises/ja/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/ja/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/ja/test_04_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert 'spacy.blank("ja")' in __solution__, "空の日本語モデルを作成しましたか?"
assert (
len(nlp.pipe_names) == 1 and nlp.pipe_names[0] == "ner"
), "固有表現抽出器をパイプラインに追加しましたか?"
assert len(ner.labels) == 1 and ner.labels[0] == "GADGET", "固有表現抽出器にラベルを追加しましたか?"
__msg__.good("Well done!パイプラインの準備が完了たので... | 37.777778 | 85 | 0.664706 |
4649206ecf7eecd1cca73110a9150a809236d1d5 | 95 | py | Python | kts/feature_selection/__init__.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/feature_selection/__init__.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/feature_selection/__init__.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | from kts.feature_selection.importance_estimators import Builtin, Permutation, PermutationBlind
| 47.5 | 94 | 0.894737 |
3136384bc6f13f92a572315e17f2c0e943e7c957 | 1,335 | py | Python | python_gui_tkinter/Tkinter/TkinterCourse/1_tk_label.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python_gui_tkinter/Tkinter/TkinterCourse/1_tk_label.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python_gui_tkinter/Tkinter/TkinterCourse/1_tk_label.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
A Label is a Tkinter Widget class, which is used to display text or an image. The label is a widget that the user just views but not interact with.
'''
import tkinter as tk
#The tkinter module, containing the Tk toolkit, has always to be imported. In our example, we imported tkinter by renaming it into tk, which... | 49.444444 | 255 | 0.753558 |
317babf4e6b75b2f26067fa5c4d23b4920364934 | 856 | py | Python | tools/pythonpkg/tests/fast/arrow/test_arrow_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/fast/arrow/test_arrow_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/fast/arrow/test_arrow_types.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
try:
import pyarrow as pa
import pyarrow.dataset as ds
can_run = True
except:
can_run = False
class TestArrowTypes(object):
def test_null_type(self, duckdb_cursor):
if not can_run:
return
schema = pa.schema([("data", pa.null())])
inputs = [pa.ar... | 31.703704 | 65 | 0.626168 |
9ef4ab32a81a54a517f20b2783a3d85ef4c6de4f | 1,503 | py | Python | tests/jit/jit_filterbanks_test.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2021-02-22T21:55:40.000Z | 2021-02-22T21:55:40.000Z | tests/jit/jit_filterbanks_test.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | null | null | null | tests/jit/jit_filterbanks_test.py | groadabike/asteroid | 276d98346ab791d904fbfe79b9b8e374392dd128 | [
"MIT"
] | 1 | 2021-04-29T01:52:37.000Z | 2021-04-29T01:52:37.000Z | import torch
import pytest
from torch.testing import assert_allclose
from asteroid.filterbanks import make_enc_dec
from asteroid.models.base_models import BaseEncoderMaskerDecoder
@pytest.mark.parametrize(
"filter_bank_name",
("free", "stft", "analytic_free", "param_sinc"),
)
@pytest.mark.parametrize(
"in... | 29.470588 | 93 | 0.618762 |
7333c7cd4803b0569c47b55f624fb8e4d693b8ae | 1,829 | py | Python | tradingbot/core/color.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 3 | 2018-05-10T13:51:42.000Z | 2020-07-05T16:43:45.000Z | tradingbot/core/color.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | null | null | null | tradingbot/core/color.py | stefaniuk/trading-bot | 403abd2b53caf686a6d2456e7eab124c670e7340 | [
"MIT"
] | 1 | 2020-04-22T09:06:17.000Z | 2020-04-22T09:06:17.000Z | '''
Module that contains all ANSCII escape colors.
'''
# CONSTANTS
CYAN = '\033[96m'
PURPLE = '\033[95m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
WHITE = '\033[0m'
MAGENTA = '\033[35m'
BOLD = '\033[01m'
UNDERLINE = '\033[04m'
# COLOR FUNCTIONS
def bold(str):
return BOLD + str + ... | 18.85567 | 78 | 0.56643 |
5ef4bdc0897260c30996f818337bb334ff866f99 | 3,550 | py | Python | YOLO_data_dataset.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | YOLO_data_dataset.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | YOLO_data_dataset.py | bian0505/Pad_Me | c05b899b85a99d982948741e9da10e0a72d054d8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 29 11:10:23 2019
@author: bian
"""
import os,torch,cv2
import matplotlib.image as mpimg
import numpy as np
import torch.utils.data.dataloader as DataLoader
class DealDataset():
"""
下载数据、初始化数据,都可以在这里完成
"""
def __init__(self):
... | 35.5 | 154 | 0.562817 |
82c5107d4c272a401eca0d5e5cbc227ddd3c59a2 | 3,772 | py | Python | api/encrypt.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | api/encrypt.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | api/encrypt.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | import os
import io
import hashlib
import binascii
import base64
import logging
import urllib.parse
from Crypto.Cipher import AES
# Shared secret.
querystring_key = os.environ['querystring_key'] if 'querystring_key' in os.environ else None
def hash_password(key, key_size):
hash_object = hashlib.sha1(key.encode('utf... | 31.173554 | 104 | 0.684783 |
7de030fbeee74d751e4cee493ebe89cdcedaae1c | 2,031 | py | Python | polynomial.py | michal-choinski/sequential_moral_dilemmas | c6364672b996f04e4c791e20fd8b96eb5cf15b91 | [
"MIT"
] | 1 | 2021-04-21T10:08:10.000Z | 2021-04-21T10:08:10.000Z | polynomial.py | michal-choinski/sequential_moral_dilemmas | c6364672b996f04e4c791e20fd8b96eb5cf15b91 | [
"MIT"
] | null | null | null | polynomial.py | michal-choinski/sequential_moral_dilemmas | c6364672b996f04e4c791e20fd8b96eb5cf15b91 | [
"MIT"
] | null | null | null | from typing import Union
import numpy as np
from ray.rllib.utils.annotations import override
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.utils.schedules.schedule import Schedule
from ray.rllib.utils.typing import TensorType
tf1, tf, tfv = try_import_tf()
torch, _ = try_import_... | 36.267857 | 79 | 0.624815 |
487b7ce7f55dd33b64ed5c0077cd8d417b7238c3 | 63,116 | py | Python | tests/test_ebnf.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | tests/test_ebnf.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | tests/test_ebnf.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""test_ebnf.py - tests of the ebnf module of DHParser
Author: Eckhart Arnold <arnold@badw.de>
Copyright 2017 Bavarian Academy of Sciences and Humanities
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complian... | 36.169628 | 116 | 0.542826 |
6ff3a114670f826fc167c9b7802dbb5f20f629ea | 1,684 | py | Python | fence/resources/openid/cilogon_oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/resources/openid/cilogon_oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/resources/openid/cilogon_oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | from .idp_oauth2 import Oauth2ClientBase
class CilogonOauth2Client(Oauth2ClientBase):
"""
client for interacting with CILogon OIDC
"""
CILOGON_DISCOVERY_URL = "https://cilogon.org/.well-known/openid-configuration"
def __init__(self, settings, logger, HTTP_PROXY=None):
super(CilogonOauth2... | 32.384615 | 86 | 0.596793 |
d2170d5ebdf4da5356110c4da07283953fc89f50 | 3,977 | py | Python | src/lecture4/bp_network/utils.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 1 | 2020-08-17T07:09:09.000Z | 2020-08-17T07:09:09.000Z | src/lecture4/bp_network/utils.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | null | null | null | src/lecture4/bp_network/utils.py | Fassial/zju-intern | f421f9c97d3c567e9b97121c5bf5c675c9e2c721 | [
"MIT"
] | 2 | 2020-07-26T07:27:57.000Z | 2020-08-17T07:09:15.000Z | import os
import gzip
import pickle
import numpy as np
from PIL import Image
def sigmoid(x):
"""The logistic sigmoid function"""
return 1 / (1 + np.exp(-x))
def softmax(x, dim = -1):
"""The logistic softmax function"""
# center data to avoid overflow
e_x = np.exp(x - np.max(x, axis=dim, keepdims=T... | 32.333333 | 78 | 0.627609 |
83a56c6d0f41bf9efe91ee2f99440ff3eb4e9cfb | 1,325 | py | Python | 05-TSP/tsp.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | 2 | 2017-11-13T02:51:28.000Z | 2017-11-15T02:42:23.000Z | 05-TSP/tsp.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | null | null | null | 05-TSP/tsp.py | explodingnuggets/Grafos-UFSCar | d149157a9f7ecfd2f519cc52e1bdfcb910c2ffad | [
"MIT"
] | 1 | 2017-11-13T02:51:32.000Z | 2017-11-13T02:51:32.000Z | import numpy as np
import networkx as nx
import random
def twicearound(graph, source=0):
# Make MST from original Graph
mst = nx.minimum_spanning_tree(graph)
# Only MultiGraphs can have parallel edges
mst_multi = nx.MultiGraph(mst)
# Double the edges in the MST
multi_copy = mst_multi.copy()
for u,v in mul... | 22.844828 | 63 | 0.679245 |
f7badff7f81de56f68ec4651eb3f4366536841c8 | 4,218 | py | Python | official/cv/ctpn/src/eval_callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/ctpn/src/eval_callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/ctpn/src/eval_callback.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.351648 | 114 | 0.617591 |
54b9091047281018eff17bedd136e560fc3c2cbd | 2,220 | py | Python | src/server/bo/Transaction.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/bo/Transaction.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | src/server/bo/Transaction.py | ralfstefanbender/Studifix2 | 281c0a89ce56796437fe054068058c0f01a7df02 | [
"RSA-MD"
] | null | null | null | from server.bo import BusinessObject as bo
class Transaction (bo.BusinessObject):
"""Realisierung einer exemplarischen Buchung.
Eine Buchung zeichnet sich dadurch aus, dass sie ein Quellkonto und
ein Zielkonto besitzt, zwischen denen ein Betrag, der als Geld
interopretiert wird, umgebucht wird.
"... | 38.275862 | 107 | 0.678378 |
49ddfa9cbdbca9452c98b4c1e46e911fbe17a38e | 692 | py | Python | pyhokchew/parser.py | MindongLab/PyHokchew | 7d742ab5547d2da8c214bd1ebd80f9b6f963965d | [
"MIT"
] | 3 | 2018-04-05T12:04:08.000Z | 2020-04-30T14:00:58.000Z | python/pyhokchew/parser.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 6 | 2020-04-25T05:20:04.000Z | 2021-08-30T09:08:50.000Z | python/pyhokchew/parser.py | MindongLab/libhokchew | 7e5b2e11377ec57bf9a5bb8bb66be6d99237640c | [
"MIT"
] | 1 | 2018-04-05T11:52:07.000Z | 2018-04-05T11:52:07.000Z | from .models.CikLinSyllable import CikLinSyllable
from .models.FoochowRomanized import FoochowRomanizedSyllable
def parse_ciklin(fanqie, tone):
return CikLinSyllable.from_ciklin_string(fanqie, tone)
def parse_foochow_romanized_phrase(phrase, allow_omit_ingbing = True):
"""Parse a dash-separated phrase / word ... | 36.421053 | 87 | 0.721098 |
4d7045bb64ac0848c34f55b5c7e7026016efeb86 | 2,908 | py | Python | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/lib/event.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/lib/event.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/05-loraLink/src/old/V12/lib/event.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | #!/usr/bin/env python3
# lib/feed.py
# Jan 2020 <christian.tschudin@unibas.ch>
''' event data structure (="log entry")
+-event------------------------------------------------------------------+
| +-meta---------------------------------------+ |
| | feed_id, seq_no, h_prev, sign_info, h_c... | 31.268817 | 80 | 0.496905 |
4d7129144be9b2bc94d739f9c75d9fe1899228ff | 1,482 | py | Python | src/main/apps/authentication/token.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | 2 | 2021-08-23T21:56:07.000Z | 2022-01-20T13:52:19.000Z | src/main/apps/authentication/token.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | src/main/apps/authentication/token.py | Nouvellie/django-tflite | 1d08fdc8a2ec58886d7d2b8d40e7b3598613caca | [
"MIT"
] | null | null | null | from .models import User
from datetime import (
datetime,
timedelta,
timezone,
)
from rest_framework.authtoken.models import Token
from typing import Dict
def check_token(user: User) -> Token:
"""This function verifies the token, its validity and expiration."""
token_status = {}
token_status['... | 34.465116 | 85 | 0.659919 |
12fcbfdef28512a5f23126ad3e7cfc6fbc894e85 | 2,533 | py | Python | src/pfun/protocols.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | src/pfun/protocols.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | src/pfun/protocols.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | from typing import TypeVar
from typing_extensions import Protocol
A = TypeVar('A', contravariant=True)
B = TypeVar('B', covariant=True)
class SupportsCall(Protocol[A, B]):
def __call__(self, a: A) -> B:
pass
class SupportsLt(Protocol[A, B]):
def __lt__(self, other: A) -> B:
pass
class Su... | 17.231293 | 44 | 0.601263 |
c41c0325a1397417573d054b0615319c79238e24 | 1,058 | py | Python | hypercut/urlcut/hash.py | UnoYakshi/HyperCut | dc1dc2ad4383b69d2833e94f205959e5fe079971 | [
"MIT"
] | null | null | null | hypercut/urlcut/hash.py | UnoYakshi/HyperCut | dc1dc2ad4383b69d2833e94f205959e5fe079971 | [
"MIT"
] | 5 | 2021-03-30T13:49:59.000Z | 2021-09-22T19:19:10.000Z | hypercut/urlcut/hash.py | UnoYakshi/HyperCut | dc1dc2ad4383b69d2833e94f205959e5fe079971 | [
"MIT"
] | null | null | null | """
This module handles all the hash-related functionality such as:
- encoding an integer to a short hash (with salt)
- decoding it back (with salt)
"""
from typing import Optional
import hashids
# IMPORTANT: read it from environment variables instead!..
DEFAULT_SALT = 'This is my horse, my horse is amazing!'
def... | 30.228571 | 94 | 0.718336 |
c47626f70d95c452df5252693d26324e8ab5de42 | 40 | py | Python | mumath/config.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/config.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | mumath/config.py | fourpoints/mumath | f1c36c4a5b3c32a3e7f8e7a922eafea8b7a14fd4 | [
"MIT"
] | null | null | null | __version__ = "1.2.0"
__author__ = "::"
| 13.333333 | 21 | 0.6 |
c488df1a1d182cc068cde460faec635d5ff30a23 | 1,175 | py | Python | src/onegov/org/forms/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/forms/userprofile.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.org import _
from wtforms import BooleanField
class UserProfileForm(Form):
""" Defines the settings form for user profiles. """
daily_ticket_statistics = BooleanField(
label=_("Send a daily status e-mail."),
fieldset=_("General")
)
@property
... | 30.128205 | 72 | 0.661277 |
67ef2778f9d9f6d6a00abf66e5bb200b76d1cfbc | 2,399 | py | Python | python/en/archive/dropbox/miscellaneous_python_files/data4models_old.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/data4models_old.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/dropbox/miscellaneous_python_files/data4models_old.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
data4models.py
# Sentiment Indentification for Roman Urdu
'''
import numpy as np
class Data:
# Constructor
def __init__( self, x, y, config ):
self.config = config
self.x = x # shape = (length, dimension)
self.y... | 36.348485 | 91 | 0.539391 |
22680ffab79812bee1ac98d4069bf31a7eea7dce | 9,117 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cloudscale_volume.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cloudscale_volume.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/cloudscale_volume.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# Copyright (c) 2019, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print... | 29.794118 | 117 | 0.623999 |
97deef0c7a273a9c7f20aa2c087427e9a401ebb0 | 5,273 | py | Python | slave/synth.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | 3 | 2018-01-20T18:59:11.000Z | 2021-04-09T11:17:27.000Z | slave/synth.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | null | null | null | slave/synth.py | dotlambda/metro-hd | 097359a45dc1e4f0802678e8ad4017e7d420e8fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from mido import MidiFile
F_CPU = 16000000.0 # in Hz
INTERRUPT_COMPARE = 128
INTERRUPT_PRESCALER = 8
INTERRUPT_FREQ = F_CPU / (INTERRUPT_PRESCALER * INTERRUPT_COMPARE) # in Hz
hfilename = "music.h"
cfilename = "music.c"
class Synth():
def __init__(self, hfile, cfile):
self.hfile ... | 42.184 | 111 | 0.490802 |
3f0fe7217723a6f90f278d4fbb7989227e8121ef | 63,479 | py | Python | resources/lib/ARDnew.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | resources/lib/ARDnew.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | resources/lib/ARDnew.py | rotdrop/Kodi-Addon-ARDundZDF | ceb7ab2b580eb68b7e3cd52318a7058f69518988 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
################################################################################
# ARDnew.py - Teil von Kodi-Addon-ARDundZDF
# neue Version der ARD Mediathek, Start Beta Sept. 2018
#
# dieses Modul nutzt die Webseiten der Mediathek ab https://www.ardmediathek.de/,
# Seiten werden im json-F... | 41.381356 | 144 | 0.64771 |
3f1dab2e7f558bd685cdd504efa897f5fe8e791f | 510 | py | Python | backend/app/initial_data.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/initial_data.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/initial_data.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from app.db.init_db import init_db
from app.db.session import SessionLocal
from app.utils.logger import logger
from app.utils.timer import Timer
def init() -> None:
"""
Initializes Database
"""
db = SessionLocal()
init_db(db)
def main() -> None:
logger.info("Creating initial d... | 19.615385 | 68 | 0.627451 |
e133ff72af1406a0401ac2a70e87ea0360da0635 | 334 | py | Python | deprecated/RasaNLU/src/rasaPredict.py | th-koeln-intia/ip-sprachassistent-team2 | b8f8a20011bc766b1937566ee5a8786ee32bb3c5 | [
"MIT"
] | 1 | 2020-12-09T23:14:19.000Z | 2020-12-09T23:14:19.000Z | deprecated/RasaNLU/src/rasaPredict.py | th-koeln-intia/ip-sprachassistent-team2 | b8f8a20011bc766b1937566ee5a8786ee32bb3c5 | [
"MIT"
] | 1 | 2020-09-30T08:58:14.000Z | 2020-10-14T13:55:14.000Z | deprecated/RasaNLU/src/rasaPredict.py | th-koeln-intia/ip-sprachassistent-team2 | b8f8a20011bc766b1937566ee5a8786ee32bb3c5 | [
"MIT"
] | 1 | 2020-09-17T17:04:11.000Z | 2020-09-17T17:04:11.000Z | from rasa_nlu.model import Interpreter
def predict(text="hi", model_dir="./models/default", project="default"):
interpreter = Interpreter.load(model_dir + "/" + project)
prediction = interpreter.parse(text)
print(prediction)
if __name__ == '__main__':
text = input()
predict(text=text, project="I... | 25.692308 | 72 | 0.697605 |
e1907858a0e432bc6b71c772d5601519c791a2b3 | 589 | py | Python | 1_BasicFeatures/MemoryManagment/global_and_local_namescope.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 1_BasicFeatures/MemoryManagment/global_and_local_namescope.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 1_BasicFeatures/MemoryManagment/global_and_local_namescope.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | # local wenn die Variable zu Funktion oder Klasse gehört
# global wenn Sie überall verwendbar ist
POWER_OF = 2 # große Variablennamen => Konstante
def function(a):
b = a ** POWER_OF # local scope
print(a, b)
value = 3 # global scope
function(value)
def function2():
print(value)
function2()
# global d... | 18.40625 | 69 | 0.65365 |
360e8ba37c7077bdcdb16ba4bb6595dddc32dded | 487 | py | Python | preprocessing/docker_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | preprocessing/docker_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | 2 | 2021-03-31T18:54:16.000Z | 2021-12-13T19:49:08.000Z | preprocessing/docker_cli.py | iecasszyjy/tweet_search-master | e4978521a39964c22ae46bf35d6ff17710e8e6c6 | [
"MIT"
] | null | null | null | sudo docker ps -aq
sudo docker restart $(sudo docker ps -aq)
sudo docker stop $(sudo docker ps -aq)
sudo docker rm -f $(sudo docker ps -aq)
sudo apt install htop
sudo reboot
sudo systemctl restart docker
sudo docker run -e CATTLE_HOST_LABELS='spider=worker' --rm --privileged -v /var/run/docker.sock:/var/run/docker... | 34.785714 | 277 | 0.770021 |
36a9771c9ccc89ba79cdb552fe03bdebd5f7f22d | 809 | py | Python | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/drilldown_from_database_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 30 | 2018-04-01T09:08:40.000Z | 2022-01-23T07:30:07.000Z | app/t1health_app/static/fusioncharts-suite-xt/integrations/django/samples/fusioncharts/samples/drilldown_from_database_example.py | siyaochen/Tier1Health | 536591a7534bbb3fb27fe889bfed9de152ec1864 | [
"MIT"
] | 14 | 2018-07-17T08:33:35.000Z | 2021-09-29T17:26:15.000Z | asset/integrations/django/samples/fusioncharts/samples/drilldown_from_database_example.py | Piusshungu/catherine-junior-school | 5356f4ff5a5c8383849d32e22a60d638c35b1a48 | [
"MIT"
] | 17 | 2016-05-19T13:16:34.000Z | 2021-04-30T14:38:42.000Z | from django.shortcuts import render
from django.http import HttpResponse
# Include the `fusioncharts.py` file that contains functions to embed the charts.
from ..fusioncharts import FusionCharts
from ..models import *
# The `chart` function is defined to load data from a `SalesRecord` Model.
# This data will be con... | 42.578947 | 96 | 0.756489 |
3d3ccbf4255eec333b9f465ed6e682ec491195fc | 718 | py | Python | utils/FileUtils.py | mase5/tazweb | 5db94020b9f27d7287eb1d59c58992cd2cf70821 | [
"MIT"
] | null | null | null | utils/FileUtils.py | mase5/tazweb | 5db94020b9f27d7287eb1d59c58992cd2cf70821 | [
"MIT"
] | null | null | null | utils/FileUtils.py | mase5/tazweb | 5db94020b9f27d7287eb1d59c58992cd2cf70821 | [
"MIT"
] | null | null | null | import csv
import os
def read_table(file, sep='\t', header=True):
with open(file, 'r') as f:
reader = csv.reader(f, delimiter='\t')
# https://www.kaggle.com/c/titanic/discussion/3224
if header:
headers = reader.__next__()
rows = []
for row in reader:
... | 24.758621 | 61 | 0.591922 |
3d4f80dd091984cc1aa9f19021d274d511550bc8 | 1,660 | py | Python | ALBERT/dataset/dataset.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/dataset.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | ALBERT/dataset/dataset.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 数据集
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/2/3
"""
import pandas as pd
from torch.utils.data import Dataset
from dataset.vocab.vocab import Vocab
class MyDataSet(Dataset):
def __init__(self, path, vocab, max_length):
""" 初始化
@param:
:path: 文件路径
:v... | 27.213115 | 80 | 0.530723 |
a17db8a031d14558249f6ce232aa8513158336fa | 2,837 | py | Python | paddlenlp/datasets/hyp.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/hyp.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | paddlenlp/datasets/hyp.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.844156 | 80 | 0.650335 |
a18a5bd4b84d0ccdc7e9113dfbc98f9c24d21030 | 3,944 | py | Python | scripts/check-log4j.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T22:29:44.000Z | 2022-01-28T22:29:44.000Z | scripts/check-log4j.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | null | null | null | scripts/check-log4j.py | evildrummer/1337-observer | 621eb16711d9f70a59fb5524fc990dcab1004b14 | [
"MIT"
] | 1 | 2022-01-28T21:10:41.000Z | 2022-01-28T21:10:41.000Z |
#!/usr/bin/python3
import requests
import uuid
import logging
import urllib3
import time
import argparse
import colorama
colorama.init(autoreset = True)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logging.basicConfig(level=logging.INFO)
# Change this to your DNS zone
HOSTNAME = "c8uqb291r1j0o... | 36.183486 | 214 | 0.650862 |
c551218ff297cc84a2229101605165b8229404ba | 597 | py | Python | setup.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | setup.py | bond90/sumo-rl | fc3551eb78e30853765fed9967f791bda1ff2e3d | [
"MIT"
] | null | null | null | setup.py | bond90/sumo-rl | fc3551eb78e30853765fed9967f791bda1ff2e3d | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
REQUIRED = ['tensorflow', 'gym', 'numpy', 'pandas', 'matplotlib', 'ray[rllib]']
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='sumo-rl',
version='0.4',
packages=['sumo_rl',],
install_requires=REQUIRED,
author='LucasAleg... | 29.85 | 121 | 0.695142 |
3df39edea6941e8c422dce53d2c2d106e5ec7d8f | 394 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/validate_v3_patch.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/v4_0/validate_v3_patch.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/validate_v3_patch.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
from frappe.modules.patch_handler import executed
last_v3_patch = 'patches.1401.fix_pos_outstanding'
if not executed(la... | 32.833333 | 68 | 0.796954 |
4923dfb2744354410c845db80424d3cef9b4d020 | 2,542 | py | Python | T1/09_mesh_subdivision/utilities.py | tetov/MAS-1920 | e5cfe4afbc7c0e80c6adfd139624d028c0ca4bfb | [
"MIT"
] | null | null | null | T1/09_mesh_subdivision/utilities.py | tetov/MAS-1920 | e5cfe4afbc7c0e80c6adfd139624d028c0ca4bfb | [
"MIT"
] | null | null | null | T1/09_mesh_subdivision/utilities.py | tetov/MAS-1920 | e5cfe4afbc7c0e80c6adfd139624d028c0ca4bfb | [
"MIT"
] | 1 | 2019-09-25T07:05:18.000Z | 2019-09-25T07:05:18.000Z | def draw_compas_mesh(mesh, color='white', size=1.0):
"""
Renders a compas mesh on a 3D canvas with ipyvolume.
Parameters
----------
mesh : :class: compas.datastructures.Mesh
the mesh to be shown in 3D
Returns
-------
an instance of ipyvolume.widgets.Mesh
"""
import ipyv... | 31.382716 | 81 | 0.603855 |
494124054692a44aa8cdee5499df471ef25afbd5 | 908 | py | Python | chapter_three/python_processes.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_three/python_processes.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_three/python_processes.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | import time
from multiprocessing import Pool
def recur_fibo(n: int) -> int:
if n <= 1:
return n
else:
return (recur_fibo(n-1) + recur_fibo(n-2))
if __name__ == '__main__':
start = time.time()
recur_fibo(n=8)
recur_fibo(n=12)
recur_fibo(n=12)
recur_fibo(n=20)
recur_fib... | 23.282051 | 94 | 0.537445 |
775c43f4c7b9c68b8e77fb8c1cc756de7cc932fc | 8,635 | py | Python | bawwab/session.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 2 | 2021-07-06T06:00:22.000Z | 2022-01-15T09:29:44.000Z | bawwab/session.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 11 | 2020-11-26T10:53:44.000Z | 2022-03-31T09:42:51.000Z | bawwab/session.py | leibniz-psychology/bawwab | 2e7129bf59b33c0ee22a960e7b2835888068fd1a | [
"MIT"
] | 1 | 2022-01-15T09:30:46.000Z | 2022-01-15T09:30:46.000Z | # Copyright 2019–2020 Leibniz Institute for Psychology
#
# 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 restriction, including without limitation the rights
# to use, copy, modify, ... | 30.512367 | 98 | 0.7348 |
62850309662a7fb26891dd5e172caddbf3fe0f3c | 1,227 | py | Python | tests/helpers/utils.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | tests/helpers/utils.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | tests/helpers/utils.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | ''' Various helper functions for testing '''
from datetime import datetime
import json
from benwaonline import entities
def test_user():
data = {
'id': '1',
"created_on": datetime.utcnow(),
"user_id": "666",
"username": "Beautiful Benwa Aficionado"
}
return entities.User(**d... | 22.309091 | 64 | 0.488998 |
65bebd54e5da1be2151d4ea77b16856e3d1e081e | 37,091 | py | Python | Contents/Code/Pod_content.py | typekitrel/abctestard | 1df43561327694ba155f513ad152aab51c56ef42 | [
"MIT"
] | null | null | null | Contents/Code/Pod_content.py | typekitrel/abctestard | 1df43561327694ba155f513ad152aab51c56ef42 | [
"MIT"
] | null | null | null | Contents/Code/Pod_content.py | typekitrel/abctestard | 1df43561327694ba155f513ad152aab51c56ef42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Pod_content.py - Aufruf durch __init__.py/PodFavoritenListe
#
# Die Funktionen dienen zur Auswertung von Podcasts außerhalb www.ardmediathek.de/radio
# Basis ist die Liste podcast-favorits.txt (Default/Muster im Ressourcenverzeichnis), die
# Liste enthält weitere Infos zum Format und zu ber... | 43.078978 | 117 | 0.648918 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.