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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
47c9d3eae68f99716d46ed4e550bc17deb51eaad | 167 | py | Python | Curso-Em-Video-Python/2Exercicios/007_ Media_Aritmetica.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/007_ Media_Aritmetica.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/007_ Media_Aritmetica.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | aluno1 = input('Digite seu nome: ')
n1 = float(input('Nota 1: '))
n2 = float(input('Nota 2: '))
media = (n1+n2)/2
print('A sua Media {} foi: {}'.format(aluno1, media)) | 33.4 | 53 | 0.610778 |
47d6d6466dea748cf9929bab3bb955a87f949d96 | 1,990 | py | Python | 21-fs-ias-lec/13-RaptorCode/src/fountain.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 21-fs-ias-lec/13-RaptorCode/src/fountain.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 21-fs-ias-lec/13-RaptorCode/src/fountain.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import math
import random
import numpy as np
import utils
from utils import VECTORLENGTH
class LT:
def __init__(self): # Initialize member fields
self._weights = [] # holds probability of the weights
self._setWeights() # sets the probability of the weights
"""if not LT._isBinomCalcul... | 39.8 | 103 | 0.58191 |
7bf67687493aa9ec552e759d85274e11e45f07e2 | 173 | py | Python | tests/context.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 156 | 2021-11-19T18:50:14.000Z | 2022-03-31T19:48:59.000Z | tests/context.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 30 | 2021-12-27T19:30:56.000Z | 2022-03-30T17:49:00.000Z | tests/context.py | monosidev/monosi | a88b689fc74010b10dbabb32f4b2bdeae865f4d5 | [
"Apache-2.0"
] | 14 | 2022-01-17T23:24:34.000Z | 2022-03-29T09:27:47.000Z | import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src')))
import ingestion
import pipeline
import scheduler
import server
| 19.222222 | 86 | 0.774566 |
d041fe22d104860bf9d526011ee79a05759a77e4 | 586 | py | Python | CareerTinderServer/CareerTinder/migrations/0005_relations_status.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | 1 | 2016-09-18T16:40:27.000Z | 2016-09-18T16:40:27.000Z | CareerTinderServer/CareerTinder/migrations/0005_relations_status.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | CareerTinderServer/CareerTinder/migrations/0005_relations_status.py | sarojaerabelli/HVGS | 86ec3d2de496540ca439c40f4a0c58c47aa181cf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-18 06:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('CareerTinder', '0004_relations_encounter_date'),
]
operations = [
migration... | 26.636364 | 137 | 0.614334 |
ef6a0423e4c1edcae110020f6a15a7bbd5a9a55d | 2,795 | py | Python | server/max_flow.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/max_flow.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | server/max_flow.py | khaledelemam/routescc-matching-app | 81cb0665e08f6608176060f5d768c673fed15398 | [
"MIT"
] | null | null | null | from random import shuffle
def get_path(network: dict, source: str, sink: str, seen=None) -> list:
"""
Returns a path with positive capacity from <source> to <sink>,
or None if there is no such path. This is done through a recursive DFS.
"""
if seen is None:
seen = set()
seen.add(sourc... | 30.714286 | 79 | 0.509839 |
4bd64f08c1563fa16353d822d748dfd89fc2198f | 356 | py | Python | flasktest/helloflask.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | flasktest/helloflask.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | flasktest/helloflask.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | import flask
app = flask.Flask(__name__)
@app.route('/hello')
@app.route('/hello/<name>')
def hello(name='World'):
return flask.render_template('hello_template.html', name=name, flavour='vanilla')
@app.route('/greetings')
def greetings():
return "Nice greetings"
if __name__ == '__main__':
... | 25.428571 | 86 | 0.657303 |
32285edce4220cb734c047d0c07a73320546a58d | 12,461 | py | Python | verto/tests/GlossaryLinkTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/tests/GlossaryLinkTest.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/tests/GlossaryLinkTest.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | import markdown
import re
from unittest.mock import Mock
from verto.VertoExtension import VertoExtension
from verto.processors.GlossaryLinkPattern import GlossaryLinkPattern
from verto.errors.ArgumentMissingError import ArgumentMissingError
from verto.tests.ProcessorTest import ProcessorTest
class GlossaryLinkTest(P... | 47.561069 | 138 | 0.714148 |
32af59b9c40fc73c7eb4a398178de565e35a080d | 309 | py | Python | app/label/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | 2 | 2019-06-24T08:34:39.000Z | 2019-06-27T12:23:47.000Z | app/label/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | app/label/models.py | pushyzheng/docker-oj-web | 119abae3763cd2e53c686a320af7f4f5af1f16ca | [
"MIT"
] | null | null | null | # encoding:utf-8
from app import db
from utils import ModelParent
class Label(db.Model, ModelParent):
__tablename__ = 'labels'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(36))
problem_id = db.Column(db.Integer, db.ForeignKey('problems.id'))
| 23.769231 | 68 | 0.718447 |
32c7f80df8ffdb6269c1c7f28a8a036c1e89579c | 201 | py | Python | repo/script.tv.show.next.aired/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 1 | 2017-11-26T18:18:46.000Z | 2017-11-26T18:18:46.000Z | repo/script.tv.show.next.aired/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | null | null | null | repo/script.tv.show.next.aired/service.py | dbiesecke/dbiesecke.github.io | 5894473591f078fd22d1cb33794c5e656ae9b8dd | [
"MIT"
] | 3 | 2019-09-30T19:52:05.000Z | 2020-04-12T21:20:56.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
script.tv.show.next.aired
TV Show - Next Aired
Main service entry point
'''
from resources.lib.main_service import MainService
MainService()
| 16.75 | 50 | 0.671642 |
f5da5d42f9211d75b746877d58a2fe0d8c549772 | 2,364 | py | Python | chillow/model/action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/model/action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/model/action.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import random
from enum import Enum
from itertools import product
from typing import Any, List, Tuple
class Action(Enum):
"""Enum to represent all possible actions which a player can perform to in a game."""
turn_left, turn_right, speed_up, slow_down, change_nothing = range(5)
@staticmethod
def get_... | 28.142857 | 104 | 0.621827 |
deab98682037fa5862e3be253346610a9c064cbe | 844 | py | Python | Challenge_3/challenge_3.py | joeherold/weekly_coding_challenge_fwkwkw_python | 5c2795fdf38970a387540141ad95408c527a7779 | [
"MIT"
] | 1 | 2020-05-15T13:43:16.000Z | 2020-05-15T13:43:16.000Z | Challenge_3/challenge_3.py | joeherold/weekly_coding_challenge_fwkwkw_python | 5c2795fdf38970a387540141ad95408c527a7779 | [
"MIT"
] | 4 | 2020-05-15T17:46:52.000Z | 2020-07-06T11:48:37.000Z | Challenge_3/challenge_3.py | joeherold/weekly_coding_challenge_fwkwkw_python | 5c2795fdf38970a387540141ad95408c527a7779 | [
"MIT"
] | null | null | null | '''
CHALLENGE #3
TODO MANAGER - READ WRITE FILES
'''
def removeTrailingNewLine(value):
return value.rstrip("\n")
def addTrailingNewLine(value):
return value + ("\n")
def readFileAndGetAsList(pathToFile):
f = open(pathToFile, "r")
if f.mode == 'r':
contents = f.readlines()
f.close()
return list(... | 24.823529 | 137 | 0.738152 |
7248d412a686a098b5e195d3d53b338f14cc4a04 | 1,993 | py | Python | src/onegov/activity/models/invoice_item.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/invoice_item.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/activity/models/invoice_item.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm import Base
from onegov.core.orm.mixins import TimestampMixin
from onegov.core.orm.types import UUID
from onegov.pay import PayableManyTimes
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Numeric
from sqlalchemy import Text
from... | 28.471429 | 79 | 0.712494 |
19d27b206b198b804812070fcbd7e40ef4cec412 | 496 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_status_as_paid_for_completed_expense_claim.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/update_status_as_paid_for_completed_expense_claim.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v8_0/update_status_as_paid_for_completed_expense_claim.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():
""" set status as Paid in Expense Claim if total_sactioned_amount
and total_amount_reimbursed is equal """
frapp... | 24.8 | 71 | 0.75 |
dfaaaad12f442fe94b400db00732c8e821343dc7 | 346 | py | Python | Packs/CommonScripts/Scripts/CalculateEntropy/CalculateEntropy_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/CalculateEntropy/CalculateEntropy_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/CalculateEntropy/CalculateEntropy_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from CalculateEntropy import calculate_shannon_entropy
def test_calculate_shannon_entropy():
_, context_result, _ = calculate_shannon_entropy('1234', 1)
assert context_result == {'EntropyResult': {'checked_value': '1234', 'entropy': 2.0}}
_, context_result, _ = calculate_shannon_entropy('1234', 3)
as... | 34.6 | 89 | 0.736994 |
dfc37e1f0f78d49d4c764dfd7d01b046ff1f6aed | 3,204 | py | Python | modules/Camera.py | NETMVAS/feecc-agent-geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-13T09:03:51.000Z | 2021-05-13T09:03:51.000Z | modules/Camera.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | null | null | null | modules/Camera.py | arseniiarsenii/robonomics_qa_geoscan | 93fc5766a4a2f588aaa173779bb6bd0928682e58 | [
"Apache-2.0"
] | 1 | 2021-05-24T15:45:01.000Z | 2021-05-24T15:45:01.000Z | import logging
import subprocess
import time
from os import path
import typing as tp
# set up logging
logging.basicConfig(
level=logging.INFO,
filename="agent.log",
format="%(asctime)s %(levelname)s: %(message)s"
)
class Camera:
def __init__(self, config: tp.Dict[str, tp.Dict[str, tp.Any]]) -> None:
... | 40.556962 | 117 | 0.647004 |
a04d6676c5acdb8f5147a5e0f83e0ccdb84e35f5 | 2,212 | py | Python | MzituCrawler/spiders/mzituSpiders.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | 1 | 2018-02-09T05:36:06.000Z | 2018-02-09T05:36:06.000Z | MzituCrawler/spiders/mzituSpiders.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | null | null | null | MzituCrawler/spiders/mzituSpiders.py | yeming1001/-MzituCrawler | 3e3dad298734658266fb4c12cd863be73eb4f4a2 | [
"Apache-2.0"
] | 1 | 2017-03-30T07:44:49.000Z | 2017-03-30T07:44:49.000Z | import scrapy
#from scrapy.contrib.spiders import CrawlSpider,Rule
#from scrapy.contrib.linkextractors import LinkExtractor
from scrapy.http import HtmlResponse
from scrapy.selector import Selector
from MzituCrawler.items import MzitucrawlerItem
import re
# 妹子图每日更新
class MzituSpider(scrapy.Spider):
name = 'mzitu.... | 33.515152 | 128 | 0.614828 |
a0a439d37cd51b32dc4a67db003065f34a5b75ab | 170 | py | Python | pwn/Welcome BOF/bof.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | 1 | 2019-06-15T11:45:41.000Z | 2019-06-15T11:45:41.000Z | pwn/Welcome BOF/bof.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | pwn/Welcome BOF/bof.py | killua4564/2019-AIS3-preexam | b13b5c9d3a2ec8beef7cca781154655bb51605e3 | [
"MIT"
] | null | null | null | from pwn import *
conn = remote("pre-exam-pwn.ais3.org", "10000")
conn.recvuntil(".\n")
payload = b"A" * 48 + p64(0x400687)
conn.sendline(payload)
conn.interactive() | 15.454545 | 47 | 0.676471 |
266e96129c62f9f5fa759ec79adcd1c2397632c5 | 1,923 | py | Python | haas_lib_bundles/python/libraries/uv/uv.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/uv/uv.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/uv/uv.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2015-2021 Alibaba Group Holding Limited
`HaaS Python UV sensor`
====================================================
A driver for uv sensor
* Author(s): HaaS Group
Implementation Notes
--------------------
**Hardware:**
* HaaS Python uv sensor:
https://haas.iot.aliyun.com/solution/detail/hardwa... | 19.039604 | 87 | 0.575663 |
26e3a0000b3bcff862cdf2ec95b98b0c767dfcb3 | 3,948 | py | Python | borza_vmesnik.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null | borza_vmesnik.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null | borza_vmesnik.py | rok-lindic/Borza | 430f8b177a40bf6494d934e36dd5e85c4367e394 | [
"MIT"
] | null | null | null |
from bottle import route, run, static_file, template, request, response, redirect
import borza_db
from borza_model import vlagatelj
import borza_model
@route('/nov_uporabnik', method = 'POST')
def logiranje():
uporabnik = request.forms.get('uporabnisko_ime')
geslo = request.forms.get('geslo')... | 42.451613 | 370 | 0.659321 |
f87c94a17938a525481fbe5b30eba798f84397b4 | 106 | py | Python | src/onegov/election_day/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.election_day.theme.election_day_theme import ElectionDayTheme
__all__ = ['ElectionDayTheme']
| 26.5 | 73 | 0.849057 |
f8d30cf2e6089382765171e69698df0fecd99867 | 1,375 | py | Python | audio.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | audio.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | audio.py | krillr/pfsk | 8957ae07443155464bf01337c8e5ca5960fd17f9 | [
"Apache-2.0"
] | null | null | null | import pyaudio, numpy
class Interface:
def __init__(self, samplerate=44100):
self.pa = pyaudio.PyAudio()
self.playback_device = 2
self.recording_device = 2
self.samplerate = samplerate
def get_devices(self):
for i in range(self.pa.get_device_count()):
yield ... | 40.441176 | 157 | 0.691636 |
3e509e419560a294e7b5d04128d1372354369830 | 227 | py | Python | Algorithms/Greedy/MaxMin.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Greedy/MaxMin.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/Greedy/MaxMin.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #coding:utf-8
N = int(raw_input())
K = int(raw_input())
ar = []
for _ in xrange(N):
ar.append(int(raw_input()))
ar.sort()
minmum = 10 ** 9
for i in xrange(K-1, N):
minmum = min(minmum, ar[i]-ar[i-K+1])
print minmum
| 14.1875 | 41 | 0.594714 |
e42c1ae698872ef056ea3f3d2552aecf3bab6ccf | 1,847 | py | Python | tests/test_tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | tests/test_tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | tests/test_tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | from decimal import Decimal
import pytest # type:ignore[import]
from bo4e.com.fremdkostenposition import Fremdkostenposition
from bo4e.com.tarifberechnungsparameter import Tarifberechnungsparameter, TarifberechnungsparameterSchema
from bo4e.enum.messpreistyp import Messpreistyp
from bo4e.enum.tarifkalkulationsmethod... | 36.94 | 105 | 0.743909 |
e48c34c96f30d2d92a3bc1c0940c21c6d89ea182 | 269 | py | Python | disciplina/views.py | Professor-Vanderson/LMS | 16a20223fe6956f7420bad4c1f817589fc013f09 | [
"Apache-2.0"
] | null | null | null | disciplina/views.py | Professor-Vanderson/LMS | 16a20223fe6956f7420bad4c1f817589fc013f09 | [
"Apache-2.0"
] | null | null | null | disciplina/views.py | Professor-Vanderson/LMS | 16a20223fe6956f7420bad4c1f817589fc013f09 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return render(request,'index.html')
'''def disciplina(request):
return render(request,'discplina.html')
def professor(request):
return render(request,'professor.html')''' | 24.454545 | 43 | 0.776952 |
5f9d260b0d6ac8b074580d53dffdcbe78ee4d9e7 | 1,152 | py | Python | src/test.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | 2 | 2020-03-25T15:48:48.000Z | 2022-02-02T18:36:24.000Z | src/test.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | null | null | null | src/test.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | null | null | null | from model import AE
import torch
from output_to_image import output_to_image
import cv2
from torchvision import transforms
from torch.utils.data import DataLoader
model_path = "./saves/2019-12-31 14_21_53-model-68000.pth"
img = "xxxx" # Es wird zwar ein rgb Bild erwartet, jedoch muss dieses zuerst einmal in Graysc... | 28.097561 | 163 | 0.689236 |
f2bfb5ada92fc6f066b76465866a77fee0a27594 | 457 | py | Python | myspiders/ruia/plugins/ua_ramdon2.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | 2 | 2021-11-27T06:40:47.000Z | 2022-01-06T03:12:46.000Z | myspiders/ruia/plugins/ua_ramdon2.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | myspiders/ruia/plugins/ua_ramdon2.py | zhouhongf/bank_hr | a42e5e18f3ec36b1ec65931415fe476c9690e0a0 | [
"MIT"
] | null | null | null | from myspiders.ruia.middleware import Middleware
middleware2 = Middleware()
@middleware2.request
async def print_on_request(spider_ins, request):
request.metadata = {"url": request.url}
print(f"在middleware2中请求的request: {request.metadata}")
# Just operate request object, and do not return anything.
@mi... | 26.882353 | 62 | 0.774617 |
29b1034890fea6d4a8b6f6e5027b406e6af6be0f | 2,544 | py | Python | Lib/IBtoGCode_Lib.py | eeMKeey/IBtoGCode | 11b307615a38d371f6e78b70373c4cfaa1b23bdb | [
"MIT"
] | null | null | null | Lib/IBtoGCode_Lib.py | eeMKeey/IBtoGCode | 11b307615a38d371f6e78b70373c4cfaa1b23bdb | [
"MIT"
] | null | null | null | Lib/IBtoGCode_Lib.py | eeMKeey/IBtoGCode | 11b307615a38d371f6e78b70373c4cfaa1b23bdb | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
def get_vs(df, rb_vs_const: bool, rb_vs_step: bool, par_vs: str, par_vs_gk: str, par_vs_ns: str,
par_slp_in: str, par_l_gk: str, par_l_ns: str, par_vs_trans: str):
vf = pd.DataFrame()
vf['Winkel'] = df['Winkel']
vf = vf.reset_index(drop=True)
... | 32.202532 | 96 | 0.617925 |
8a1c5cf6dc9965b1a36b7b977d0eb84d0e06c9fd | 3,506 | py | Python | research/cv/autoaugment/src/dataset/cifar10.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/cv/autoaugment/src/dataset/cifar10.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/cv/autoaugment/src/dataset/cifar10.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 31.303571 | 78 | 0.626925 |
8a53d1cacb3523db1027c243631165877dad7ec8 | 842 | py | Python | Python/B5-Schere-Stein-Papier/Schere-Stein-Papier.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B5-Schere-Stein-Papier/Schere-Stein-Papier.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B5-Schere-Stein-Papier/Schere-Stein-Papier.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Zufall = 0
def on_forever():
global Zufall
if input.button_is_pressed(Button.A):
basic.clear_screen()
Zufall = randint(1, 3)
else:
if Zufall == 1:
basic.show_leds("""
# . . . #
. # . # .
# . # . .
... | 25.515152 | 42 | 0.230404 |
8a6af217517eb6082f64edb60c27e31d897573ab | 352 | py | Python | test/fx2trt/core/test_import_fx2trt.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 5 | 2018-04-24T13:41:12.000Z | 2019-07-09T07:32:09.000Z | test/fx2trt/core/test_import_fx2trt.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 8 | 2020-05-17T10:23:03.000Z | 2022-02-28T12:47:56.000Z | test/fx2trt/core/test_import_fx2trt.py | vuanvin/pytorch | 9267fd8d7395074001ad7cf2a8f28082dbff6b0b | [
"Intel"
] | 7 | 2020-08-31T22:49:59.000Z | 2020-09-15T14:29:07.000Z | #!/usr/bin/env python3
# (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
import unittest as ut
# Test that this import should not trigger any error when run
# in non-GPU hosts, or in any build mode.
import torch.fx.experimental.fx2trt.lower as fxl # noqa: F401
class MainTests(ut.TestCase):
... | 25.142857 | 70 | 0.727273 |
8ab52cae88a4947bed663eae4dd9f7a00f33d1e8 | 2,392 | py | Python | official/nlp/textcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/nlp/textcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/nlp/textcnn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.542373 | 93 | 0.722408 |
8ac3afbcef38c8c9968999e6a15d5c6b39e3e173 | 1,325 | py | Python | stuff/woodwork/gallery/do_images.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | stuff/woodwork/gallery/do_images.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | stuff/woodwork/gallery/do_images.py | danja/danja.github.io | 26662fdf910b8121e14b8470fc4abb94707c574a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# http://www.pythonware.com/products/pil/
from PIL import Image
import os
path = "images/preferred/"
thumb_path = "images/thumbs/"
dirList=os.listdir(path)
gallery = ""
inline = ""
for filename in dirList:
# print "FILE="+filename
ext = filename[len(filename)-4:]
# print "EXT="+ext
if e... | 27.040816 | 91 | 0.578113 |
76ed8b9232d77a3d6cab5a138a852fce2273ebe9 | 5,846 | py | Python | files/meas/Experiment_03/int/rect.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/int/rect.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/int/rect.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 21 10:10:10 2021
@author: © Vadim Grebnev, Tim Hilker, Delphino Klinker
"""
import ltspice
import matplotlib.pyplot as plt
import matplotlib.ticker as mplt
import numpy as np
import redpitaya_scpi as scpi
from time import sleep as delay
#%% paths and adresses
filename... | 34.797619 | 77 | 0.639412 |
6a58424639a68fb960308d6cf63a74dc89f78979 | 42,192 | py | Python | mnda-main/mnda.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | mnda-main/mnda.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | mnda-main/mnda.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | #!/usr/bin/python2
# coding=utf-8
# code by Bangsat-XD
# my facebook ( https://www.facebook.com/AA.RAKA2708 )
# (C) Copyright 407 Authentic Exploit
# Rebuild Copyright Can't make u real programmer:)
# Coded By Bangsat-XD.
import os
try:
import requests
except ImportError:
print '\n [×] Modul re... | 48.329897 | 405 | 0.500237 |
0a72aac6cdb0580e93fe18c0ee9438674251a6dc | 2,657 | py | Python | python/oneflow/compatible/single_client/test/ops/test_TestMultiOutputOrder.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/ops/test_TestMultiOutputOrder.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/ops/test_TestMultiOutputOrder.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... | 32.802469 | 79 | 0.730523 |
0a9aadc4a0f111795a56c8fedbf48ca558d737da | 1,882 | py | Python | Classes/Screen_codes/file.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-04-30T15:46:47.000Z | 2018-04-30T15:46:47.000Z | Classes/Screen_codes/file.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T13:20:19.000Z | 2018-06-03T20:19:25.000Z | Classes/Screen_codes/file.py | EKaczmarek/BomberMan | a232d00ff0fe9be0a1276fba22c3f120e2bb4e5d | [
"MIT"
] | 1 | 2018-06-03T12:59:11.000Z | 2018-06-03T12:59:11.000Z | import json
import requests
URL = 'http://192.168.43.102:8080/api/ranking/'
AUTH = requests.auth.HTTPBasicAuth('debug', 'secret')
PLAYERS_COUNT = 4
new_statistics = {
'ela': {
'place': 1,
'bomb_set': 10,
'players_count': PLAYERS_COUNT,
'kills': 2
}
}
response = requests.post... | 24.763158 | 92 | 0.641339 |
7c39d7168416d4e12dd14c3e2d2a4cee8fe81c8c | 1,029 | py | Python | addition_module/DSDG/data/bbox.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | 1 | 2022-02-07T02:03:37.000Z | 2022-02-07T02:03:37.000Z | addition_module/DSDG/data/bbox.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | addition_module/DSDG/data/bbox.py | weihaoxie/FaceX-Zoo | db0b087e4f4d28152e172d6c8d3767a8870733b4 | [
"Apache-2.0"
] | null | null | null | from mtcnn import MTCNN
import cv2
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '3'
detector = MTCNN()
root_dir = '/export2/home/wht/oulu_images/train_img_flod/'
bbox_dir = '/export2/home/wht/oulu_images/train_bbox_flod/'
if not os.path.exists(bbox_dir):
os.makedirs(bbox_dir)
img_list = []
f =... | 27.810811 | 76 | 0.645287 |
7cd702a1860961ed843de2c0e8efa70e55adf4a9 | 6,293 | py | Python | extractor.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | null | null | null | extractor.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | 10 | 2016-06-21T17:25:23.000Z | 2016-07-19T09:07:02.000Z | extractor.py | phucdev/weatherbot | 2a88ebb5fb52cc8309f6ce133d850328320a5f5f | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
"""
Author: Phuc Tran Truong, Marcus Ding
Date: 19.07.2016
What it is supposed to do:
1. chop up the user input (tokenize)
2. extract location (NERTagger), datetime and type of request (check in dictionary), get a default argument if something is missing
3. send back the arguments
"""
import n... | 41.675497 | 767 | 0.649928 |
7cdb8280b08ec652de7b29b51177508818ff5fad | 855 | py | Python | python/en/_numpy/organize_this/test_LSTM_in_numpy_manually.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/organize_this/test_LSTM_in_numpy_manually.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_numpy/organize_this/test_LSTM_in_numpy_manually.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 25 23:09:06 2018
@author: the.kim
"""
import numpy as np
x = np.array( [[1.,1.,1.]] )
print("x=",x)
c = 0.1 * np.asarray( [[0,1]] )
h = 0.1 * np.asarray( [[2,3]] )
num_units = 2
args = np.concatenate( (x,h), axis=1 )
print(args)
out_size = 4 * num_units
proj_size = a... | 16.764706 | 47 | 0.597661 |
6b15cd5e3e370d8f827166518a09aedd90dd0339 | 7,573 | py | Python | .vscode/extensions/ms-toolsai.jupyter-2021.6.999406279/pythonFiles/vscode_datascience_helpers/dataframes/vscodeDataFrame.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | 2 | 2021-03-17T15:28:52.000Z | 2021-10-04T16:01:48.000Z | .vscode/extensions/ms-toolsai.jupyter-2021.6.999406279/pythonFiles/vscode_datascience_helpers/dataframes/vscodeDataFrame.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | 38 | 2021-03-19T16:21:22.000Z | 2022-03-31T03:12:59.000Z | .vscode/extensions/ms-toolsai.jupyter-2021.6.999406279/pythonFiles/vscode_datascience_helpers/dataframes/vscodeDataFrame.py | malbaker/dom_dotfiles | c452a9c8f86669f4f6289ddcd24e12690819991b | [
"MIT"
] | 1 | 2022-02-10T13:49:05.000Z | 2022-02-10T13:49:05.000Z | import pandas as _VSCODE_pd
import builtins as _VSCODE_builtins
import json as _VSCODE_json
import numpy as _VSCODE_np
import pandas.io.json as _VSCODE_pd_json
# PyTorch and TensorFlow tensors which can be converted to numpy arrays
_VSCODE_allowedTensorTypes = ["Tensor", "EagerTensor"]
def _VSCODE_stringifyElement(e... | 37.305419 | 116 | 0.643998 |
813c96102fb675ea5cb5f513980a50febac51093 | 2,710 | py | Python | EN_solutions/partition_hybrid_search/partition_import.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:22.000Z | 2021-01-11T18:40:22.000Z | EN_solutions/partition_hybrid_search/partition_import.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | EN_solutions/partition_hybrid_search/partition_import.py | naetimus/bootcamp | 0182992df7c54012944b51fe9b70532ab6a0059b | [
"Apache-2.0"
] | null | null | null | # import face_recognition
import os
import time
from milvus import *
import numpy as np
import random
from faker import Faker
fake = Faker()
# milvus = Milvus()
milvus_collection = 'partition_query'
FILE_PATH = 'bigann_base.bvecs'
VEC_NUM = 10000000
BASE_LEN = 100000
NUM = VEC_NUM // BASE_LEN
VEC_DIM = 128
SERVER... | 26.831683 | 129 | 0.670111 |
d49888da894293b9f2795916f4ba9bd00cde98de | 6,602 | py | Python | transformer.py | JACKYLUO1991/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 24 | 2019-09-01T09:02:59.000Z | 2022-03-22T08:38:16.000Z | transformer.py | HeroOneHY/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 2 | 2019-10-25T02:39:03.000Z | 2022-03-20T15:45:22.000Z | transformer.py | HeroOneHY/FaceLandmarks | 0e7eb636d25ba93e64cc3433a79239be51c883cc | [
"Apache-2.0"
] | 11 | 2019-10-25T01:36:18.000Z | 2021-04-09T06:51:58.000Z | # This algorithm is limited to algorithm verification
import argparse
import cv2
import os
import numpy as np
import pandas as pd
import sys
from tqdm import tqdm
from skimage import transform
from pprint import pprint
from mtcnn.mtcnn import MTCNN
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
... | 33.85641 | 107 | 0.594668 |
d49d381f0231ff50707e633a62242a60037db480 | 1,109 | py | Python | robolib/datamanager/datadir.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 2 | 2017-11-30T21:12:11.000Z | 2017-12-01T07:52:43.000Z | robolib/datamanager/datadir.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 14 | 2017-11-14T18:12:53.000Z | 2018-06-03T16:07:57.000Z | robolib/datamanager/datadir.py | Obyoxar/RobolabStatistics | 08343ca3ac49df7efdac33692d7cc4b783e851f5 | [
"MIT"
] | 3 | 2018-02-05T10:40:03.000Z | 2018-02-09T09:29:19.000Z | import os
__ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.join(os.path.abspath(__file__))), '..', '..'))
__DATA_DIR = os.path.join(__ROOT_DIR, 'data')
__MODEL_DIR = os.path.join(__DATA_DIR, 'models')
__CONVERTED_IMG_DIR = os.path.join(__DATA_DIR, 'converted')
__UNCONVERTED_IMG_DIR = os.path.join(__DA... | 25.790698 | 112 | 0.748422 |
ed86486df0d768f0a26952e3f4c5e93d179ca3e5 | 6,506 | py | Python | MAIN/STM32F405/V10/display.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V10/display.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | MAIN/STM32F405/V10/display.py | ozturkahmetcevdet/VSenst | 07c068fefcbd66ae4d8ec0480b4da10d6b5c7410 | [
"MIT"
] | null | null | null | from pyb import UART
import time
import register
class NextionCommand:
class Page:
Buffer = str()
Backup = str()
Repeat = False
Headline = "page "
Zero = "0"
FfV16 = "FfV16"
FVM19 = "FVM19"
f19 = "f19"
f20 = "f20"
M16 = "M16"
D... | 33.364103 | 107 | 0.604519 |
92dd99a2470072f08360e633f54a1eb3a618dccc | 727 | py | Python | Algorithms/Implementation/Save_the_Prisoner.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Save_the_Prisoner.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Algorithms/Implementation/Save_the_Prisoner.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/save-the-prisoner/problem?h_r=internal-search
# no of prisoner
n = 3
# no of candies
m = 7
# starting index
s = 3
# candies / n => remaining candies to distribute from index 0 and s -1 is add to remainder
print(m%n+(s-1))
c = m % n
k = (c+s-1) %n
if k == 0:
print(n)
else: ... | 17.309524 | 90 | 0.572215 |
132ea0682d7152225b06959f02b80a4e9ee56dec | 766 | pyde | Python | sketches/Fluffy_Fish/Fluffy_Fish.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/Fluffy_Fish/Fluffy_Fish.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/Fluffy_Fish/Fluffy_Fish.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from fish import Fish
from pipes import Pipe
fluffyFish = Fish()
pipes = []
def setup():
size(640, 320)
fluffyFish.loadPic()
pipe = Pipe()
pipes.append(pipe)
def draw():
background(0, 153, 204)
for i in range(len(pipes) - 1, -1, -1):
if pipes[i].offscreen():
pipes... | 20.157895 | 45 | 0.530026 |
167b990d26c37255ef08175334449bb7e54f9d28 | 2,310 | py | Python | tests/test_cookiecutter.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 14 | 2021-03-27T22:18:56.000Z | 2022-03-21T19:04:48.000Z | tests/test_cookiecutter.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | 33 | 2021-03-28T21:06:22.000Z | 2022-03-07T14:18:26.000Z | tests/test_cookiecutter.py | Kludex/fastapi-template | 47256eb8f8c7439a4d669172d94ce84c62cdb25a | [
"MIT"
] | null | null | null | """Test cookiecutter generation.
Reference:
- https://stackoverflow.com/questions/4187564/recursively-compare-two-directories-to-ensure-they-have-the-same-files-and-subdi
"""
import filecmp
import os
import subprocess
from pathlib import Path
import pytest
import yaml
def run_cookiecutter(root_dir: Path, tmp_path:... | 29.615385 | 126 | 0.652381 |
bc6e7ef01fe5ef10db691364543d7e0e6a8aae91 | 201 | py | Python | watchlist_app/urls.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | watchlist_app/urls.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | watchlist_app/urls.py | attachemd/moviedb | c2e3b7bc3c1537c64834c2ee94492122dafdfcd4 | [
"MIT"
] | null | null | null | from django.urls import path
from watchlist_app import views
urlpatterns = [
path('list/', views.movie_list, name='movie_list'),
path('<int:pk>', views.movie_details, name='movie_detail'),
]
| 22.333333 | 63 | 0.711443 |
bc99a102f7b3797daee2e3cf39320a2741ab1e45 | 9,803 | py | Python | Server/Server.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/Server.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | Server/Server.py | EiS94/Bewaesserungsanlage | 8edc0c8b5113219724b13c56fb296a003e83aad0 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
from flask import Flask, render_template, send_from_directory, send_file
from flask import request
import JsonWriter
import netifaces as ni
import sys
import signal
import wheaterData as wD
from _thread import start_new_thread
import time
from datetime import datetime
from flask import Markup
im... | 33.006734 | 191 | 0.653269 |
e6fa42c86e05547d7732966a03701710735df2a4 | 1,521 | py | Python | kts/core/backend/ray_middleware.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 18 | 2019-02-14T13:10:07.000Z | 2021-11-26T07:10:13.000Z | kts/core/backend/ray_middleware.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-02-17T14:06:42.000Z | 2019-09-15T18:05:54.000Z | kts/core/backend/ray_middleware.py | konodyuk/kts | 3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7 | [
"MIT"
] | 2 | 2019-09-15T13:12:42.000Z | 2020-04-15T14:05:54.000Z | import atexit
import os
from glob import glob
import ray
from kts.core.backend.address_manager import create_address_manager
from kts.core.backend.signal import create_signal_manager
from kts.settings import cfg
address_manager = None
signal_manager = None
heartbeat_handle = None
ray_session_filename = f'/tmp/kts.r... | 24.142857 | 113 | 0.732413 |
fc11a228076c42d1837198a986435ec63bb5dfa7 | 21,239 | py | Python | build/images/elfinfo.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | build/images/elfinfo.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | build/images/elfinfo.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2.7
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from contextlib import contextmanager
from collections import namedtuple
import argparse
import mmap
import os
import struct
import s... | 34.146302 | 80 | 0.502142 |
5d81645247ae736af156998a26f472907646e0bc | 5,075 | py | Python | Zhihu/NN/_extra/one/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | Zhihu/NN/_extra/one/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | Zhihu/NN/_extra/one/Networks.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import matplotlib.pyplot as plt
from Zhihu.NN._extra.Layers import *
from Zhihu.NN._extra.Optimizers import *
class NNDist:
NNTiming = Timing()
def __init__(self):
self._layers, self._weights, self._bias = [], [], []
self._w_optimizer = self._b_optimizer = None
self._current_dimensio... | 35 | 90 | 0.598621 |
5d1e1e56034cf5ab6b53e59ea0eef3e2f0814be5 | 11,502 | py | Python | Packs/XMatters/Integrations/xMatters/xMatters_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/XMatters/Integrations/xMatters/xMatters_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/XMatters/Integrations/xMatters/xMatters_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | # from xMatters import Client
# from typing import Any, Dict, Tuple, List, Optional, cast
# import unittest
def test_xm_trigger_workflow_command(requests_mock):
"""Tests trigger workflow command
:param requests_mock:
:return:
"""
from xMatters import Client, xm_trigger_workflow_command
# '7a... | 35.720497 | 105 | 0.48635 |
5d58cf2f43a5a51695082e723059adcc7abf87dc | 53,323 | py | Python | Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MicrosoftTeams/Integrations/MicrosoftTeams/MicrosoftTeams_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
import json
import pytest
from CommonServerPython import entryTypes
entryTypes['warning'] = 11
bot_id: str = '9bi5353b-md6a-4458-8321-e924af433amb'
tenant_id: str = 'pbae9ao6-01ql-249o-5me3-4738p3e1m941'
team_id: str = '19:21f27jk08d1a487fa0f5467779619827@thread.skype'
team_aad_id: st... | 35.430565 | 122 | 0.549556 |
53b957bc591c3d53fe05fd89eabc5aef3c1c9ba5 | 713 | py | Python | python/python_backup/PRAC_PYTHON/de1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/de1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/de1.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def iteminfo:
def__init__(self):
self.icode=0
self.item=null
self.price=0
self.qty=0
self.discount=0
self.netprice=0
def cal(self):
if self.qty<=10:
self.discount=0
if self.qty>=11 and self.qty<=20:
self.discount=15
if self.qty>=20:
self.discount=20
def buy(self,ic,in,pr,q):... | 20.970588 | 51 | 0.628331 |
53ba71b45b24fe5fc2fb76b251708034bda6a624 | 2,066 | py | Python | Integrations/python/test/testComboAggregateFactory.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | Integrations/python/test/testComboAggregateFactory.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | 1 | 2022-03-03T21:24:40.000Z | 2022-03-03T21:24:54.000Z | Integrations/python/test/testComboAggregateFactory.py | devinrsmith/deephaven-core | 3a6930046faf1cd556f62a914ce1cfd7860147b9 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
##############################################################################
# NOTE: the jvm should have been initialized, or this test will certainly fail
##############################################################################
import sys
... | 40.509804 | 109 | 0.620523 |
54f76711ed3edb232bf242f96357834aab18d61b | 44,740 | py | Python | tests/onegov/election_day/formats/election/test_wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/election_day/formats/election/test_wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import date
from io import BytesIO
from onegov.ballot import Election
from onegov.ballot import ProporzElection
from onegov.ballot import List
from onegov.election_day.formats import import_election_wabstic_proporz
from onegov.election_day.formats.election.wabstic_proporz import \
get_list_id_from_knr... | 33.363162 | 77 | 0.315042 |
72f7ba80ced52fbfd517672a5418133e646b9870 | 50 | py | Python | spotjuk/src/ext/database.py | EliasJuk/SpotJuk | 51ff417f1509d9ace96799e7d1be02c818c0abeb | [
"MIT"
] | null | null | null | spotjuk/src/ext/database.py | EliasJuk/SpotJuk | 51ff417f1509d9ace96799e7d1be02c818c0abeb | [
"MIT"
] | null | null | null | spotjuk/src/ext/database.py | EliasJuk/SpotJuk | 51ff417f1509d9ace96799e7d1be02c818c0abeb | [
"MIT"
] | null | null | null | def init_app(app):
def cadastrar():
return 0 | 16.666667 | 18 | 0.66 |
f4482745b4829e780c766d604da1bc6fe2f9c17d | 19,446 | py | Python | src/models/dependence.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | src/models/dependence.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | src/models/dependence.py | jejjohnson/hsic_alignment | 3c676a378008634576593abec3a4a01e7daf9218 | [
"MIT"
] | null | null | null | import os
import sys
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Tuple, Union
# Kernel Dependency measure
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.kernel_approximation import Nystroem, RBFSampler
from sklearn.metrics.pairwise import linear_kernel, ... | 31.213483 | 90 | 0.603466 |
f4731c55b4cc0fd6bf3d4bed5815f2db7ba79505 | 1,666 | py | Python | examples/GPIO-In-Out.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 7 | 2018-11-30T13:38:27.000Z | 2021-03-10T15:37:56.000Z | examples/GPIO-In-Out.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 5 | 2020-11-11T09:19:00.000Z | 2022-02-06T09:04:55.000Z | examples/GPIO-In-Out.py | RMGrau/PhyPiDAQ | e7ea08a0d5de9772a1a5e32ccd0ab1bfddf9ff54 | [
"BSD-2-Clause"
] | 16 | 2019-04-16T10:15:45.000Z | 2021-12-15T14:59:31.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''GPIO-In-Out.py
allgemeines Beispiel zur Ansteuerung der GPIO-Pins
Erzeugung einer Rechteckspannung am Ausgabe-Pin durch
Veraendern der Spannung am Eingabe-Pin
z.B. Steuerung einer Leuchtdiode über einen
lichtempfindlichen Widerstand (Hell-Dunkel-S... | 36.217391 | 77 | 0.656663 |
f480546ae6dba1c293ac7fbb3a6aac65734cedcd | 34,444 | py | Python | Packs/SymantecDLP/Integrations/SymantecDLP/SymantecDLP.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/SymantecDLP/Integrations/SymantecDLP/SymantecDLP.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/SymantecDLP/Integrations/SymantecDLP/SymantecDLP.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 *
from CommonServerUserPython import *
''' IMPORTS '''
from requests import Session
from zeep import Client, Settings
from zeep.transports import Transport
from requests.auth import AuthBase, HTTPBasicAuth
from zeep import helpers
from zeep.cache import Sqlit... | 43.989783 | 120 | 0.675386 |
22b86d9efcf7726ab5768c549510cb0fceba5ebe | 734 | py | Python | mythread.py | rikiru/SSAK | 37bba4379737815c6c761fa4022030063dff1f17 | [
"Apache-2.0"
] | null | null | null | mythread.py | rikiru/SSAK | 37bba4379737815c6c761fa4022030063dff1f17 | [
"Apache-2.0"
] | 1 | 2018-12-06T22:42:03.000Z | 2018-12-06T22:42:03.000Z | mythread.py | rikiru/SSAK | 37bba4379737815c6c761fa4022030063dff1f17 | [
"Apache-2.0"
] | null | null | null | import threading
import time
import json
def writeDataToLog():
json_data=open("last.json").read()
data = json.loads(json_data)
json_data2=open("log.json").read()
data2 = json.loads(json_data2)
data2['log'].append(data)
with open('log.json', 'w') as outfile:
json.dump(data2, outfile)
class checkWeight():
... | 24.466667 | 59 | 0.6703 |
6048943ae5c43f5e23bb94c5fec4c99e2f1e4c94 | 1,828 | py | Python | manage.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | manage.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | 4 | 2020-08-29T16:11:12.000Z | 2022-03-12T00:47:03.000Z | manage.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from flask_script import Manager,Shell
from flask_migrate import Migrate, MigrateCommand
from app import create_app, db
from app.models import ArticleType,Article, Plugin, Role,User,Js,DriverType
from gevent.wsgi import WSGIServer
app = create_app()
manager = Manager(app)
migrate = Migrate(app, d... | 36.56 | 117 | 0.725383 |
60d52892c87319088a3394a73d58789f49e3d348 | 1,856 | py | Python | sketches/avoider2/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/avoider2/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/avoider2/sprite.py | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from random import randint
tw = th = 36
class Sprite(object):
def __init__(self, posX, posY):
self.x = posX
self.y = posY
def checkCollision(self, otherSprite):
if (self.x < otherSprite.x + tw and otherSprite.x < self.x + tw
and self.y < otherSprite.y + th and otherSprite.... | 25.777778 | 77 | 0.502155 |
7164923bbb474e6e1460677b99021a9d915b7948 | 2,331 | py | Python | dijkstra/dijkstra-1.py | oakoneric/algorithmen-datenstrukturen-ws-19 | 45a30727753ad80eb91342a9cc689092ca81ded8 | [
"MIT"
] | 7 | 2019-10-24T05:51:25.000Z | 2020-03-30T23:31:44.000Z | dijkstra/dijkstra-1.py | oakoneric/algorithmen-datenstrukturen-ws-19 | 45a30727753ad80eb91342a9cc689092ca81ded8 | [
"MIT"
] | null | null | null | dijkstra/dijkstra-1.py | oakoneric/algorithmen-datenstrukturen-ws-19 | 45a30727753ad80eb91342a9cc689092ca81ded8 | [
"MIT"
] | 4 | 2020-01-16T16:57:32.000Z | 2020-02-03T01:16:13.000Z | # https://de.wikibooks.org/wiki/Algorithmensammlung:_Graphentheorie:_Dijkstra-Algorithmus
def dijkstra(knoten, kanten, start, ziel):
# knoten ist eine Liste von Knoten
# kanten ist eine Liste von 3-Tupeln:
# (knoten1, knoten2, kosten)
# start ist der Knoten, in dem die Suche startet
# ziel ist de... | 40.189655 | 91 | 0.607894 |
718cdf65ab4e26adbff2ba8946258f8969da9cec | 2,189 | py | Python | jburt/signal.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/signal.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | jburt/signal.py | jbburt/jburt | 7745491214ef2b665ca8d1fc526bc802a36985ff | [
"MIT"
] | null | null | null | """
Utility functions for processing signals/waveforms.
"""
import numpy as np
from scipy.interpolate import CubicSpline
from scipy.signal import welch
from .types import Numeric
def fwhm_spline(waveform: np.ndarray, upsample: int = 100) -> float:
"""
Compute full width at half-max using cubic spline interp... | 28.064103 | 76 | 0.638191 |
460c617ad40d698f6d9e4e211ed6ef84f790d6b8 | 3,210 | py | Python | lib/widgets/controls.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/controls.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | lib/widgets/controls.py | moreorem/graphdener | ad8a4b98ad79afb2da820248d656384614721882 | [
"BSD-3-Clause"
] | null | null | null | from PyQt5.QtWidgets import (QWidget, QPushButton, QVBoxLayout, QCheckBox, QFrame)
from ..services.actions import Call
from lib.widgets.wizard import ImportWizard
# from .elements.algoptions import AlgorithmControl
# from .elements.graphctrl import GraphControl
from .elements import (AlgorithmControl, GraphControl, Alg... | 33.789474 | 100 | 0.677259 |
4616371ee8d138ffe93b13eb8223fb069241c146 | 4,575 | py | Python | Tests/Marketplace/private_build_prepare_for_testing.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Tests/Marketplace/private_build_prepare_for_testing.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Tests/Marketplace/private_build_prepare_for_testing.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import argparse
import os
from Tests.Marketplace.marketplace_services import init_storage_client, Pack
from Tests.Marketplace.marketplace_constants import GCPConfig
from Tests.private_build.upload_packs_private import extract_packs_artifacts
from demisto_sdk.commands.common.tools import str2bool
from Tests.scripts.uti... | 54.464286 | 124 | 0.696393 |
1cd85f7164fadb08f0b1983a608f8d6a9ac13b89 | 1,079 | py | Python | tests/test_tipc/benchmark/modules/model_base.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/test_tipc/benchmark/modules/model_base.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | tests/test_tipc/benchmark/modules/model_base.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import paddle
from paddlenlp.utils.log import logger
class BenchmarkBase(object):
def __init__(self):
self.num_batch = 0
@staticmethod
def add_args(args, parser):
parser = parser.add_argument_group()
def create_data_loader(self, args, **kwargs):
raise NotImplementedError
... | 28.394737 | 140 | 0.573679 |
1c294ea9dc2e426986f33c9d77e7dcaf06275fe6 | 745 | py | Python | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2015-12-16T04:01:03.000Z | 2015-12-16T04:01:03.000Z | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 1 | 2016-02-09T06:00:07.000Z | 2016-02-09T07:20:13.000Z | leetcode/340-Longest-Substring-with-At-Most-K-Distinct-Characters/LgstSubstrMostKChr_001.py | cc13ny/all-in | bc0b01e44e121ea68724da16f25f7e24386c53de | [
"MIT"
] | 2 | 2019-06-27T09:07:26.000Z | 2019-07-01T04:40:13.000Z | class Solution(object):
def lengthOfLongestSubstringKDistinct(self, s, k):
"""
:type s: str
:type k: int
:rtype: int
"""
res = 0
i, j = 0, 0
cnt = 0
chrs = {ch: [] for ch in set(s)}
while j < len(s) or cnt > k:
if cnt <= k:
... | 26.607143 | 54 | 0.339597 |
40ba75894b430f19e7d269353f8ebfd967123964 | 1,043 | py | Python | Project Euler Qusetions 41 - 50/Project Euler Question 47.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Qusetions 41 - 50/Project Euler Question 47.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Qusetions 41 - 50/Project Euler Question 47.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Question 47
#Distinct primes factors
def prime_factorization(x, prime_list):
pf_list = set()
prime_index = 0
check = x
for var in range(0, check):
if (check != 1):
factor = prime_list[prime_index]
if (check % factor != 0):
if factor > ((x... | 26.74359 | 56 | 0.513902 |
9091e87713ffc2f05b44de91252c34d7c072ae9c | 348 | py | Python | python/decorator/registering_plugins.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/registering_plugins.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/decorator/registering_plugins.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | PLUGINS = dict()
def register(func):
PLUGINS[func.__name__] = func
return func
@register
def add(a, b):
return a + b
@register
def multiply(a, b):
return a * b
def operation(func_name, a, b):
func = PLUGINS[func_name]
return func(a, b)
print(PLUGINS)
print(operation('add', 2, 3))
print(... | 13.92 | 34 | 0.637931 |
290cf33029ceeb06af14e5a1fb0d4b6541afb0f9 | 554 | py | Python | exercises/es/exc_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/exc_02_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/exc_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("es_core_news_sm")
doc = nlp("Por Berlín fluye el río Esprea.")
# Obtén todos los tokens y los part-of-speech tags
token_texts = [token.text for token in doc]
pos_tags = [token.pos_ for token in doc]
for index, pos in enumerate(pos_tags):
# Revisa si el token actual es un nombre pro... | 32.588235 | 73 | 0.66787 |
6f56c1de187a9ec0a69c8b901876cdc01f0e341d | 174 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.1-1-random-modilue.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.1-1-random-modilue.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-010/pg-10.1-1-random-modilue.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | import random
print(random.random())
print(random.random())
print(random.random())
print(random.randint(10, 50))
print(random.randint(10, 50))
print(random.randint(10, 50))
| 19.333333 | 29 | 0.741379 |
48fc1597439219414ffda4ec62a2ececc54d72f0 | 826 | py | Python | migrations/versions/f94690e0b957_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | migrations/versions/f94690e0b957_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | 35 | 2022-01-24T22:15:59.000Z | 2022-03-31T15:01:35.000Z | migrations/versions/f94690e0b957_.py | DanielGrams/cityservice | c487c34b5ba6541dcb441fe903ab2012c2256893 | [
"MIT"
] | null | null | null | """empty message
Revision ID: f94690e0b957
Revises: c8588d8786c0
Create Date: 2022-02-11 17:05:33.632735
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f94690e0b957"
down_revision = "c8588d8786c0"
branch_labels = None
depends_on = None
def upgrade():
op.... | 23.6 | 86 | 0.696126 |
d2fdbd37e7558fc84e4f0f61d304a35eae227b54 | 349 | py | Python | Python-Fundamentals/numbers.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/numbers.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | Python-Fundamentals/numbers.py | dechevh/SoftwareUniversity | 8be1c0c096cf385a84093265a31767afd4454476 | [
"MIT"
] | null | null | null | single_numbers = input().split(" ")
sum_numbers = 0
top_numbers = []
for x in single_numbers:
sum_numbers += int(x)
average_value = sum_numbers / len(single_numbers)
for x in single_numbers:
if int(x) > average_value:
top_numbers.append(str(x))
best_five = list((sorted(top_numbers)))
res = best_fi... | 18.368421 | 49 | 0.681948 |
7d58d033f618bb8fa19dd7d8fc92c3e5cbd0c75a | 385 | py | Python | pacman-termux/test/pacman/tests/scriptlet002.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/scriptlet002.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/scriptlet002.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Scriptlet test (pre/post remove)"
p1 = pmpkg("dummy")
p1.files = ['etc/dummy.conf']
p1.install['pre_remove'] = "echo foobar > pre_remove"
p1.install['post_remove'] = "echo foobar > post_remove"
self.addpkg2db("local", p1)
self.args = "-R %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule... | 27.5 | 55 | 0.719481 |
7dcd7484499338f75fcce2752efb5c4dd3263062 | 871 | py | Python | nz_crawl_demo/day1/python3/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day1/python3/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day1/python3/demo2.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | #encoding:utf-8
# import sys
# print sys.version 打印python的版本
import urllib.parse
from urllib import request
def baidu(params):
url = "https://www.baidu.com/s?" + params
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Saf... | 24.885714 | 140 | 0.65442 |
81602bf9d3e8a4286ae01ed8c7505a20147c11b8 | 281 | py | Python | Online-Judges/LeetCode/1365.How_Many_Numbers_Are_Smaller_Than_the_Current_Number.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | 3 | 2021-06-15T01:19:23.000Z | 2022-03-16T18:23:53.000Z | Online-Judges/LeetCode/1365.How_Many_Numbers_Are_Smaller_Than_the_Current_Number.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | Online-Judges/LeetCode/1365.How_Many_Numbers_Are_Smaller_Than_the_Current_Number.py | shihab4t/Competitive-Programming | e8eec7d4f7d86bfa1c00b7fbbedfd6a1518f19be | [
"Unlicense"
] | null | null | null | class Solution:
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
ans = []
for ith in nums:
ct = 0
for jth in nums:
if jth < ith:
ct += 1
ans.append(ct)
return ans
| 25.545455 | 70 | 0.441281 |
81603b5cae7a96dba1d7cd1e642694265f288d84 | 3,163 | py | Python | python_experiments/data_analysis/parallel_statistics/previous_data_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/parallel_statistics/previous_data_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/parallel_statistics/previous_data_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import json
import os
from data_analysis.parallel_statistics.generate_parallel_speedup_md import format_str
rlp_old_tag = 'rlp-old'
flp_old_tag = 'flp-old'
pcg_tag = 'pcg'
cw_tag = 'mcap'
lin_tag = 'lind'
if __name__ == '__main__':
data_set_lst = [
'ca-GrQc', 'ca-HepTh', 'p2p-Gnutella06', 'wiki-Vote',
... | 44.549296 | 119 | 0.648751 |
c4b58f97f4cc6c07df901672a3ed545db133ae24 | 254 | py | Python | lanzino/urls.py | linemax/lanz | c7f6eb150c260f088faa8255f0b15fcc9435c4af | [
"Apache-2.0"
] | null | null | null | lanzino/urls.py | linemax/lanz | c7f6eb150c260f088faa8255f0b15fcc9435c4af | [
"Apache-2.0"
] | null | null | null | lanzino/urls.py | linemax/lanz | c7f6eb150c260f088faa8255f0b15fcc9435c4af | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('lanz/', include('lanz.urls', namespace='lanz')),
path('account/', include('account.urls', namespace='account')),
]
| 28.222222 | 67 | 0.681102 |
f2085ce4df6248389e963cd0fd3a17605aca7fb6 | 1,879 | py | Python | frappe-bench/apps/erpnext/erpnext/patches/v4_0/update_user_properties.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/update_user_properties.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/patches/v4_0/update_user_properties.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
import frappe.permissions
import frappe.defaults
def execute():
frappe.reload_doc("core", "doctype", "docfield")
frappe.reload_doc("hr"... | 36.134615 | 116 | 0.735498 |
485801a83d56386b25f8590eede405d98e03ee5a | 771 | py | Python | Algorithms/3_Strings/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | 1 | 2021-11-25T13:39:30.000Z | 2021-11-25T13:39:30.000Z | Algorithms/3_Strings/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | Algorithms/3_Strings/10.py | abphilip-codes/Hackerrank_DSA | bb9e233d9d45c5b14c138830602695ad4113fba4 | [
"MIT"
] | null | null | null | # https://www.hackerrank.com/challenges/caesar-cipher-1/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'caesarCipher' function below.
#
# The function is expected to return a STRING.
# The function accepts following parameters:
# 1. STRING s
# 2. INTEGER k
#
def c... | 19.275 | 69 | 0.607004 |
fb7d6ce84651044015cf32726ca4fd230556e84a | 969 | py | Python | matbench/tests/test_metadata.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 15 | 2021-11-01T09:02:19.000Z | 2022-03-19T10:59:41.000Z | matbench/tests/test_metadata.py | sparks-baird/matbench | 4424609454286e32fff2bcc724379b2a316c5a76 | [
"MIT"
] | 62 | 2021-09-20T14:09:59.000Z | 2022-03-30T19:03:22.000Z | matbench/tests/test_metadata.py | ardunn/matbench | 7d11a2d63766339ec00e610e2255be29b81544d3 | [
"MIT"
] | 4 | 2021-03-22T10:37:42.000Z | 2021-07-20T14:11:28.000Z | import unittest
from matbench.constants import CLF_KEY, REG_KEY
from matbench.metadata import mbv01_metadata, mbv01_validation
class TestMetadata(unittest.TestCase):
def test_mbv01_metadata(self):
# for matbench v0.1
for ds, metadata in mbv01_metadata.items():
for key in ["task_type"... | 34.607143 | 78 | 0.635707 |
793d0e083189c19fe139aebea510eb0a0a1d8b12 | 3,521 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/module_utils/network/edgeswitch/edgeswitch_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/module_utils/network/edgeswitch/edgeswitch_interface.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/module_utils/network/edgeswitch/edgeswitch_interface.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | 38.271739 | 114 | 0.638455 |
580d13ac77a0e03f8596afdbfb899aa61a9bbcb5 | 545 | py | Python | Contests/The Mirror.py | MastaCoder/Projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 5 | 2018-10-11T01:55:40.000Z | 2021-12-25T23:38:22.000Z | Contests/The Mirror.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | null | null | null | Contests/The Mirror.py | MastaCoder/mini_projects | ebb0a3134522b12f052fec8d753005f384adf1b1 | [
"MIT"
] | 1 | 2019-02-22T14:42:50.000Z | 2019-02-22T14:42:50.000Z | import math
def isnumprime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
sqr = int(math.sqrt(n)) + 1
for divisor in range(3, sqr, 2):
if n % divisor == 0:
return False
return True
num = int(input())
lengths = [[0]*2 for n in range(num)]
amount... | 24.772727 | 59 | 0.526606 |
586b4e404eb7d9a6d58d7b33dd91e052533b1286 | 5,001 | py | Python | src/pfun/trampoline.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 126 | 2019-09-16T15:28:20.000Z | 2022-03-20T10:57:53.000Z | src/pfun/trampoline.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 54 | 2019-09-30T08:44:01.000Z | 2022-03-20T11:10:00.000Z | src/pfun/trampoline.py | suned/pfun | 46c460646487abfef897bd9627891f6cf7870774 | [
"MIT"
] | 11 | 2020-01-02T08:32:46.000Z | 2022-03-20T11:10:24.000Z | from abc import ABC, abstractmethod
from typing import Callable, Generic, Iterable, TypeVar, cast
from .functions import curry
from .immutable import Immutable
from .monad import Monad, filter_m_, map_m_, sequence_
A = TypeVar('A')
B = TypeVar('B')
C = TypeVar('C')
class Trampoline(Immutable, Generic[A], Monad, ABC... | 26.321053 | 77 | 0.586283 |
545e2039f7da7bdc066a1dd4be873ef21c09dd42 | 579 | py | Python | code/sensors/bluetooth/bluetooth_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/bluetooth/bluetooth_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | code/sensors/bluetooth/bluetooth_pipelines.py | dieterpl/iDogstra | 62ee246763e107335b9caf0a4f96239fa0953234 | [
"MIT"
] | null | null | null | from sensors.bluetooth import bluetooth
from sensors import pipeline
import config
def recommended_speed_pipeline(bt_dongles):
return pipeline.PipelineSequence(
pipeline.ConstantPipeline(bt_dongles),
bluetooth.SnapshotBTDataPipeline(),
("bt_speed",bluetooth.RecommendedSpeedPipeline())
... | 28.95 | 68 | 0.759931 |
3fad1e652b9d610a6a4ff60753e4a35766b3105d | 861 | py | Python | Contrib-Microsoft/Olympus_rack_manager/python-ocs/rackmanager/legacy/__init__.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/legacy/__init__.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/legacy/__init__.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 sys... | 30.75 | 84 | 0.770035 |
4d049febd154bde480716bb7a0fd00f949e28783 | 3,268 | py | Python | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/save_model.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,045 | 2019-05-09T02:50:43.000Z | 2022-03-31T06:22:11.000Z | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/save_model.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,468 | 2019-05-16T00:48:18.000Z | 2022-03-08T04:12:44.000Z | contrib/华为云垃圾分类大赛心得与案例-GitLD/src_Xception_all_aug+TTA/save_model.py | huaweicloud/ModelArts-Lab | 75d06fb70d81469cc23cd422200877ce443866be | [
"Apache-2.0"
] | 1,077 | 2019-05-09T02:50:53.000Z | 2022-03-27T11:05:32.000Z | # -*- coding: utf-8 -*-
import os
import tensorflow as tf
from keras import backend
from keras.optimizers import adam
from moxing.framework import file
from train import model_fn
def load_weights(model, weighs_file_path):
if os.path.isfile(weighs_file_path):
print('load weights from %s' % w... | 41.897436 | 97 | 0.665851 |
127db6b850b4466b0be5ecf695fbbadcea9e6222 | 519 | py | Python | exercises/zh/test_02_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/test_02_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/test_02_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert "token_texts" not in __solution__, "你是否删除了token_texts变量?"
assert "pos_tags" not in __solution__, "你是否删除了pos_tags变量?"
assert (
"token.pos_ ==" in __solution__
), "你有检查词符的词性标注结果是专有名词吗?"
assert (
"token.i + 1" in __solution__ or "1 + token.i" in __solution__
), "你... | 34.6 | 70 | 0.645472 |
12de0faf0245f6416422e8688a717087a5103d2c | 577 | py | Python | source/pkgsrc/devel/py-ipython/patches/patch-setupbase.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/devel/py-ipython/patches/patch-setupbase.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/devel/py-ipython/patches/patch-setupbase.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-setupbase.py,v 1.3 2019/08/03 12:31:47 adam Exp $
Honor PKGMANDIR
--- setupbase.py.orig 2019-07-26 21:57:01.000000000 +0000
+++ setupbase.py
@@ -162,10 +162,7 @@ def find_data_files():
Just man pages at this point.
"""
- if "freebsd" in sys.platform:
- manpagebase = pjoin('man', '... | 30.368421 | 76 | 0.613518 |
42487563ff624eeec136fe8afcc71635cb38a88d | 4,023 | py | Python | test/test_npu/test_network_ops/test_reshape_copy.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_reshape_copy.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_reshape_copy.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 40.636364 | 112 | 0.593587 |
6731938a48aefb041a0eca0fb866056a2048e311 | 287 | py | Python | algorithms/sorting/quicksort1.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/sorting/quicksort1.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | algorithms/sorting/quicksort1.py | PlamenHristov/HackerRank | 2c875995f0d51d7026c5cf92348d9fb94fa509d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
def partition(ar):
return [n for n in ar if n < ar[0]] + [n for n in ar if n >= ar[0]]
if __name__ == '__main__':
n = int(sys.stdin.readline())
ar = list(map(int, sys.stdin.readline().split()))
print(' '.join(map(str, partition(ar)))) | 23.916667 | 71 | 0.595819 |
67fa0e827d5fe763abf18c10bf209b5e88c5bfea | 7,249 | py | Python | experiments/sumo_rl/environment/traffic_signal.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | experiments/sumo_rl/environment/traffic_signal.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | experiments/sumo_rl/environment/traffic_signal.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import traci
import numpy as np
class TrafficSignal:
"""
This class represents a Traffic Signal of a... | 42.145349 | 147 | 0.616361 |
c0534dee4e60358c365f344fb7f5645341bb1421 | 5,257 | py | Python | kocha/shared.py | f1nan/kocha | 9b99c0add1fe1c85b11d68dd04d56e90112835ec | [
"MIT"
] | null | null | null | kocha/shared.py | f1nan/kocha | 9b99c0add1fe1c85b11d68dd04d56e90112835ec | [
"MIT"
] | null | null | null | kocha/shared.py | f1nan/kocha | 9b99c0add1fe1c85b11d68dd04d56e90112835ec | [
"MIT"
] | null | null | null | """
Modul mit Klassen und Methoden, die sowohl vom KOCHA-Client als auch
vom KOCHA-Server verwendet werden.
"""
import json
import sys
from datetime import datetime
KOCHA_VERSION = "v1.0.0"
"""
Die aktuelle Versionsnummer des KOCHA-Servers und des KOCHA-Clients.
"""
KOCHA_BUFSIZE = 4096
"""
Die maximale Anzahl an By... | 25.896552 | 73 | 0.610805 |
fbe750f2e42315c552db052acdc30f55ed4e7896 | 689 | py | Python | pacman-arch/test/pacman/tests/sync140.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/sync140.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/sync140.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sysupgrade with ignored package prevent other upgrade"
lp1 = pmpkg("glibc", "1.0-1")
lp2 = pmpkg("gcc-libs", "1.0-1")
lp2.depends = ["glibc>=1.0-1"]
lp3 = pmpkg("pcre", "1.0-1")
lp3.depends = ["gcc-libs"]
for p in lp1, lp2, lp3:
self.addpkg2db("local", p)
sp1 = pmpkg("glibc", "1.0-2")
sp2 = pmpk... | 25.518519 | 74 | 0.642961 |
2215da6b5dd4a2c4726413f23b513dfc9ccce887 | 462 | py | Python | begin-python/cp16/test_chapter16.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | 3 | 2021-08-04T07:59:48.000Z | 2022-03-26T23:58:17.000Z | begin-python/cp16/test_chapter16.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | begin-python/cp16/test_chapter16.py | Jocs/reading-notes | 26b8331877a2de034b8860bc3e3967893112d52d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*-
import unittest, chapter16
class SquareTestCase(unittest.TestCase):
def testInterers(self):
for x in xrange(-10, 10):
p = chapter16.square(x)
self.failUnless(p == x * x, 'interger square failed')
def testFloat(self):
for x in xrange(-10, 10):
x... | 27.176471 | 59 | 0.627706 |
3f60393da2e642aacb3ce34dec1575f9ebdd8ccb | 524 | py | Python | movie/urls.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/urls.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/urls.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'movie'
urlpatterns = [
path(
'crear/',
views.MovieCreateView.as_view(),
name='create',
),
path(
'detalle/<int:pk>/',
views.MovieDetailView.as_view(),
name='detail',
),
path(
'act... | 16.903226 | 40 | 0.519084 |
189c87e347717ecde7de924fdbacde71ee4dae5d | 635 | py | Python | day49/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day49/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day49/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template
import requests
from post import Post
app = Flask(__name__)
posts = requests.get("https://api.npoint.io/5abcca6f4e39b4955965").json()
post_objects = []
for post in posts:
post_obj = Post(post["id"], post["title"], post["subtitle"], post["body"])
post_objects.append(pos... | 21.896552 | 78 | 0.691339 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.