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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47f4dce444b146afe25d1cd0712cc4f987d918a6 | 1,264 | py | Python | CRUD_Usuarios.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | CRUD_Usuarios.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | CRUD_Usuarios.py | ArielBM/Sesion9 | 6bf1835e6dc8187f45cd910ff4997dded180e96e | [
"Apache-2.0"
] | null | null | null | from Usuario import Usuario
import json
class CRUD_Usuario:
# CONSTRUCTOR
def __init__(self):
self.usuarios = []
self.contador = 0
# MÉTODO PARA CREAR USUARIOS
def crear(self, nombre, foto, nombre_usuario, contrasenia):
for usuario in self.usuarios:
if usuario.... | 23.849057 | 78 | 0.605222 |
d0987317d0b3b3518494cdbd0f87397e42c62dd7 | 323 | py | Python | modules/fstatic/staticFile.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | 3 | 2018-02-11T11:34:30.000Z | 2020-05-06T12:11:03.000Z | modules/fstatic/staticFile.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | null | null | null | modules/fstatic/staticFile.py | Bym24v/FAS | efbcf606c49dd591857e0e537bc5b9f082c13405 | [
"MIT"
] | null | null | null | from bottle import route, static_file
## Static dist css
@route('/static/js/<filename>')
def dist_css_static(filename):
return static_file(filename, root='./public/dist/js/')
## Static dist css
@route('/static/css/<filename>')
def dist_css_static(filename):
return static_file(filename, root='./public/dist/css... | 29.363636 | 59 | 0.73065 |
d0fb9d36aa482913dee9307aaa8cf27221e88ade | 3,350 | py | Python | src/bo4e/com/tarifeinschraenkung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/tarifeinschraenkung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/tarifeinschraenkung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Tarifeinschraenkung and corresponding marshmallow schema for de-/serialization
"""
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.com.geraet import Geraet, GeraetS... | 40.361446 | 193 | 0.708358 |
f5e035b6625773dd9cf707b5d770389ce8b478ca | 757 | py | Python | project/api/event_category/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 1 | 2021-06-01T14:49:18.000Z | 2021-06-01T14:49:18.000Z | project/api/event_category/resources.py | DanielGrams/gsevp | e94034f7b64de76f38754b56455e83092378261f | [
"MIT"
] | 286 | 2020-12-04T14:13:00.000Z | 2022-03-09T19:05:16.000Z | project/api/event_category/resources.py | DanielGrams/gsevpt | a92f71694388e227e65ed1b24446246ee688d00e | [
"MIT"
] | null | null | null | from flask_apispec import doc, marshal_with, use_kwargs
from project.api import add_api_resource
from project.api.event_category.schemas import (
EventCategoryListRequestSchema,
EventCategoryListResponseSchema,
)
from project.api.resources import BaseResource
from project.models import EventCategory
class Ev... | 31.541667 | 80 | 0.791281 |
deb6a60a23bfccb6c90b656979530b715a87b2a8 | 1,099 | py | Python | 624/fcat_624_greedy.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 624/fcat_624_greedy.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | 624/fcat_624_greedy.py | Leetcode-Secret-Society/warehouse | 40d7969683b1296f361e799cda37f15ceec52af8 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def maxDistance(self, arrays: List[List[int]]) -> int:
largest = [(float('-inf'), -1), (float('-inf'), -1)]
smallest = [(float('inf'), -1), (float('inf'), -1)]
for array_index in range(len(arrays)):
if arrays[array_index][-1] > largest[0][... | 43.96 | 86 | 0.531392 |
dfc05b2a2e034d1f00424db782440355c441e584 | 1,337 | py | Python | nz_django/day8/user_demo2/user_demo2/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day8/user_demo2/user_demo2/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day8/user_demo2/user_demo2/urls.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | """user_demo2 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 39.323529 | 83 | 0.70531 |
dfc805322caa68e6321b22428b1f813c9e059784 | 7,181 | py | Python | app.py | rd-hackathon/geschenkfinder | c807905189beb34359cb6cbe508e8df38b042369 | [
"MIT"
] | 1 | 2021-03-14T12:43:51.000Z | 2021-03-14T12:43:51.000Z | app.py | rd-hackathon/geschenkfinder | c807905189beb34359cb6cbe508e8df38b042369 | [
"MIT"
] | null | null | null | app.py | rd-hackathon/geschenkfinder | c807905189beb34359cb6cbe508e8df38b042369 | [
"MIT"
] | null | null | null | import json
import os
import sqlite3
import sys
from flask import Flask, request, render_template, redirect, url_for, g
from uuid import uuid4
from werkzeug.utils import secure_filename
from parsers.google import parse_html, useable
app = Flask(__name__)
app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # wir ne... | 37.401042 | 207 | 0.60479 |
a0b7e6c1385a209bd177030629751debd6fd261c | 1,720 | py | Python | sentinel/server/server.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | 342 | 2017-08-21T20:12:56.000Z | 2022-03-19T17:58:25.000Z | sentinel/server/server.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | 57 | 2017-11-13T11:16:47.000Z | 2022-03-01T13:54:31.000Z | vpn-node-cosmos/sentinel/server/server.py | smtcrms/sentinel | ff65bc9200f6c940aa184c0ec0872fdcfef25363 | [
"MIT"
] | 72 | 2017-11-23T05:13:24.000Z | 2022-02-25T14:18:33.000Z | # coding=utf-8
import json
import falcon
import gunicorn.app.base
from gunicorn.six import iteritems
from .client import DisconnectClient
from .client import GetSessionUsage
from .session import AddSessionDetails
from .session import AddSessionPaymentSign
from .session import GetVpnCredentials
from ..utils import JSO... | 37.391304 | 111 | 0.692442 |
cd197368bb5df2b806bcbc95525bd6a942dcc1d7 | 833 | py | Python | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/filt.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/filt.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/scripts/large-evaluators/tempo-reference-implementation/filt.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import numpy
import scipy.signal
import pylab
#print "31"
#b, a = scipy.signal.butter(4, 31.0 / (344.53125/2.0))
#print b
#print a
#w, h = scipy.signal.freqz(b, a)
#h_db = 20*numpy.log10(abs(h))
#pylab.plot(w, h_db, label="exact Butterworth 31")
print "FIR, 15"
N = 15
#b = scipy.signal.firwin(... | 19.372093 | 54 | 0.578631 |
cd1c7fa020c180191116e69a38b6b8268de2ebbc | 3,222 | py | Python | marsyas-vamp/marsyas/src/marsyas_python/spectral_analysis.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/spectral_analysis.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | marsyas-vamp/marsyas/src/marsyas_python/spectral_analysis.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import marsyas
import marsyas_util
import time
import numpy
import cv
from cv_utils import *
import math
# This program will perform real-time spectral analysis.
# TODO: Put axis indicators in the plots!
#
# The basic functionality is as follows:
# Source -> Window -> Spectra -> ... | 36.202247 | 211 | 0.742086 |
f8015de487bf6da5133c25d0d68fd9422afd7cbf | 48 | py | Python | pymantic/__init__.py | dnswd/blazegraph-python | 046a6b47406b0f56d71abc6039f4d7586a1708d2 | [
"BSD-3-Clause"
] | 42 | 2016-01-15T14:31:48.000Z | 2022-03-10T14:32:25.000Z | pymantic/__init__.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 3 | 2016-10-02T18:36:42.000Z | 2019-09-18T15:48:58.000Z | pymantic/__init__.py | igor-kim/blazegraph-python | 7be8d219e00acb51d949bf49aaaed90c2c2344e5 | [
"BSD-3-Clause"
] | 11 | 2016-08-18T09:47:52.000Z | 2021-12-26T06:22:18.000Z | #
version = '0.1.1'
release = version + 'alpha'
| 12 | 27 | 0.604167 |
5f929157f91c4b2afd6e98d5993a011090589342 | 2,466 | py | Python | WiFiBroot-master/screen.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | WiFiBroot-master/screen.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | WiFiBroot-master/screen.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | from utils import tabulate
from scapy.utils import hexdump
import curses
import time
import string
import binascii
class Display:
shifter_break = False
Shifter_stopped = False
__WiFiAP = []
# Crackinig Variables
_count_ = 0
def __init__(self, verbosity):
self.screen = curses.initscr()
curses.noecho()
c... | 24.66 | 93 | 0.642336 |
f257b27ff12e9f8e77501dc36976e8d3047fdc78 | 2,994 | py | Python | src/onegov/gazette/models/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/models/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/models/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm.abstract import AdjacencyList
from onegov.core.orm.abstract import MoveDirection
from onegov.core.orm.mixins import ContentMixin
from onegov.core.orm.mixins import meta_property
from onegov.core.orm.mixins import TimestampMixin
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlal... | 30.865979 | 76 | 0.657983 |
4bba4a3f21ac576ce569c53d0ebb5ce7d3d617c6 | 2,941 | py | Python | blog/files/21/dns_server.py | HowcanoeWang/SigmaMeow | 89c7bcd6b505e565875cab66354b67ed0bbb1ee9 | [
"MIT"
] | null | null | null | blog/files/21/dns_server.py | HowcanoeWang/SigmaMeow | 89c7bcd6b505e565875cab66354b67ed0bbb1ee9 | [
"MIT"
] | 24 | 2019-08-20T14:04:34.000Z | 2022-01-27T01:24:46.000Z | blog/files/21/dns_server.py | HowcanoeWang/HowcanoeWang.github.io | 14a958253ccb6acd47f9d97a66f9b1eed1d7dad6 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import re
import sys
import socket
import traceback
from os.path import isfile
HOSTS_FILE = "hosts.txt"
SERVER_HOST = "0.0.0.0"
SERVER_PORT = 53
#ipv4_exp = re.compile(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}")
class DNSQuery:
def __init__(self, data):
self.data = data
self.domai... | 37.227848 | 151 | 0.530772 |
0a606f6fda25a1dd060e143ae31f27d4576f43c7 | 13,150 | py | Python | official/nlp/ernie/run_ernie_ner.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/nlp/ernie/run_ernie_ner.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/nlp/ernie/run_ernie_ner.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... | 58.705357 | 115 | 0.674905 |
7c3d90857a8f23c33a28d82461241a15181fa545 | 23,179 | py | Python | Packs/MicroFocusSMAX/Integrations/MicroFocusSMAX/MicroFocusSMAX.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicroFocusSMAX/Integrations/MicroFocusSMAX/MicroFocusSMAX.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicroFocusSMAX/Integrations/MicroFocusSMAX/MicroFocusSMAX.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CommonServerPython import *
import requests
import traceback
from typing import Dict, Any
requests.packages.urllib3.disable_warnings() # pylint: disable=no-member
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
''' CLIENT CLASS '''
class Client(BaseClient):
def __init__(self, base_url: str, toke... | 37.145833 | 116 | 0.674662 |
7c5317625e9de36383afc40e0332c51f5e817c9c | 302 | py | Python | erntehelfer/admin.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | erntehelfer/admin.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | erntehelfer/admin.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, CompanyProfile, CitizenProfile, LicenseClass
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register([
CompanyProfile,
CitizenProfile,
LicenseClass
])
| 23.230769 | 70 | 0.788079 |
7c9d8219754cc573e4d2c08c9306edc81b9fdb55 | 12,514 | py | Python | telegram_bot_api.py | Hofei90/telegram_api | 8e910e15d7147db4b3828fa6fd1cfe2f5d33c077 | [
"MIT"
] | null | null | null | telegram_bot_api.py | Hofei90/telegram_api | 8e910e15d7147db4b3828fa6fd1cfe2f5d33c077 | [
"MIT"
] | 4 | 2019-04-24T12:56:34.000Z | 2020-06-25T20:16:56.000Z | telegram_bot_api.py | Hofei90/telegram_api | 8e910e15d7147db4b3828fa6fd1cfe2f5d33c077 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Telegram Bot API
Modul als Schnittstelle zur Kommunikation mit Telegram Bot API
"""
import json
import requests
from os import path
API_URL = "https://api.telegram.org/bot"
class Bot:
def __init__(self, token):
self.token = token
self.botuser = None
self.result = N... | 39.853503 | 120 | 0.617389 |
d4c366750af09b00cbbac94bd7bab457d7faf048 | 2,783 | py | Python | tests/test_volume_add_tag.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-12T09:49:53.000Z | 2020-03-12T09:49:53.000Z | tests/test_volume_add_tag.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 1 | 2020-03-25T00:47:12.000Z | 2020-03-30T23:32:00.000Z | tests/test_volume_add_tag.py | cloudmesh/cloudmesh-volume | a7502d077f2fb7c6b1b7986da9595a36591b06cd | [
"Apache-2.0"
] | 5 | 2020-02-20T01:04:24.000Z | 2020-05-05T14:36:30.000Z | ###############################################################
# pytest -v --capture=no tests/test_volume_add_tag.py
###############################################################
import os
from time import sleep
import pytest
from cloudmesh.common.Benchmark import Benchmark
from cloudmesh.common.debug import VERBO... | 31.269663 | 76 | 0.564499 |
be0b385a0e958fbc4473fd48e12aa98d09be3e4d | 1,208 | py | Python | google_places_popularity/scraper.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 29 | 2020-03-21T00:47:51.000Z | 2021-07-17T15:50:33.000Z | google_places_popularity/scraper.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 7 | 2020-03-21T14:04:26.000Z | 2022-03-02T08:05:40.000Z | google_places_popularity/scraper.py | cfleschhut/virushack | 2fe7ded0be8672b066edef7fed52573794db2ba5 | [
"Apache-2.0"
] | 13 | 2020-03-21T01:08:08.000Z | 2020-04-08T17:21:11.000Z | import boto3
import json
import populartimes
from datetime import datetime
import time
import os
import pandas as pd
s3_client = boto3.client('s3')
response = s3_client.get_object(Bucket="sdd-s3-basebucket", Key="codebuild-googleplaces/places")
api_key = response["Body"].read().decode("utf-8")
date = datetime.now()
... | 30.2 | 152 | 0.684603 |
ed42dbf53c38eedf64ce3123feac9b1794b1b85e | 339 | py | Python | Algorithms/Implementation/subarray_division.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/subarray_division.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/subarray_division.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/the-birthday-bar/problem?h_r=internal-search
def birthday(s, d, m):
sub = [s[i:m+i] for i, j in enumerate(s)]
arr = list(map(lambda x: sum(x) == d, sub))
print(s)
print(sub)
print(arr)
return arr.count(True)
array = [4]
day = 4
month = 1
print(birthday(a... | 22.6 | 84 | 0.631268 |
ed8378738fcd82d6a728c95ad75b9be86e9c1533 | 522 | py | Python | Shellcoding/makefile.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 4 | 2021-04-23T15:39:17.000Z | 2021-12-27T22:53:24.000Z | Shellcoding/makefile.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | null | null | null | Shellcoding/makefile.py | Unam3dd/Train-2018-2020 | afb6ae70fe338cbe55a21b74648d91996b818fa2 | [
"MIT"
] | 2 | 2021-04-19T08:28:54.000Z | 2022-01-19T13:23:29.000Z | import binascii
import sys
import re
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage %s shellcode outfile" % sys.argv[0])
sys.exit(0)
try:
data = open("loader32.c", "r").read()
shellcode = binascii.b2a_hex(open(sys.argv[1], "rb").read()).decode()
except:
print("Error reading file")
sy... | 21.75 | 71 | 0.626437 |
1337f12e299b0f48bc6539955e67f1cb15007a77 | 3,293 | py | Python | preprocessing/text_extraction.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null | preprocessing/text_extraction.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null | preprocessing/text_extraction.py | dainst/chronoi-corpus-processing | 7f508a7572e1022c4c88d1477db029e6619a1f0c | [
"MIT"
] | null | null | null |
import subprocess
import bs4
from enum import Enum
import os
import shutil
class TextExtractionStrategyInterface:
def extract(self, input_path: str, output_path: str):
raise NotImplementedError()
# Ghostscript is good at outputting a pdf in a text form like it would appear
# when rendered, the whites... | 32.60396 | 84 | 0.694807 |
b9f68be79437bb46ddc8ef1368c8c3b506000104 | 8,198 | py | Python | tools/pythonpkg/tests/slow/test_h2oai_arrow.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 2,816 | 2018-06-26T18:52:52.000Z | 2021-04-06T10:39:15.000Z | tools/pythonpkg/tests/slow/test_h2oai_arrow.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 1,310 | 2021-04-06T16:04:52.000Z | 2022-03-31T13:52:53.000Z | tools/pythonpkg/tests/slow/test_h2oai_arrow.py | AldoMyrtaj/duckdb | 3aa4978a2ceab8df25e4b20c388bcd7629de73ed | [
"MIT"
] | 270 | 2021-04-09T06:18:28.000Z | 2022-03-31T11:55:37.000Z | import duckdb
import os
import sys
try:
import pyarrow
import pyarrow.csv
import requests
import numpy as np
import math
can_run = True
except:
can_run = False
def download_file(url,name):
r = requests.get(url, allow_redirects=True)
open(name, 'wb').write(r.content)
def group_by(co... | 44.313514 | 215 | 0.651866 |
0eb455b5d8e36a7efa7466aa1aa8d27e3f782644 | 1,822 | py | Python | Curso_Python/Secao5-modulos-uteis/120_121_datetime-hora-data/datas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/120_121_datetime-hora-data/datas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao5-modulos-uteis/120_121_datetime-hora-data/datas.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from datetime import datetime
from locale import setlocale, LC_ALL
from calendar import mdays
setlocale(LC_ALL, '')
setlocale(LC_ALL, 'pt_BR.utf-8')
dt = datetime.now()
mes_atual = int(dt.strftime('%m'))
ultimo_dia_mes = mdays[mes_atual]
# sábado, 13 de julho de 2019
formatacao1 = dt.strftime('%A, %d de %B de %Y')
#... | 35.038462 | 186 | 0.740944 |
0edc2b4540e578ce69145d7b07feedec9d550653 | 1,477 | py | Python | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SafeBreach/Scripts/JoinListsOfDicts/JoinListsOfDicts.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from itertools import product
def find_value_by_key(k, d):
if not isinstance(d, dict):
raise Exception("{} d is not a dictionary".format(d))
if k.startswith('CustomFields.'):
if 'CustomFields' not in d:
return
cf = d.get('CustomFields', None)
... | 24.213115 | 83 | 0.57346 |
16c3ea2f5fe7505cb3fa511ab53a6d5c3448f08b | 1,573 | py | Python | python/generator_tricks_for_systemprogrammer/genmulti.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genmulti.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/generator_tricks_for_systemprogrammer/genmulti.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | # genmulti.py
#
# Generate items from multiple generators (multiplex)
#
import queue, threading
from genqueue import genfrom_queue, sendto_queue
from gencat import gen_cat
def multiplex(sources):
in_q = queue.Queue()
consumers = []
for src in sources:
thr = threading.Thread(target=s... | 24.2 | 70 | 0.603942 |
bc87a3bb5a0a8e9796165fe2dd2598e173e6e20e | 734 | py | Python | sketches/particleSystem03/particle.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/particleSystem03/particle.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/particleSystem03/particle.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | # coding=utf-8
class Particle(object):
def __init__(self, l):
self.acceleration = PVector(0, 0.05)
self.velocity = PVector(random(-1, 1), random(-2, 0))
self.location = l.get()
self.lifespan = 255.0
def run(self):
self.update()
self.display()
d... | 25.310345 | 61 | 0.543597 |
e67f89a4c3d43adaff4fdd3554e648f93de8facd | 4,666 | py | Python | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | null | null | null | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-02-11T23:44:52.000Z | 2021-02-11T23:44:52.000Z | Unpublished/TensorflowPlayground/mnist.py | stanton119/data-analysis | b6fda815c6cc1798ba13a5d2680369b7e5dfcdf9 | [
"Apache-2.0"
] | 1 | 2021-12-16T01:02:23.000Z | 2021-12-16T01:02:23.000Z | # %% [markdown]
# # Fitting ConvNN to Datasets
# MNIST/EMNIST
# Explore layers with NN microscope
# Add data augmentation
# %%
import tensorflow as tf
import tensorflow_datasets as tfds
import os
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("seaborn-whitegrid")
# %% Load data from csv
import pand... | 24.176166 | 101 | 0.637377 |
fc165ed1ba7bea01190910182e4f88177a07b366 | 1,539 | py | Python | dataset/vocab/make_vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/vocab/make_vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | dataset/vocab/make_vocab.py | baowj-678/TC | 4c9bf6bf2202c9930616259d3f3e1a2b0529a6e6 | [
"MIT"
] | null | null | null | """ 根据原文件生成字典文件
@Author: Bao Wenjie
@Email: bwj_678@qq.com
@Date: 2020/10/30
"""
import nltk
import os
import sys
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(abs_path)
from dataset.utils import *
class MakeVocab():
def __init__(self):
pass
@staticmethod
def make_vocab_... | 32.744681 | 214 | 0.578298 |
fc28f1d6c78e6ef5ff6a22d9eba707fcd269124d | 4,036 | py | Python | python/oneflow/compatible/single_client/test/xrt/test_online_int8.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/test/xrt/test_online_int8.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/test/xrt/test_online_int8.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... | 26.207792 | 82 | 0.595639 |
53b17cfa1c8fafdba66818ca716ef2590f60e622 | 4,324 | py | Python | docs/build_pdf.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 49 | 2018-11-07T06:43:33.000Z | 2022-03-18T20:53:06.000Z | docs/build_pdf.py | guruvamsi-policharla/noisy-krotov | c5397d9dbde68d06f17e88620d6a6b2c74664841 | [
"BSD-3-Clause"
] | 94 | 2018-11-06T20:15:04.000Z | 2022-01-06T09:06:15.000Z | docs/build_pdf.py | qucontrol/krotov | 9f9a22336c433dc3a37637ce8cc8324df4290b46 | [
"BSD-3-Clause"
] | 20 | 2018-11-06T20:03:11.000Z | 2022-03-12T05:29:21.000Z | """Script for building the documentation in PDF format.
This script is invoked by `make docs-pdf` (Unix systems only!)
It assumes that you have lualatex installed (https://www.tug.org/texlive/).
You must also have the DejaVu fonts installed on your system
(https://dejavu-fonts.github.io).
"""
import re
import shutil... | 30.027778 | 82 | 0.569843 |
db9d22b20ef8c74a1ff90a586d24d2c55fd12781 | 690 | py | Python | books/PythonCleanCode/ch9_design_pattern/composite_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch9_design_pattern/composite_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonCleanCode/ch9_design_pattern/composite_1.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """Clean Code in Python - Chapter 9: Common Design Patterns
> Composite
"""
from typing import Iterable, Union
class Product:
def __init__(self, name, price):
self._name = name
self._price = price
@property
def price(self):
return self._price
class ProductBundl... | 23 | 88 | 0.611594 |
bec806dabd29a2c0dd8548915b588f42be40a078 | 2,966 | py | Python | python/oneflow/nn/parallel/ddp.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/parallel/ddp.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/parallel/ddp.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | null | null | null | """
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... | 35.309524 | 84 | 0.681726 |
fe3bffb4690b4b4cbf61ff10b109e44f80647c00 | 2,963 | py | Python | evaluation/EvaluatorBase.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | evaluation/EvaluatorBase.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | 5 | 2021-03-19T14:21:08.000Z | 2022-03-12T00:42:00.000Z | evaluation/EvaluatorBase.py | habecker/transfer-gan | b935e69d0fa0d37ba80aab091ce59e1657eacb1e | [
"BSD-3-Clause"
] | null | null | null | import os
import glob
from data.image_folder import ImageFolder, IMG_EXTENSIONS, default_loader, is_image_file
from PIL import Image
import torchvision.transforms as transforms
import torch
def get_transform(resize=False, padding=None, osize=(299, 299), method=Image.BICUBIC, convert=True):
transform_list = []
... | 39.506667 | 194 | 0.608842 |
43120bd4064496f48072505f79531b4fe0dc7dbb | 3,854 | py | Python | research/cv/DDRNet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/DDRNet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/DDRNet/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 37.057692 | 112 | 0.692008 |
434c28af6c373e0002d1b84278066d3d0b8c9c69 | 5,608 | py | Python | jumpserver-dev/docs/django_class_base_view_inheritance.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | jumpserver-dev/docs/django_class_base_view_inheritance.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2020-06-15T03:41:03.000Z | 2020-06-15T03:41:04.000Z | jumpserver-dev/docs/django_class_base_view_inheritance.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | #!/usr/bin/env python
# ~*~ coding: utf-8 ~*~
#
from django.core.paginator import InvalidPage, Paginator
class View(object):
http_method_names = []
def __init__(self, **kwargs):
pass
@classmethod
def as_view(cls, **initkwargs):
pass
def dispatch(self, request, *args, **kwargs)... | 18.945946 | 68 | 0.646041 |
438a18e6b9e7e99e1014a1ac3fdecf5f4920680a | 1,328 | py | Python | 20-fs-ias-lec/groups/07-14-logCtrl/src/logStore/appconn/chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/07-14-logCtrl/src/logStore/appconn/chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/07-14-logCtrl/src/logStore/appconn/chat_connection.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from .connection import Function
class ChatFunction(Function):
"""Connection to the group chat to insert and output the chat elements"""
def __init__(self):
super(ChatFunction, self).__init__()
def insert_chat_msg(self, cbor):
"""adds a new chat element as cbor
@:parameter event... | 39.058824 | 121 | 0.690512 |
71ab818e80ec25eea82d0c00c44dd8fe2957cd6a | 2,087 | py | Python | app/views/sessions.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/sessions.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/views/sessions.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | import logging
from flask import session, current_app, request
from flask.helpers import total_seconds
from flask_login import AUTH_HEADER_NAME
from flask_restplus import Namespace, Resource
from flask_restplus import abort
from app import login_manager
from app.services import UserService
from .models.sessions impor... | 33.66129 | 100 | 0.70436 |
e08ce86497bd185631fdc046632a40d9822929f9 | 315 | pyde | Python | sketches/particles2/particles2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/particles2/particles2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/particles2/particles2.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from particlesystem import ParticleSystem
systems = []
def setup():
size(640, 480)
this.surface.setTitle("Partikelsysteme 2")
def draw():
background(235)
for ps in systems:
ps.addParticle()
ps.run()
def mousePressed():
systems.append(ParticleSystem(PVector(mouseX, mouseY)))
| 18.529412 | 59 | 0.669841 |
e809fffc7eb526b6816384afc402e896d4a47b6f | 5,254 | py | Python | functions.py | BostelmannLGLN/LGLN-OpenData | 216c762a0b91dd36189e9bb34fa4b3ec76e13f92 | [
"MIT"
] | 3 | 2021-12-16T17:22:07.000Z | 2022-03-12T21:23:56.000Z | functions.py | BostelmannLGLN/LGLN-OpenData-Notebooks | 216c762a0b91dd36189e9bb34fa4b3ec76e13f92 | [
"MIT"
] | null | null | null | functions.py | BostelmannLGLN/LGLN-OpenData-Notebooks | 216c762a0b91dd36189e9bb34fa4b3ec76e13f92 | [
"MIT"
] | null | null | null | import geopandas as gpd
from tqdm import tqdm
import requests
import pandas as pd
import fnmatch
from datetime import timedelta
def select_tiles_in_bbox_of_area(tiles, area):
bounds = area.total_bounds
left = bounds[0]
bottom = bounds[1]
right = bounds[2]
top = bounds[3]
selected_tiles = tiles.... | 32.8375 | 144 | 0.569471 |
1c9343d11d40d94c37838ca9a65ce2360ddc2936 | 1,083 | py | Python | PythonTest/key_event.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | PythonTest/key_event.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | 1 | 2017-11-03T06:59:55.000Z | 2017-11-04T02:10:14.000Z | PythonTest/key_event.py | yuduki24/RubyTest | 006233df69eca3eb5676984b51e57cd34d8dcf87 | [
"MIT"
] | null | null | null | import pygame
from pygame.locals import *
import sys
SCREEN_SIZE = (640, 480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE)
pygame.display.set_caption(u"キーイベント")
img = pygame.image.load("img/my_python.png").convert()
colorkey = img.get_at((0, 0))
img.set_colorkey(colorkey, RLEACCEL)
img... | 28.5 | 55 | 0.562327 |
c794d4d5dd720bedacbf26951edc115c622162b7 | 314 | py | Python | src/python/py-accepted/266A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/266A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/266A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 266A
# Created on : 2019-01-14 22:10:03
def Main():
n, s = int(input()), input()
init = s
arr = ['RR', 'GG', 'BB']
for x in arr:
while s.find(x) != -1:
s = s.replace(x, x[0])
print(len(init) - len(s))
if __name__ == '__main__':
Main()
| 15.7 | 36 | 0.468153 |
c7c57ff7952962da57d7e5838938b78523f89820 | 3,446 | py | Python | debt_editor.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | debt_editor.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | debt_editor.py | VNCompany/PyDafm | 9634f5428b9f3739dbf7c159daad34856b372165 | [
"Unlicense"
] | null | null | null | from PyQt5 import uic
from PyQt5.QtWidgets import QDialog, QMessageBox
from PyQt5.QtCore import QDate, Qt
from PyQt5.QtGui import QKeyEvent
from dbm import *
from debtor_editor import DebtorEditor
class DebtEditor(QDialog):
def __init__(self, dbm: DataBaseManager, debt: Debt = None):
super(DebtEditor, sel... | 37.868132 | 96 | 0.661927 |
409e202e657c160d7740c4ecce4cedf400657192 | 159 | py | Python | python/encapsulation/python_basic_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encapsulation/python_basic_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/encapsulation/python_basic_class.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | class Phone:
number = "111-11-11"
def print_number(self):
print('Phone number is:', self.number)
my_phone = Phone()
my_phone.print_number()
| 15.9 | 46 | 0.647799 |
906fbbafebda391d6600fe32ab69e3b8237818bc | 2,945 | py | Python | src/classifier/torch_helpers/eval_torch.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 14 | 2021-08-24T12:36:37.000Z | 2022-03-18T12:14:36.000Z | src/classifier/torch_helpers/eval_torch.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | null | null | null | src/classifier/torch_helpers/eval_torch.py | krangelie/bias-in-german-nlg | 9fbaf50fde7d41d64692ae90c41beae61bc78d44 | [
"MIT"
] | 1 | 2021-10-21T20:22:55.000Z | 2021-10-21T20:22:55.000Z | import os
import json
import numpy as np
import hydra
import torch
from torch.nn import functional as F
from sklearn.metrics import f1_score
from src.classifier.utils import store_preds
from src.classifier.visualizers.plots import plot_conf_matrix
def evaluate(
model, test_loader, texts_test, classes, name_str,... | 35.914634 | 85 | 0.676061 |
90ef96e4bd35d5703622f4a530aaf0fae973d57b | 543 | py | Python | leetcode/add_license.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 4 | 2018-11-14T12:03:05.000Z | 2019-09-03T14:33:28.000Z | leetcode/add_license.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | null | null | null | leetcode/add_license.py | tlming16/Projec_Euler | 797824c5159fae67493de9eba24c22cc7512d95d | [
"MIT"
] | 1 | 2018-11-17T14:39:22.000Z | 2018-11-17T14:39:22.000Z | #!/usr/bin/env python3
#-*- coding:utf-8 -*-
import os
author = " * author:tlming16\n"
email = " * email:tlming16@fudan.edu.cn\n"
license = " * all wrong reserved\n"
text= "/* \n" + author + email+ license +"*/\n";
file_list =os.listdir("./test");
def write_file( f):
if not f.endswith(".cpp"):
return
conte... | 21.72 | 48 | 0.585635 |
31434c61cb941d663c335c975788df225549ac05 | 466 | py | Python | Packs/MapRegex/Scripts/MapRegex/MapRegex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MapRegex/Scripts/MapRegex/MapRegex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MapRegex/Scripts/MapRegex/MapRegex.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import re
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
# Get the arguments
args = demisto.args()
# Get the input value
value = args.get('value')
results = value
# Get and parse the JSON input
try:
json_regex = json.loads(args.get('json_regex'))
except Exception as e... | 18.64 | 51 | 0.690987 |
73394753c215d8e80d4e03e647c953b32d38910d | 145 | py | Python | etl/mappings/api_servers.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | etl/mappings/api_servers.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | etl/mappings/api_servers.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | servers = {
'test': 'url',
'stage': 'url',
'prod': 'url',
'test-epic': 'url',
'stage-epic': 'url',
'prod-epic': 'url',
}
| 16.111111 | 24 | 0.434483 |
b40b4e6d85f38337402db997b9d80eea3b061b6d | 1,063 | py | Python | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_over_coverage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_over_coverage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-dqc/src/watchmen_dqc/monitor/rule/factor_common_value_over_coverage.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from datetime import datetime
from logging import getLogger
from typing import Any, List, Tuple
from watchmen_data_kernel.storage import TopicDataService
from watchmen_model.admin import Factor
from watchmen_model.dqc import MonitorRule
from watchmen_utilities import ArrayHelper
from .types import RuleResult
logger =... | 33.21875 | 94 | 0.790216 |
b461cf96c0ab23d8e925531c44e59c2fd51eda5b | 330 | py | Python | Assembler/tests/test_all.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | 1 | 2019-01-28T01:53:20.000Z | 2019-01-28T01:53:20.000Z | Assembler/tests/test_all.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null | Assembler/tests/test_all.py | Laegluin/mikrorechner | 7e5e878072c941e422889465c43dea838b83e5fd | [
"MIT"
] | null | null | null | from tests import test_labels_beta, test_assemble_data_strings, test_asm_beta
def test_all():
print('Teste asm_beta')
test_asm_beta.test_all()
print('\n')
print('Teste asm_labels')
test_labels_beta.test_all()
print('\n')
print('teste assemble_data_strings')
test_assemble_data_strings.t... | 25.384615 | 77 | 0.730303 |
6f09c169a2b09d0927283d32c9df9e3d82c4aad4 | 397 | py | Python | python/en/_packages/nltk/test_word_tokenize.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/nltk/test_word_tokenize.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_packages/nltk/test_word_tokenize.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # test_tokenize.py
# First, run the following commands in IPYTHON.
# import nltk
# nltk.download()
from nltk.tokenize import sent_tokenize, word_tokenize
text = "Hi, there. How are you doing? NLTK is a great tool to learn about NLP."
print( sent_tokenize(text) ) # Tokenize sentence
print( word_tokenize(te... | 30.538462 | 80 | 0.717884 |
6f70fa06337034b2c6c3eb9f47a6a0e59468bbcc | 3,644 | py | Python | modeling/head/multiscaleattention.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | 2 | 2020-12-22T08:40:05.000Z | 2021-03-30T08:09:44.000Z | modeling/head/multiscaleattention.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | modeling/head/multiscaleattention.py | UESTC-Liuxin/SkmtSeg | 1251de57fae967aca395644d1c70a9ba0bb52271 | [
"Apache-2.0"
] | null | null | null | ###########################################################################
# Created by: CASIA IVA
# Email: jliu@nlpr.ia.ac.cn
# Copyright (c) 2018
###########################################################################
from __future__ import division
import torch.nn as nn
import torch
import torch.nn.functional ... | 40.94382 | 112 | 0.601262 |
48b9515ddcdd033d21dbccbd83ee79a67f7555ac | 1,066 | py | Python | Arrays and Strings/MaximumGap.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/MaximumGap.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | null | null | null | Arrays and Strings/MaximumGap.py | dileeppandey/hello-interview | 78f6cf4e2da4106fd07f4bd86247026396075c69 | [
"MIT"
] | 1 | 2020-02-12T16:57:46.000Z | 2020-02-12T16:57:46.000Z | """
Given an unsorted array, find the maximum difference between the successive
elements in its sorted form.
Return 0 if the array contains less than 2 elements.
"""
import unittest as ut
class Solution(object):
def maximum_gap_using_sorting(self, nums):
"""Return the maximum gap in nums.
Comple... | 24.227273 | 76 | 0.614447 |
7d6ab04aa5c53b89eb48deff4941de73e19c766a | 647 | py | Python | exercises/pt/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_02_06.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | from spacy.lang.en import English
nlp = English()
# Importe as classes Doc e Span
from spacy.tokens import Doc, Span
words = ["I", "like", "David", "Bowie"]
spaces = [True, True, True, False]
# Crie um doc Doc a partir das palavras words e espaçamento spaces
doc = Doc(nlp.vocab, words=words, spaces=spaces)
print(d... | 26.958333 | 84 | 0.715611 |
7d9c2a8e1e2544fc63f496c363edfdd27af534e7 | 3,418 | py | Python | SoSe-21/Uebung-6/A1-Stein-Schere-Papier-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | 1 | 2022-03-23T09:40:39.000Z | 2022-03-23T09:40:39.000Z | SoSe-21/Uebung-6/A1-Stein-Schere-Papier-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | SoSe-21/Uebung-6/A1-Stein-Schere-Papier-2.py | jonasrdt/Wirtschaftsinformatik2 | 30d5d896808b98664c55cb6fbb3b30a7f1904d9f | [
"MIT"
] | null | null | null | # Programmieren Sie das Spiel Stein-Schere-Papier für zwei Spieler. Jeder Spieler kann entweder Stein, Schere oder Papier wählen.
# Die Regeln:
# Stein schlägt Schere Schere schlägt Papier Papier schlägt den Stein
# • Fragen Sie nach dem Namen der Spieler
# • Programmieren Sie eine Funktion, die den Gewinner ermittelt
... | 40.211765 | 129 | 0.708894 |
6fe35439106f2473f65ebad353ac9e2e1f12574b | 3,132 | py | Python | pandas/plotting/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | pandas/plotting/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | pandas/plotting/UI.py | ptracton/ExperimentalPython | a3159226982ec9656bb0f81f6997687da22f4466 | [
"MIT"
] | null | null | null | """
This is an example of a basic UI top level module.
Most of the GUI work is handled in the "central" widget.
This level handles signal/slot connections so all the different
level can interact
"""
import logging
import numpy as np
import pandas as pd
import PyQt5
import PyQt5.QtCore
import PyQt5.QtWidgets
import ... | 31.959184 | 89 | 0.635696 |
96809f25b2a6ce5f70ef3531b2894aa859aea826 | 1,710 | py | Python | saint_binary.py | FokaSaint/SaintAvitFoka_DAT129 | 73de96c5683b9aff1c58518b1317a9c666522c8f | [
"Apache-2.0"
] | null | null | null | saint_binary.py | FokaSaint/SaintAvitFoka_DAT129 | 73de96c5683b9aff1c58518b1317a9c666522c8f | [
"Apache-2.0"
] | null | null | null | saint_binary.py | FokaSaint/SaintAvitFoka_DAT129 | 73de96c5683b9aff1c58518b1317a9c666522c8f | [
"Apache-2.0"
] | 1 | 2020-12-09T23:23:43.000Z | 2020-12-09T23:23:43.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 9 16:12:05 2020
@author: Avit_
"""
'''
Python 2 - DAT 129
Week 1: 09/02/2020
Module 1: Icon Manipulation
Assignment: Create a program in Python that uses looping
and Basic Data Structures to display customized 10x10 Student
icons in various scales and ori... | 28.032787 | 74 | 0.656725 |
9694f543c58f78784be09437c2b9b6a9d886120e | 92 | py | Python | 2015/03/energy-costs-20150320/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2015/03/energy-costs-20150320/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2015/03/energy-costs-20150320/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1TuiIe7zHlK3CjEGZfpxi-CT-ypTQ1St8GvFTiJ_TO2Q'
| 23 | 68 | 0.826087 |
73b15f9abdba281c8af884353730d49dbfd9eea3 | 1,767 | py | Python | Date.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | Date.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | Date.py | mayur200/hacktoberfest2021 | 5f141fe6dc90916d65bef17a66f0db05649c41ef | [
"MIT"
] | null | null | null | '''''
You are here: Home / Basics / Date and Time in Python
Date and Time in Python
Author: PFB Staff Writer
Last Updated: August 27, 2020
Date and Time in Python
In my last post about datetime & time modules in Python, I mostly used the strftime(format) method to print out the dates and times.
In this post, I will s... | 26.772727 | 169 | 0.682513 |
73d25465f3e23eb5ac46afc5eddfc57d67d87617 | 5,856 | py | Python | wagtail_localize/views/convert.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | null | null | null | wagtail_localize/views/convert.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | null | null | null | wagtail_localize/views/convert.py | th3hamm0r/wagtail-localize | e9e0ba9245060c65e3247b62739abbed71bc2516 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.http import Http404
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.translation import gettext as _
from wagtail.admin import messages
from w... | 34.447059 | 97 | 0.65625 |
e3c1e50ddaead1898a51d9a78d46dbcfbb3fb97d | 732 | py | Python | backend/apps/iamstudent/migrations/0003_auto_20200329_1859.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/migrations/0003_auto_20200329_1859.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/migrations/0003_auto_20200329_1859.py | n-hackert/match4healthcare | 761248c27b49e568c545c643a72eac9a040649d7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-29 18:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('iamstudent', '0002_auto_20200329_1618'),
]
operations = [
migrations.AddField(
model_name='student',
name='is_activa... | 30.5 | 206 | 0.606557 |
547273105c8ab7e4748f04255c73c04bb6d5d4e4 | 5,679 | py | Python | backend/python/flask_app/test_controller.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:07:54.000Z | 2021-02-08T17:07:54.000Z | backend/python/flask_app/test_controller.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | null | null | null | backend/python/flask_app/test_controller.py | Untanky/bachelor-thesis | 01b3c00765006ab6b140607e426533a7eed1508b | [
"MIT"
] | 1 | 2021-02-08T17:08:01.000Z | 2021-02-08T17:08:01.000Z | import pytest
from flask import jsonify
from unittest.mock import MagicMock, patch
import sys, os
from flask_app import controller
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/../../../dao/src"))
from Post import Post
from PostDAO import PostDAO
from Exception import IllegalArgumentException, UnknownEle... | 44.023256 | 117 | 0.759465 |
b721d18daab97dc93f62a45e4c6ca4872ff78532 | 47,073 | py | Python | fbtor/FBoolector.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/FBoolector.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/FBoolector.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | from fbtor.FBoolectorTypes import FPType, RMode, EXP, MAN, WIDTH
from fbtor.BitVecConvert import BitVecConvStatic
from fbtor.FBoolectorInterface import FBoolectorInterface
from pyboolector import _BoolectorBitVecSort, Boolector
import math
"""The FBoolector class extends Boolector such that floating point formulas
... | 40.164676 | 144 | 0.555903 |
3fef9ca229e94838838700aa3e14dbbb1d1aab6a | 2,510 | py | Python | tests/test_sphinx_multitoc_numbering.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 2,109 | 2020-05-02T23:47:18.000Z | 2022-03-31T22:16:54.000Z | tests/test_sphinx_multitoc_numbering.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 1,158 | 2020-04-29T18:07:02.000Z | 2022-03-31T21:50:57.000Z | tests/test_sphinx_multitoc_numbering.py | flat35hd99/jupyter-book | 4d5b474e6f2b80c4d1d206e4554740ff82a344dc | [
"BSD-3-Clause"
] | 360 | 2020-04-29T14:44:49.000Z | 2022-03-31T09:26:23.000Z | import subprocess
import pytest
import sphinx
from bs4 import BeautifulSoup
# from jupyter_book.cli import main as commands
SPHINX_VERSION = f".sphinx{sphinx.version_info[0]}"
@pytest.mark.parametrize(
"toc_file",
(
"_toc_numbered.yml", # Numbered at top-level
"_toc_numbered_depth.yml", #... | 32.597403 | 94 | 0.612351 |
3ff0de13ff53b77840cb9bf0a806b0e2abb82e2d | 27,987 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/redfish/view_helper.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/view_helper.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/view_helper.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 res... | 38.129428 | 100 | 0.653053 |
b7973a87c01eb3d603de82e3bf8feebcb71bf093 | 1,226 | py | Python | elements/python/9/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/9/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/9/12/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import random
class Stack(object):
def __init__(self):
self.stack = []
def push(self, x):
self.stack.append(x)
def pop(self):
if len(self.stack) == 0:
return None
return self.stack.pop(-1)
def size(self):
return len(self.stack)
class Queue(objec... | 19.774194 | 59 | 0.526101 |
4d141712138e08b95d4c2bded7cbb7e627f076cf | 1,102 | py | Python | vamp-libxtract/LibXtract/swig/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 138 | 2015-01-16T13:06:08.000Z | 2022-03-15T14:11:46.000Z | vamp-libxtract/LibXtract/swig/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 33 | 2015-04-20T14:34:25.000Z | 2021-07-07T12:38:46.000Z | vamp-libxtract/LibXtract/swig/test.py | jaouahbi/VampPlugins | 27c2248d1c717417fe4d448cdfb4cb882a8a336a | [
"Apache-2.0"
] | 46 | 2015-02-03T11:58:41.000Z | 2022-02-02T12:09:00.000Z | #!/usr/bin/python
try:
import xtract
except ImportError:
print 'Failed to load the library "xtract"'
print '\nRunning libxtract Python bindings test...\n'
len = 8
a = xtract.doubleArray(len)
temp = []
for i in range(0, len):
a[i] = 2 * i
temp.append(str(a[i]))
mean = xtract.xtract_mean(a,len,None)... | 19 | 86 | 0.686933 |
4dc0dceb6f14f19ef3f241d815a2539f74e7cf0c | 2,524 | py | Python | 1. Runde/Abgabe/Junioraufgabe 1/Junioraufgabe 1.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | 2 | 2020-12-27T19:57:53.000Z | 2021-01-04T15:16:42.000Z | 1. Runde/Abgabe/Junioraufgabe 1/Junioraufgabe 1.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | null | null | null | 1. Runde/Abgabe/Junioraufgabe 1/Junioraufgabe 1.py | christopher-besch/bwinf_37_round1 | 425abcce388ead2f075cfc89ff735427791d8084 | [
"MIT"
] | null | null | null | #!/usr/bin/python
print("Junioraufgabe 1")
ladder = [[6, 27], [14, 19], [21, 53], [31, 42], [33, 38], [46, 62], [51, 59], [57, 96], [65, 85], [68, 80], [70, 76],
[92, 98]] # Leitern, jede enthält Start- und Endfeld
location = 0 # ... | 68.216216 | 135 | 0.498019 |
12bb58f0642792b880f7eec21d502800885c829c | 329 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/75. sort a dictionary by value.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/75. sort a dictionary by value.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/75. sort a dictionary by value.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function to sort (ascending) a dictionary by value.
input_dict = {'apples':10,'oranges':6,'banana':12,'pears':5}
sorted_dict = {'pears': 5, 'oranges': 6, 'apples': 10, 'banana': 12}
"""
#Solution is:
def dict_sort(input_dict):
return dict(sorted(input_dict.items(), key=lambda item: item[1]))
... | 23.5 | 69 | 0.653495 |
673a9d29085fcd5730e346f1e7e935c1eee746b6 | 459 | py | Python | chapter_ten/deploying_nightly_rust_in_rust/flask_app/src/models/database/fib_entry.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 21 | 2021-09-10T12:46:26.000Z | 2022-03-23T02:50:39.000Z | chapter_ten/fusing_rust_with_data_access/flask_app/src/models/database/fib_entry.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | null | null | null | chapter_ten/fusing_rust_with_data_access/flask_app/src/models/database/fib_entry.py | PacktPublishing/Speed-up-your-Python-with-Rust | 1fce5fb59ea966015768e7eca51c0e31d69531ec | [
"MIT"
] | 6 | 2021-09-02T08:32:37.000Z | 2022-03-17T21:15:25.000Z | from typing import Dict
from sqlalchemy import Column, Integer
from data_access import dal
class FibEntry(dal.base):
__tablename__ = "fib_entries"
id = Column(Integer, primary_key=True)
input_number = Column(Integer)
calculated_number = Column(Integer)
@property
def package(self) -> Dict[st... | 22.95 | 55 | 0.675381 |
18c45ee78865ee772b38ab90b0ebeac3b91f544b | 148 | py | Python | LF6/zip.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | 5 | 2016-07-07T09:00:31.000Z | 2017-03-09T22:46:33.000Z | LF6/zip.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | null | null | null | LF6/zip.py | JohannesMuelle/workshops | af9140159e3872aff75864ced99b5163d7bba1ba | [
"CC0-1.0"
] | 8 | 2016-05-13T14:29:06.000Z | 2019-10-20T16:43:32.000Z | import zipfile
import sys
zFile = zipfile.ZipFile("evil.zip")
try:
zFile.extractall(pwd=b"bloedsinn")
except:
print(sys.exc_info()[0])
| 16.444444 | 38 | 0.689189 |
7a0dbfa7bf98841c97a6cdd37ef3f12f27f69222 | 3,595 | py | Python | examples/test/generators/MongoEngineGenerator.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | 1 | 2015-10-26T10:38:32.000Z | 2015-10-26T10:38:32.000Z | examples/test/generators/MongoEngineGenerator.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | examples/test/generators/MongoEngineGenerator.py | Jumpscale/web | 8e8ec2ce01f3105c7647ee8a0c90af09311cbbeb | [
"Apache-2.0"
] | null | null | null | from JumpScale import j
class MongoEngineGenerator():
def __init__(self,dest):
self.dest=dest
j.system.fs.createDir(j.system.fs.getDirName(self.dest))
def generate(self,spec):
out="from mongoengine import *\n\n"
out+="classes=[]\n"
for modelname in spec.keys():
... | 30.210084 | 105 | 0.500139 |
e15e7a1381d64c1d68496e7f299375c530aedc15 | 14,470 | py | Python | oldp/apps/cases/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/cases/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/cases/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import markdown
from django.core import serializers
from django.core.serializers.base import DeserializationError
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
from oldp.apps.courts.models import Court
from oldp.apps.laws.models import *
from oldp.apps.search.models impo... | 31.388286 | 119 | 0.583138 |
e16123ddf29e4672cdda9e34c03b6ca1f2b7febd | 1,215 | py | Python | nffb/models.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/models.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | nffb/models.py | misli/nffb | 63505a6c3e2b30fac2c869744e1536556c22e68b | [
"BSD-3-Clause"
] | null | null | null | import re
from django import forms
from django.core.validators import RegexValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.extensions import PageExtension
from cms.extensions.extension_pool import extension_pool
from filer.fields.image import FilerImageField
cl... | 32.837838 | 131 | 0.715226 |
55de8dabf741175853962b44f399e93e6e577616 | 416 | py | Python | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/criando_modulos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/criando_modulos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso_Python/Secao3-Python-Intermediario-Programacao-Procedural/81_como_criar_modulos/criando_modulos.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | import math
pi = math.pi
def dobra_lista(lista):
return [x*2 for x in lista]
def multiplica(lista):
r1 = 1
for i in lista:
r1 += i
return r1
lista = [1, 2, 3, 4, 5]
if __name__ == '__main__': # Não vai ser executado no outro arquivo que importa esse
print(dobra_lista(lista))
print(... | 18.086957 | 84 | 0.649038 |
36557b7dde4620abbbbf33598ee41c18aabf65dd | 697 | py | Python | books/PythonAutomate/pdf_word_documents/copying_pages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/pdf_word_documents/copying_pages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/pdf_word_documents/copying_pages.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | """copying_pages.py
두 PDF 파일의 페이지를 합친
새로운 PDF 파일 생성"""
import PyPDF2
pdf_file1 = open("meetingminutes.pdf", "rb")
pdf_file2 = open("meetingminutes2.pdf", "rb")
pdf_reader1 = PyPDF2.PdfFileReader(pdf_file1)
pdf_reader2 = PyPDF2.PdfFileReader(pdf_file2)
pdf_writer = PyPDF2.PdfFileWriter()
for page_num in range(pdf_rea... | 25.814815 | 51 | 0.770445 |
3663bcabdff4fb0804d75361a7f4f6914c423061 | 837 | py | Python | deutschland/risikogebiete/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/risikogebiete/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/risikogebiete/__init__.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
"""
Robert Koch Institut: Corona Risikogebiete API
Aktuelle Corona Risikogebietsinformationen als API # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
__version__ = "1.0.0"
# import ApiClient
from deutschland.risikogebiete.api... | 29.892857 | 68 | 0.830346 |
a108f8a9cd53519580be7bdf3f4f078b2e7179a9 | 1,108 | py | Python | elements/python/5/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 11 | 2019-02-08T06:54:34.000Z | 2021-08-07T18:57:39.000Z | elements/python/5/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | 1 | 2019-05-21T08:14:10.000Z | 2019-05-21T08:14:10.000Z | elements/python/5/13/soln.py | mmcloughlin/problems | 6095842ffe007a12ec8c2093850515aa4e046616 | [
"MIT"
] | null | null | null | import collections
Rect = collections.namedtuple('Rect', ['x', 'y', 'w', 'h'])
def intersect_intervals(l0, s0, l1, s1):
"""
Compute the intersection of intervals (l0, l0+s0) and (l1, l1+s1).
"""
l = max(l0, l1)
r = min(l0+s0, l1+s1)
if l > r:
return None
return (l, r-l)
def int... | 19.785714 | 70 | 0.554152 |
a1956856b8f45f6421b51ed2fee32b067f7c720c | 1,993 | py | Python | loss.py | JACKYLUO1991/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 24 | 2019-09-01T09:02:59.000Z | 2022-03-22T08:38:16.000Z | loss.py | HeroOneHY/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 2 | 2019-10-25T02:39:03.000Z | 2022-03-20T15:45:22.000Z | loss.py | HeroOneHY/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 11 | 2019-10-25T01:36:18.000Z | 2021-04-09T06:51:58.000Z | from keras import backend as K
import tensorflow as tf
import math
N_LANDMARK = 106
def normalized_mean_error(y_true, y_pred):
'''
normalised mean error
'''
y_pred = K.reshape(y_pred, (-1, N_LANDMARK, 2))
y_true = K.reshape(y_true, (-1, N_LANDMARK, 2))
# Distance between pupils
interocula... | 26.573333 | 85 | 0.583542 |
a1bf81915b4e02cae5918a0e3626e8dad4fd3f20 | 838 | py | Python | shinrl/_utils/wrapper.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/_utils/wrapper.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/_utils/wrapper.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | import gym
import numpy as np
class NormalizeActionWrapper(gym.Wrapper):
"""Gym wrapper to normalize actions into [-1, 1]."""
def __init__(self, env):
super().__init__(env)
ones = np.ones_like(env.action_space.high)
self.action_space = gym.spaces.Box(
low=-ones,
... | 27.032258 | 60 | 0.597852 |
629fafbb33e53b916aa405d37207db04b1e78964 | 97 | py | Python | src/server/app/models/Canvas.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 6 | 2020-12-15T18:57:53.000Z | 2022-02-06T18:54:35.000Z | src/server/app/models/Canvas.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 186 | 2020-11-17T10:18:17.000Z | 2022-03-02T07:19:22.000Z | src/server/app/models/Canvas.py | MatthiasRiener/DigiPen | 9b4aff4a1c431e06d73733dc3dd3f3f3d4631704 | [
"MIT"
] | 1 | 2020-12-14T19:37:30.000Z | 2020-12-14T19:37:30.000Z | from ..db.settings import db
class Canvas(db.Document):
p_id = db.StringField(required=True) | 24.25 | 40 | 0.742268 |
c555b00acaa6e0dfe972a8e35aa2e026ad5385e5 | 1,165 | py | Python | contest_server/pjkiserver/__main__.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/__main__.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | contest_server/pjkiserver/__main__.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import atexit
from flask import Flask
app = Flask(__name__)
# Permanent storage / database handling
from .storage import storage
from . import timer
# These modules contain the endpoints and their handlers
from . import team
from . import player
from . import game
from . import event
app.register_blueprint(team.api... | 23.77551 | 74 | 0.754506 |
c566205ac8bf12b35b5bbf0c4f77e13fbe4f4097 | 15,736 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/backbones/deeplab.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 5 | 2022-01-30T07:35:58.000Z | 2022-02-08T05:45:20.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/backbones/deeplab.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-14T02:33:28.000Z | 2022-01-14T02:33:28.000Z | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/modeling/backbones/deeplab.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 1 | 2022-01-24T16:27:01.000Z | 2022-01-24T16:27:01.000Z | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applica... | 34.584615 | 80 | 0.476868 |
ad006a6ac16d3291e389d5d73eaadc5e84cc5c34 | 3,914 | py | Python | .arch/py_test/auto_docs.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 24 | 2021-10-04T22:11:59.000Z | 2022-02-02T21:51:43.000Z | .arch/py_test/auto_docs.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | 2 | 2021-10-04T21:51:30.000Z | 2021-10-05T14:15:31.000Z | .arch/py_test/auto_docs.py | axiros/docutools | f99874a64afba8f5bc740049d843151ccd9ceaf7 | [
"BSD-2-Clause"
] | null | null | null | import sys, os
from lcdoc.auto_docs import mod_doc
from importlib import import_module
from devapp.tools import FLG
# def gen_mod_doc(test_mod_file):
# """
# """
# if not 'pytest' in sys.argv[0]:
# return
# if not FLG.make_autodocs:
# return
# if not '/' in test_mod_file:
# ... | 24.160494 | 80 | 0.558508 |
b16f98184ef983dbc675fb52f6155635b4f0cb9b | 122 | py | Python | src/third_party_module/deal_with_excel/openpyxl_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/third_party_module/deal_with_excel/openpyxl_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/third_party_module/deal_with_excel/openpyxl_module.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
load_workbook
load_workbook.get_sheet_by_name
load_workbook.iter_rows
"""
| 12.2 | 31 | 0.713115 |
49a3129ddfc2fc402f7ec7969e0de9a9e43c5177 | 1,717 | py | Python | Python/Sonstige_Uebungen/mailgeneratortest.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Sonstige_Uebungen/mailgeneratortest.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Sonstige_Uebungen/mailgeneratortest.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | import random, names
def randomizer(firstname, lastname, mail=""):
provider_list = ["outlook.de", "outlook.com", "hotmail.de", "hotmail.com", "gmail.com", "gmx.de", "gmx.net", "gmx.ch", "yahoo.com", "1und1.de", "hotmail.co.uk"]
while len(mail) < 5:
fname = random.choice([firstname, firstname[:random.r... | 42.925 | 164 | 0.567851 |
b8ce77bbbf3c5afd668713fbd7d77403076bcc8e | 826 | py | Python | AccessPoint03/AccessPoint/migrations/0002_auto_20200616_1154.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | AccessPoint03/AccessPoint/migrations/0002_auto_20200616_1154.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | 5 | 2021-03-30T13:53:38.000Z | 2021-09-22T19:18:06.000Z | AccessPoint03/AccessPoint/migrations/0002_auto_20200616_1154.py | test1lax1/Toy | 52ea70ee92959bd59a0afc8baa30b3a455e394d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2020-06-16 06:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AccessPoint', '0001_initial'),
]
operations = [
migrations.C... | 28.482759 | 115 | 0.559322 |
02e43f7c37cd71a7941346cebb3e55734193dca1 | 3,083 | py | Python | hiit.py | topshed/Pi-rsonalTrainer | a7babc79b6796f664638952e1cde4b1de77d3dd6 | [
"MIT"
] | null | null | null | hiit.py | topshed/Pi-rsonalTrainer | a7babc79b6796f664638952e1cde4b1de77d3dd6 | [
"MIT"
] | null | null | null | hiit.py | topshed/Pi-rsonalTrainer | a7babc79b6796f664638952e1cde4b1de77d3dd6 | [
"MIT"
] | null | null | null | import time
import signal
import random
import os
import scrollphathd
from scrollphathd.fonts import font5x7
from gpiozero import Buzzer, Button
import signal
exercises = [' burpees ',
' press-ups ',
' side-steps ',
' step-ups ',
' sit-ups ',
' skip... | 27.526786 | 97 | 0.510542 |
f326476eb46bdd89bb4a47c58bcbc201bf4ab10e | 613 | py | Python | router/gst.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | 1 | 2020-11-17T09:08:24.000Z | 2020-11-17T09:08:24.000Z | router/gst.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | null | null | null | router/gst.py | half2me/gst-web | 1418d4fa3c11aab91296ce28a17dabcdd29b76c1 | [
"MIT"
] | 1 | 2020-11-17T09:08:26.000Z | 2020-11-17T09:08:26.000Z | from view.gst import *
def setup(app):
pre = '/api/gst'
app.router.add_get(pre + '/debug', getDebug)
app.router.add_post(pre + '/debug', setDebug)
app.router.add_get(pre + '/tracer', getTracer)
app.router.add_post(pre + '/tracer', setTracer)
app.router.add_get(pre + '/debug-file', getDebugFile... | 40.866667 | 63 | 0.675367 |
b855a7a5aacf999b24b8d91690e647afaf1e613d | 41,617 | py | Python | experimental/OUTDATED/ts2dataclass/veraltet/ts2dataclassParser_V1.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 2 | 2020-12-25T19:37:42.000Z | 2021-03-26T04:59:12.000Z | experimental/OUTDATED/ts2dataclass/veraltet/ts2dataclassParser_V1.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | 6 | 2018-08-07T22:48:52.000Z | 2021-10-07T18:38:20.000Z | experimental/OUTDATED/ts2dataclass/veraltet/ts2dataclassParser_V1.py | jecki/DHParser | c6c1bd7db2de85b5997a3640242f4f444532304e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#######################################################################
#
# SYMBOLS SECTION - Can be edited. Changes will be preserved.
#
#######################################################################
import json
import keyword
from functools import partial
import os
import re
import s... | 44.845905 | 315 | 0.598073 |
b210c1db2c5d4d9540ca023ecc36e62925d5719f | 8,379 | py | Python | test/test_npu/test_network_ops/test_isclose.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_isclose.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_isclose.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... | 44.333333 | 102 | 0.69531 |
b2614843332d1a9a30fe415e09a7704635077ac8 | 453 | py | Python | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0005_auto_20180125_1707.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0005_auto_20180125_1707.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | Implementierung/ResearchEnvironment/AuthorizationManagement/migrations/0005_auto_20180125_1707.py | Sashks/PSE | ae2d8133a85563c33583f15b9ba76a3a2bf0c762 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-25 16:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('AuthorizationManagement', '0004_auto_20180125_1659'),
]
operations = [
migrations.AlterField(
model_name='resource',
... | 23.842105 | 99 | 0.640177 |
a2b144757f466c8bc22bf6508b0dfd937fb22df0 | 923 | py | Python | Simple Wave Analysis/mgmt1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/mgmt1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | Simple Wave Analysis/mgmt1.py | washingtonxr/OpenAlgorithm | e1898e36dead0c79b23e054587d92f378c5e8b10 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import time
filename = "vlog-002[May.30th,2019].txt"
filename1 = "vlog_mag-002[May.30th,2019].txt"
filename2 = "vlog_acc-002[May.30th,2019].txt"
datapath = "./data/"
str_compass = "Compass"
pos = []
Efield = []
def readfile():
with open(datapath + filename, mode='r', encoding='utf-8') as f2read:... | 28.84375 | 74 | 0.572048 |
a745f4cdfe8198513c2a1af8cc317e639f765b32 | 869 | py | Python | Algorithms/5_Searching/1.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/5_Searching/1.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/5_Searching/1.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/icecream-parlor/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'icecreamParlor' function below.
#
# The function is expected to return an INTEGER_ARRAY.
# The function accepts following parameters:
# 1. INTEGER m
# 2. INTEGER... | 20.209302 | 63 | 0.609896 |
028899d9b9362d805eaaf995d8d5b6ab5fdb0574 | 2,143 | py | Python | unsupervised_learning/mean_shift.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | 3 | 2022-02-09T21:35:14.000Z | 2022-02-10T15:31:43.000Z | unsupervised_learning/mean_shift.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | unsupervised_learning/mean_shift.py | toorajtaraz/computational_intelligence_mini_projects | 79d1782c3b61ee15ac01dcf377bdc369962adb18 | [
"MIT"
] | null | null | null | from pathlib import Path
import sys
path = str(Path(Path(__file__).parent.absolute()).parent.absolute())
sys.path.insert(0, path)
from mnist_utils.util import _x, _y_int
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.metrics import accuracy_score, adjusted_rand_score
import numpy as np
from tabu... | 34.564516 | 79 | 0.691554 |
5a4d8599a6b23fb3a20384118632f2eb187ec964 | 1,318 | py | Python | display/_button_lights.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_button_lights.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | display/_button_lights.py | ihrigb/stagebuzzer | dbce1c5fa59a6f22e74d84ccc96d4d1a28a5b680 | [
"Apache-2.0"
] | null | null | null | from typing import Callable
class ButtonLights:
def enable_left(self):
self.set_left(True)
def enable_right(self):
self.set_right(True)
def enable_up(self):
self.set_up(True)
def enable_down(self):
self.set_down(True)
def disable_left(self):
self.set_lef... | 22.724138 | 69 | 0.62519 |
ce5a02f1a0718a8c7f69cc4ec28cf7555d2c666c | 7,550 | py | Python | scripts/deprecated_train_test_split.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 8 | 2018-03-09T16:44:38.000Z | 2021-04-07T11:33:30.000Z | scripts/deprecated_train_test_split.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 4 | 2020-03-24T15:34:54.000Z | 2021-06-01T21:54:33.000Z | scripts/deprecated_train_test_split.py | PyGeoL/GeoL | 67a5bd2f63091e19041094c14d419055fa5ce6f0 | [
"MIT"
] | 1 | 2020-05-13T14:30:55.000Z | 2020-05-13T14:30:55.000Z | """
Script to split a dataset in train+test sets.
"""
# Authors: Gianni Barlacchi <gianni.barlacchi@gmail.com> Michele Ferretti <mic.ferretti@gmail.com>
import argparse
import os
import math
import errno
import pandas as pd
import geopandas as gpd
from geopandas import GeoDataFrame
from shapely.geometry import Point
... | 33.856502 | 183 | 0.658013 |
cedb1c300d2c5801126e35cf1affc76c0d2341d3 | 9,463 | py | Python | cbm/utils/config.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 17 | 2021-01-18T07:27:01.000Z | 2022-03-10T12:26:21.000Z | cbm/utils/config.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 4 | 2021-04-29T11:20:44.000Z | 2021-12-06T10:19:17.000Z | cbm/utils/config.py | CsabaWirnhardt/cbm | 1822addd72881057af34ac6a7c2a1f02ea511225 | [
"BSD-3-Clause"
] | 47 | 2021-01-21T08:25:22.000Z | 2022-03-21T14:28:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : Konstantinos Anastasakis
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
import os
import time
import json
import uuid
from os.pat... | 33.556738 | 79 | 0.585861 |
0c6c99761c0aba562e74317023301aba2abb5fd4 | 420 | py | Python | crm/migrations/0002_auto_20201230_1855.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | 1 | 2021-01-23T21:42:10.000Z | 2021-01-23T21:42:10.000Z | crm/migrations/0002_auto_20201230_1855.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | crm/migrations/0002_auto_20201230_1855.py | baniasbaabe/happy-qr | bf44ac19306ea6405cc7c9a100e6f83afca125b4 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-12-30 17:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crm', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='auftrag',
name='preis',
field... | 22.105263 | 99 | 0.607143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.