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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
009c7b1bf96e9a8214b5eb34b8fbe582750acd85 | 4,843 | py | Python | pythonProj/FZPython/pyquant/strategies/entermarketstrategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/strategies/entermarketstrategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | null | null | null | pythonProj/FZPython/pyquant/strategies/entermarketstrategy.py | iHamburg/FZQuant | 86b750ec33d01badfd3f324d6f1599118b9bf8ff | [
"MIT"
] | 2 | 2019-04-10T10:05:00.000Z | 2021-11-24T17:17:23.000Z | #!/usr/bin/env python
import backtrader as bt
import datetime
from backtrader.indicators import MovingAverageSimple
import backtrader.indicators as btind
from pyquant.strategies.fzstrategy import FZStrategy
class SingleSMAStrategy(FZStrategy):
params = dict(period=20)
def __init__(self):
super(Sing... | 31.245161 | 103 | 0.584142 |
009f903a7226bf5bfe7647c3b686e6e33c3f9d4d | 870 | py | Python | chapter100/meilisearch_01.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter100/meilisearch_01.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | chapter100/meilisearch_01.py | thiagola92/learning-databases-with-python | cf23c34d7fd1ecd36dd3e7b30dc5916eb23eaf1e | [
"MIT"
] | null | null | null | import time
from datetime import datetime
from meilisearch import Client
start = datetime.now()
client = Client("http://127.0.0.1:7700", "password")
client.create_index("index_name")
_id = 0
with open("utils/trash.csv") as file:
for line in file.readlines():
name, description = line.split(",")
... | 20.232558 | 54 | 0.558621 |
977b7680cf1ed04ab2d80331a9e0f2ba70bb89ed | 1,132 | py | Python | backend/migrations/versions/0b2aa96179b4_.py | Marcuse7/openschufa | 6a44ddca9eda0d2fde7103d4ae76d7e1ac3ee40e | [
"MIT"
] | 46 | 2018-05-16T05:52:29.000Z | 2021-12-10T14:52:52.000Z | backend/migrations/versions/0b2aa96179b4_.py | algorithmwatch/2018-openschufa | 6a44ddca9eda0d2fde7103d4ae76d7e1ac3ee40e | [
"MIT"
] | 45 | 2018-05-10T05:56:44.000Z | 2020-09-04T18:41:48.000Z | backend/migrations/versions/0b2aa96179b4_.py | algorithmwatch/2018-openschufa | 6a44ddca9eda0d2fde7103d4ae76d7e1ac3ee40e | [
"MIT"
] | 8 | 2018-05-16T05:38:46.000Z | 2020-06-29T09:00:14.000Z | """empty message
Revision ID: 0b2aa96179b4
Revises:
Create Date: 2018-04-11 09:52:21.058640
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '0b2aa96179b4'
down_revision = None
branch_labels = None
depends_on = None
d... | 27.609756 | 94 | 0.676678 |
68d521b15abf9cf736bc2516731d4c4a625942b9 | 239 | py | Python | attach/utils.py | ericdev-202/attachment-mgt-system | a9616886e855fd18e0d3da7664aff9602c0eb14c | [
"MIT"
] | null | null | null | attach/utils.py | ericdev-202/attachment-mgt-system | a9616886e855fd18e0d3da7664aff9602c0eb14c | [
"MIT"
] | null | null | null | attach/utils.py | ericdev-202/attachment-mgt-system | a9616886e855fd18e0d3da7664aff9602c0eb14c | [
"MIT"
] | null | null | null | from django.conf import settings
# returns numb turn credential and username
def get_turn_info():
return {
'numb_turn_credential': settings.NUMB_TURN_CREDENTIAL,
'numb_turn_username': settings.NUMB_TURN_USERNAME,
} | 29.875 | 62 | 0.74477 |
ec2e9ea44d58a499d4ffef56b92f62922064ca48 | 8,277 | py | Python | plotting/scripts/plot_heatmap.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_heatmap.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | plotting/scripts/plot_heatmap.py | metxchris/MMM-Explorer | 251b4d7af56241882611bc47e94ec2923e4be8da | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""Experimental script for plotting heatmaps
This has been replaced by plot_contour.py, and has been left here for
reference
"""
# Standard Packages
import sys; sys.path.insert(0, '../'), sys.path.insert(0, '../../')
import logging
import io
# 3rd Party Packages
import numpy as np
import matplotl... | 32.845238 | 145 | 0.637308 |
6b8262da55354def7404f4cacb6d038bd5d1dd38 | 307 | py | Python | python/coursera_python/MICHIGAN/DATABASES/week1/2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/coursera_python/MICHIGAN/DATABASES/week1/2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/coursera_python/MICHIGAN/DATABASES/week1/2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class PartyAnimal:
x = 0
#constructor
def __init__(self):
print("I am constructed")
def party(self):
self.x = self.x + 1
print("So far",self.x)
def __del__(self):
#destructor
print('I am destructed',self.x)
an = PartyAnimal()
an.party()
an.party()
an.party()
an = 42
print('an contains',an)
| 16.157895 | 33 | 0.661238 |
6bbe72ac36f5027d6b6bfb5e5aa3243d5832ed12 | 7,008 | py | Python | src/onegov/fsi/layouts/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/fsi/layouts/course.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.elements import Link, Confirm, Intercooler
from onegov.fsi.collections.audit import AuditCollection
from onegov.fsi.collections.course import CourseCollection
from onegov.fsi.collections.course_event import CourseEventCollection
from onegov.fsi.layout import... | 29.078838 | 78 | 0.535959 |
d85af0469397e33abbf84f5b2bee729b02df37c2 | 2,913 | py | Python | py-td3-cinema/storage/struct.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/storage/struct.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | py-td3-cinema/storage/struct.py | HuguesGuilleus/istyPOO | f460665799be2b2f34a1ebaa9878e06bb028a410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
from hashlib import sha256
import json
class Struct:
"""Un classe pour standardiser une structure, ainsi tous accès en lecture
ou écriture à des champs non définis à l'initialisation de Struct lèveront
une exeption.
"""
def __init__(self, keys, db):
... | 32.010989 | 75 | 0.657741 |
2b75b42cb2b71cd0a698d97f3aeb3193b5a08b27 | 325 | py | Python | src/python/py-accepted/158A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | 2 | 2019-09-07T17:00:26.000Z | 2020-08-05T02:08:35.000Z | src/python/py-accepted/158A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | src/python/py-accepted/158A.py | cbarnson/UVa | 0dd73fae656613e28b5aaf5880c5dad529316270 | [
"Unlicense",
"MIT"
] | null | null | null | #! python
# Problem # : 158A
# Created on : 2019-01-14 20:45:14
def Main():
n, k = map(int, input().split(' '))
arr = list(map(int, input().split(' ')))
cnt = 0
for i in arr:
if i >= arr[k - 1] and i > 0:
cnt += 1
print(cnt)
if __name__ == '__main__':
Ma... | 17.105263 | 44 | 0.455385 |
51bfc5fb7be8774b407455a87f2427403fdbeecf | 9,796 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/adv.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/adv.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/61b1/src/adv.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | from room import Room
from player import Player
from item import Item
import sys
import os
# Declare all the rooms
room = {
'outside': Room("Outside Cave Entrance", "North of you, the cave mount beckons"),
'foyer': Room("Foyer", """Dim light filters in from the south. Dusty
passages run north and east."""... | 44.93578 | 243 | 0.566558 |
56c3715f85cfc5d5c0b21d259d2480e10b30a204 | 1,470 | py | Python | api/migrations/0001_initial.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | null | null | null | api/migrations/0001_initial.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | 2 | 2018-05-11T18:26:18.000Z | 2018-05-12T18:49:38.000Z | api/migrations/0001_initial.py | aidun/seite50 | 761a8e76f9e4473f70a8705dce169d61bf660267 | [
"Apache-2.0"
] | 1 | 2018-10-10T19:52:17.000Z | 2018-10-10T19:52:17.000Z | # Generated by Django 2.0.5 on 2018-05-08 18:11
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.AutoField(primar... | 35 | 76 | 0.557143 |
7133ef64ccbb3989bfff120f8a0e8777a10c78c8 | 517 | py | Python | backend/app/schemas/solver_result.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-11-04T17:06:07.000Z | 2021-11-04T17:06:07.000Z | backend/app/schemas/solver_result.py | JamesNeumann/learning-by-annotations | c2b5e4b653eeb1c973aa5a7dad35ac8be18cb1ad | [
"MIT"
] | 21 | 2021-11-01T10:13:56.000Z | 2021-12-02T10:02:13.000Z | backend/app/schemas/solver_result.py | jinnn-dev/patholearn | b4e6a18cfbf963e71640ed6cac3fc3a618a7ae15 | [
"MIT"
] | 1 | 2021-12-16T18:20:55.000Z | 2021-12-16T18:20:55.000Z | from typing import Tuple, List, Optional
from pydantic import BaseModel
class SolverResultBase(BaseModel):
id: str
name_matches: bool
error: Optional[bool] = False
class PointResult(SolverResultBase):
distance: float
class LineResult(SolverResultBase):
percentage_outside: floa... | 20.68 | 51 | 0.727273 |
a46f8b71853cfc91d03a495e1bf519c41220cbf4 | 4,992 | py | Python | core/routing.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | 4 | 2015-07-09T21:14:22.000Z | 2019-07-02T21:53:50.000Z | core/routing.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | core/routing.py | jreese/seinfeld | 400204cef0cb532c3e8e223fa48490247b9149ed | [
"MIT"
] | null | null | null | # Copyright 2014 John Reese
# Licensed under the MIT license
from functools import wraps
import inspect
import json
from flask import abort, make_response, render_template, request
from core import app, encoder
_context = []
_titles = {}
class context(object):
"""Prefix all routing and template paths with the ... | 32 | 131 | 0.550681 |
f15a8a513400a33e66c1a27c71e4d48e57f5f3e3 | 2,734 | py | Python | benwaonline/schemas/post_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/schemas/post_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/schemas/post_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from marshmallow_jsonapi import fields
from benwaonline.schemas import BaseSchema
class PostSchema(BaseSchema):
id = fields.String()
title = fields.String()
created_on = fields.DateTime()
class Meta:
type_ = 'posts'
strict = False
self_url = '/api/posts/{id}'
self_url_k... | 30.377778 | 59 | 0.577908 |
2d02357df79e74d8c75e93ae00a2ff9a96c44a96 | 258 | py | Python | src/main/python/correlation/resize.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/correlation/resize.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/correlation/resize.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | from PIL import Image
import numpy
"""
auto resize the diretory image
"""
import os
path='.'
p=[]
filename=''
img = Image.open(os.path.join('1024',filename))
img = img.convert("RGB")
out = img.resize((20, 20),Image.ANTIALIAS)
out.save(filename)
| 18.428571 | 48 | 0.662791 |
74208a242068e922e31ad6421947d89362cbd497 | 3,523 | py | Python | bot/exts/moderation/infraction/infractions.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/moderation/infraction/infractions.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | bot/exts/moderation/infraction/infractions.py | thecoderkitty/fluffington-bot | f518e7b66487aaf9e6c507ced43e15760d604be2 | [
"MIT"
] | null | null | null | import datetime
import asyncio
from typing import Optional
import discord
from discord.ext import commands
from discord.utils import get
from bot.bot import Bot
from bot.constants import Roles
from bot.utils.converters import FetchedMember
from bot.utils.time import discord_timestamp
class Infractions(commands.Cog)... | 32.62037 | 102 | 0.624468 |
562b71e4b1cdf6341ac1ca688e1bf062c6758bf3 | 701 | py | Python | prototype/examples/user_support/lab_orchestrator_prototype/app.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/user_support/lab_orchestrator_prototype/app.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | null | null | null | prototype/examples/user_support/lab_orchestrator_prototype/app.py | LernmodulController/LernmodulController-LernmodulControllerDocumentation | 4d0cb3dcac01676f6a97df8f558095a27a4296af | [
"MIT"
] | 1 | 2021-09-26T12:09:52.000Z | 2021-09-26T12:09:52.000Z | from typing import Optional
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_httpauth import HTTPBasicAuth
# initialization
app = Flask(__name__)
app.config['SECRET_KEY'] = 'the quick brown fox jumps over the lazy dog'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
app.config[... | 23.366667 | 72 | 0.71184 |
564b1a5de53639195dd0253902ee1d71895b1d2c | 211 | py | Python | Algorithms/Implementation/beautiful_days_at_the_movies.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful_days_at_the_movies.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Implementation/beautiful_days_at_the_movies.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
arr = input().strip().split()
i, j, k = arr[0], arr[1], int(arr[2])
print(len([n for n in range(int(i), int(j) + 1) if (n - int(''.join(list(reversed(str(n)))))) % k == 0]))
| 23.444444 | 105 | 0.559242 |
8e924822fff09cdf28289cf975b005dfd982bb54 | 1,721 | py | Python | examples/machine_translation/transformer/deploy/serving/transformer_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/deploy/serving/transformer_reader.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from paddlenlp.datasets import load_dataset
from paddlenlp.data import Pad, Vocab
class TransformerReader(object):
def __init__(self, args={}):
super(TransformerReader, self).__init__()
dataset = load_dataset('wmt14ende', splits=('test'))
if not args.benchmark:
... | 30.192982 | 75 | 0.597327 |
d90a799198bdffe51d22f962a05035743690a88d | 481 | py | Python | notes/methods_static.py | tobias-fyi/01_intro_python | c56645291b8bce94d8511c3277fefba1fe8add89 | [
"MIT"
] | null | null | null | notes/methods_static.py | tobias-fyi/01_intro_python | c56645291b8bce94d8511c3277fefba1fe8add89 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/lambda_cs/01_intro_python/notes/methods_static.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | """
Python :: Static methods
"""
# %%
class Whatever:
def __init__(self, num):
self.num = num
self.something = self.x_round(num)
def x_round(self, x):
if x >= 10:
return (x ** 4) // 4
return x
# %%
class Whatever:
def __init__(self, num):
self.num = nu... | 15.516129 | 42 | 0.488565 |
30b3ff234fc0c04c0cbe66272fd033544c61b614 | 3,697 | py | Python | plugins/tff_backend/bizz/dashboard.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | null | null | null | plugins/tff_backend/bizz/dashboard.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 178 | 2017-08-02T12:58:06.000Z | 2017-12-20T15:01:12.000Z | plugins/tff_backend/bizz/dashboard.py | threefoldfoundation/app_backend | b3cea2a3ff9e10efcc90d3d6e5e8e46b9e84312a | [
"Apache-2.0"
] | 2 | 2018-01-10T10:43:12.000Z | 2018-03-18T10:42:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 42.494253 | 104 | 0.750068 |
a50470c8e1a9b880b25b429b6e327b72ed831120 | 303 | py | Python | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython_cluster_helper-0.3.2-py2.7.egg/cluster_helper/__init__.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | """Distributed execution using an IPython cluster.
Uses IPython parallel to setup a cluster and manage execution:
http://ipython.org/ipython-doc/stable/parallel/index.html
Borrowed from Brad Chapman's implementation:
https://github.com/chapmanb/bcbio-nextgen/blob/master/bcbio/pipeline/ipython.py
"""
| 33.666667 | 79 | 0.805281 |
ebcff2b6f4e01b657cd6290a483264769b78869f | 25,250 | py | Python | src/onegov/election_day/formats/election/wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/election/wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/formats/election/wabstic_proporz.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from datetime import datetime
from onegov.ballot import Candidate, ProporzElection, ElectionCompound
from onegov.ballot import CandidateResult
from onegov.ballot import ElectionResult
from onegov.ballot import List
from onegov.ballot import ListConnection
from onegov.ballot import ListResult
from onegov.ballot.models.... | 32.165605 | 79 | 0.579287 |
d6ea0fb1ebfd60bb125068005f02dcde654816d4 | 2,951 | py | Python | extractor.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | extractor.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | 1 | 2020-09-23T21:03:00.000Z | 2020-09-23T21:03:00.000Z | extractor.py | JonasFovea/PyDocToLaTeX | 81f90cb82f9d7b8a8bab632a845b8ced42e3e8fa | [
"MIT"
] | null | null | null | import re
FIELD_RE = re.compile(r'^([a-zA-Z0-9_]*) = .*')
DESCRIPTION_RE = re.compile(r'"""(.*)"""')
FUNCTION_RE = re.compile(r'^def (\w+)\((.*)\):')
CLASS_RE = re.compile(r'^class (\w+):')
def loadFileContent(filename: str):
content = ""
try:
file = open(filename, "r")
content = file.read()
... | 29.217822 | 83 | 0.560827 |
0356cf62a5e2cf71de89321b3aae74bdc47ee260 | 50,342 | py | Python | api/data_example.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 6 | 2018-06-27T00:09:55.000Z | 2019-03-07T14:06:53.000Z | api/data_example.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2021-03-31T18:37:46.000Z | 2021-06-01T21:49:41.000Z | api/data_example.py | cloud-cds/cds-stack | d68a1654d4f604369a071f784cdb5c42fc855d6e | [
"Apache-2.0"
] | 3 | 2020-01-24T16:40:49.000Z | 2021-09-30T02:28:55.000Z | suspicion_of_infection = {
"name": "suspicion_of_infection",
"value": "No Infection",
"update_time": None,
"update_user": "user"
}
sirs = {
"name": "sirs",
"is_met": False,
"onset_time": None,
"num_met": 0,
"criteria": [
{
"name": "sirs_temp",
"is_met... | 101.291751 | 9,272 | 0.642942 |
302cab6868248fac5d769cb81251835042fec314 | 3,005 | py | Python | hiwire-gtfsrealtime.py | kurtraschke/hiwire-gtfsrealtime | 8d00606ce44e98603963d52650f1d3298c89a448 | [
"MIT"
] | 1 | 2018-09-20T06:59:07.000Z | 2018-09-20T06:59:07.000Z | hiwire-gtfsrealtime.py | kurtraschke/hiwire-gtfsrealtime | 8d00606ce44e98603963d52650f1d3298c89a448 | [
"MIT"
] | null | null | null | hiwire-gtfsrealtime.py | kurtraschke/hiwire-gtfsrealtime | 8d00606ce44e98603963d52650f1d3298c89a448 | [
"MIT"
] | null | null | null | import requests
from google.transit import gtfs_realtime_pb2
from google.protobuf.text_format import MessageToString
from flask import Flask, request, make_response
from flask.ext.cache import Cache
import json
import time
from datetime import datetime
app = Flask(__name__)
app.debug = True
cache = Cache(app,config={... | 34.147727 | 104 | 0.584692 |
ebed313aa84e3aaf1530e2cac494b52cd7116440 | 101 | py | Python | Imaginary/2021/misc/Minijail/minijail.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/misc/Minijail/minijail.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/misc/Minijail/minijail.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | MAX = 37
x = input(">>> ").strip()
assert len(x) <= MAX
eval(x, {'__builtins__': {'print': print}})
| 16.833333 | 43 | 0.554455 |
c9beff0464bef27fa0f36a2435aa4870378e64ac | 672 | py | Python | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/04_pdf_verschluesseln/04_pdf_verschluesseln.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/04_pdf_verschluesseln/04_pdf_verschluesseln.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/04_pdf_verschluesseln/04_pdf_verschluesseln.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null |
# 04_pdf_verschluesseln.py
# In diesem Beispiel geht es Darum PDF-Dateien zu verschlüsseln um
# sie vor fremdem Zugriff zu schützen
import os, PyPDF2
os.chdir(os.path.dirname(__file__))
source_file='.\\decrypted.pdf'
target_file='.\\encrypted.pdf'
password='123445'
source_file_open=open(source_file, 'rb')
source_c... | 26.88 | 67 | 0.809524 |
14f6bf3e97064a6b33612133fc838495f0d6b742 | 1,027 | py | Python | PostgreSQL/checkPGconnect.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | PostgreSQL/checkPGconnect.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | PostgreSQL/checkPGconnect.py | daoxuewu/cheat_sheet | 4a164f7eccb85ca39b9a9ad58fe5d495862ecf44 | [
"MIT"
] | null | null | null | # 測試postgresql資料庫是否連接
import psycopg2
from psycopg2 import Error
try:
# Connect to an existing database
connection = psycopg2.connect(user="使用者帳號",
password="密碼",
host="主機位址",
port="5432",
... | 33.129032 | 57 | 0.575463 |
eeb6658a3fbe9456341f213ee5693b5d6d21d1b5 | 1,603 | py | Python | src/main/python/step2_cluster.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/step2_cluster.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | null | null | null | src/main/python/step2_cluster.py | gwdgithubnom/ox-patient | cddf4fe381cb4506db8e0d62803dd2044cf7ad92 | [
"MIT"
] | 1 | 2021-04-14T00:45:38.000Z | 2021-04-14T00:45:38.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from tools import logger
import numpy as np
from sklearn import manifold
from sklearn import __version__ as sklearn_version
from view import plot_utils
from view import plot
from cluster import cluster_dpc
from view.plot_utils import *
from cluster.cluster_dpc... | 45.8 | 118 | 0.7199 |
111d1e13f5fde5777342c94a7bd8d48a91433aad | 5,352 | py | Python | DataProcess/auto_rotation/supplement_freq_phase_orientation_time_sequence.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/supplement_freq_phase_orientation_time_sequence.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | DataProcess/auto_rotation/supplement_freq_phase_orientation_time_sequence.py | zhangupkai/RFID_Script | 9e05fad86e71dc6bd5dd12650d369f13d5a835c8 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
from scipy import interpolate
from filters import hampel
from base_list import get_freq_list
from locate_degree_main import locate_degree
# 补全单个频率下的 相位-角度-时间序列
# TODO 去除离群值 插值
# tag1 = 'B034'
# tag2 = 'B029'
# tag1 = 'B016'
# tag2 = 'A... | 35.919463 | 116 | 0.639761 |
116b73d4e622fcf8035c6c28f8841e01387dd32b | 1,594 | py | Python | tests/integration/test_creation.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 23 | 2018-09-19T13:34:27.000Z | 2022-02-14T09:49:35.000Z | tests/integration/test_creation.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 33 | 2018-10-18T07:58:05.000Z | 2019-05-16T08:24:12.000Z | tests/integration/test_creation.py | pcrete/skil-python | 672a1aa9e8af020c960ab9ee280cbb6b194afc3f | [
"Apache-2.0"
] | 11 | 2018-10-21T18:58:57.000Z | 2022-02-14T09:49:36.000Z | import pytest
import skil
def test_skil_creation():
sk = skil.Skil()
def test_work_space_creation():
sk = skil.Skil()
work_space = skil.WorkSpace(sk)
work_space.delete()
def test_experiment_creation():
sk = skil.Skil()
work_space = skil.WorkSpace(sk)
exp = skil.Experiment(work_space)
... | 20.701299 | 62 | 0.673777 |
a34e8b98ab6cb77ceff9eeab5c400f73e7bb7047 | 522 | py | Python | Algorithms/DynamticProgramming/TheCoinChangeProblem.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/DynamticProgramming/TheCoinChangeProblem.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | Algorithms/DynamticProgramming/TheCoinChangeProblem.py | baby5/HackerRank | 1e68a85f40499adb9b52a4da16936f85ac231233 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding:utf-8
N, M = map(int, raw_input().split())
ar = map(int, raw_input().split())
table = [[0]*N for _ in xrange(M)]
coin = ar[0]
for i in xrange(N):
if (i+1) % coin == 0:
table[0][i] = 1
for i in xrange(1, M):
coin = ar[i]
for j in xrange(N):
if j+1 < coin:
... | 21.75 | 58 | 0.484674 |
28400e410433ff513ff9b912b138994877bcbbc1 | 563 | py | Python | db_utils/connet_mysql.py | raiever/abtest | ff14f20ad23d2a0710e95d23e3d1124a44298a62 | [
"Apache-2.0"
] | null | null | null | db_utils/connet_mysql.py | raiever/abtest | ff14f20ad23d2a0710e95d23e3d1124a44298a62 | [
"Apache-2.0"
] | null | null | null | db_utils/connet_mysql.py | raiever/abtest | ff14f20ad23d2a0710e95d23e3d1124a44298a62 | [
"Apache-2.0"
] | null | null | null | import mysql.connector
from db_utils.db_config import MYSQL
def connect(db=MYSQL):
cnx = mysql.connector.connect(**db)
cursor = cnx.cursor(buffered=True)
# test_sql = "SELECT property_id FROM property_list;"
# cursor.execute(test_sql)
# for i in cursor:
# print(i)
print("Before function... | 26.809524 | 57 | 0.666075 |
95b4c08179ec79e2921bfff4f018b4f060f9d194 | 4,466 | py | Python | packages/watchmen-meta/src/watchmen_meta/common/user_based_tuple_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/common/user_based_tuple_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | packages/watchmen-meta/src/watchmen_meta/common/user_based_tuple_service.py | Indexical-Metrics-Measure-Advisory/watchmen | c54ec54d9f91034a38e51fd339ba66453d2c7a6d | [
"MIT"
] | null | null | null | from typing import List, Optional, Tuple
from watchmen_auth import PrincipalService
from watchmen_model.common import Auditable, OptimisticLock, TenantId, UserBasedTuple, UserId
from watchmen_storage import ColumnNameLiteral, EntityCriteriaExpression, EntityRow, SnowflakeGenerator, \
TooManyEntitiesFoundException, Tr... | 40.972477 | 106 | 0.794671 |
6c5c1b5e3a35307bee131ee48940e94e97bcde3f | 3,765 | py | Python | src/config.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/config.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/config.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | """config.py - access benzlim's instance configuration"""
import logging
import os
import sys
import multiprocessing
import platform
from .compat import printf
class Configuration:
"""Contains the configuration to run a benzlim instance"""
RESOURCE_DIR = "resources"
OUTPUT_DIR = "out"
CLASSIFIER_FILE... | 42.303371 | 115 | 0.671713 |
3c006c48c6d7ee6a96b8b3b65ecf7bb11ab872ae | 16,988 | py | Python | hihope_neptune-oh_hid/00_src/v0.1/third_party/LVM2/daemons/lvmdbusd/utils.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/utils.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.3/third_party/LVM2/daemons/lvmdbusd/utils.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015-2016 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License v.2.
#
# You should have received a copy of the GNU General Public License
# a... | 26.216049 | 79 | 0.695138 |
b1c47919ec8b96a56987ad048e761d651ae25fcd | 1,884 | py | Python | src/onegov/feriennet/forms/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/forms/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/forms/match.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.activity.matching.score import PreferAdminChildren
from onegov.activity.matching.score import PreferOrganiserChildren
from onegov.activity.matching.score import PreferGroups
from onegov.activity.matching.score import Scoring
from onegov.feriennet import _
from onegov.form import Form
from wtforms.fields imp... | 30.885246 | 73 | 0.666667 |
aba302ee8f467259c409c7e3a42261856c08fead | 865 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex05_jewels_board_init_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex05_jewels_board_init_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch06_arrays/purearrays/ex05_jewels_board_init_example.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
from ch06_arrays.solutions.ex05_jewels_board_init import init_jewels_board, check_board_validity
from ch06_arrays.intro.intro import print_array
def main():
# Terminiert ggf. nicht!! wenn nur 1-3 möglich sind
print("Init ... | 27.03125 | 96 | 0.558382 |
e6176284316eae2a7e61ff3219d3e1fa8b6ea456 | 1,952 | py | Python | src/using_tips/decorator/decorator_demo2.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/decorator_demo2.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | src/using_tips/decorator/decorator_demo2.py | HuangHuaBingZiGe/GitHub-Demo | f3710f73b0828ef500343932d46c61d3b1e04ba9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------
1.python装饰器的出现
# 在没有装饰器之前,如果要在类中定义一个静态方法,需要使用以下2种方法:
class MyClass(object):
def staticFoo():
staticFoo = staticmethod(staticFoo)
# 等价于
class MyClass(object):
... | 17.745455 | 116 | 0.444672 |
f92effb5507e9e7b609aaa07671c4f140767eea5 | 288 | py | Python | listings/chapter10/sigmoid-graph.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 6 | 2021-08-04T19:42:53.000Z | 2022-01-17T14:24:45.000Z | listings/chapter10/sigmoid-graph.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2021-08-30T06:32:08.000Z | 2021-08-30T06:42:46.000Z | listings/chapter10/sigmoid-graph.py | rh0-me/ITHandbuch10 | 1582d6317e11cc958a14e157440dccf94d44583b | [
"Apache-2.0"
] | 1 | 2022-02-17T10:32:17.000Z | 2022-02-17T10:32:17.000Z | import matplotlib.pyplot as plt
import numpy as np
import math
x = np.linspace(-10, 10, 1000)
y = []
for x_i in x:
y.append(1 / (1 + math.exp(-x_i)))
plt.plot(x, y, color='red')
plt.xlabel('x')
plt.ylabel('y')
plt.grid()
plt.axhline(linewidth=2)
plt.axvline(linewidth=2)
plt.show()
| 16.941176 | 38 | 0.663194 |
9ba3bf84ed94b5c522eaf3862c40a9722489f160 | 411 | py | Python | src/onegov/agency/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/agency/views/page.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.agency import AgencyApp
from onegov.agency.layout import PageLayout
from onegov.core.security import Public
from onegov.org.models import Topic
from onegov.org.views.page import view_topic as view_topic_base
@AgencyApp.html(model=Topic, template='topic.pt', permission=Public)
def view_topic(self, request)... | 34.25 | 68 | 0.805353 |
1f09355ecd1da5486663cd47385ae99b05251c48 | 1,029 | py | Python | spangle/types.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | 2 | 2019-11-17T06:38:56.000Z | 2019-12-01T15:32:03.000Z | spangle/types.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | spangle/types.py | tkamenoko/spangle | 068479660a03239aa69c935d7ca0418c491d92da | [
"MIT"
] | null | null | null | """
Utility types for `spangle` .
"""
from collections.abc import Awaitable, Callable
from typing import Any, Literal, TypedDict, Union
__all__ = ["LifespanFunction", "LifespanHandlers", "RoutingStrategy"]
LifespanFunction = Union[Callable[[], None], Callable[[], Awaitable[None]]]
LifespanFunction.__doc__ = """
Call... | 26.384615 | 75 | 0.682216 |
c80d8e7d2294fe4f1616e8248f7288aa7aa44b60 | 542 | py | Python | frappe-bench/apps/erpnext/erpnext/templates/pages/courses.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/templates/pages/courses.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/templates/pages/courses.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def get_context(context):
course = frappe.get_doc('Course', frappe.form_dict.course)
sidebar_title = course.name
context.no_cache =... | 25.809524 | 68 | 0.782288 |
c81006ceb81ef23ca707846d5c6efbecb9b194f4 | 116 | py | Python | 02_Python/lists.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/lists.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | 02_Python/lists.py | DaviNakamuraCardoso/Harvard-CS50-Web-Programming | afec745eede41f7b294c3ee6ebaff9ac042e5e4c | [
"MIT"
] | null | null | null | # defining a list of names
names = ['Will', 'Christian', 'Denzel']
names.append('David')
names.sort()
print(names)
| 16.571429 | 39 | 0.681034 |
c0c8c28263c8c99e3e230a16bdff13d662b2f41d | 471 | py | Python | api/admin.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | null | null | null | api/admin.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | 2 | 2021-02-06T13:54:45.000Z | 2021-02-06T20:05:18.000Z | api/admin.py | scholaronroad/guts_2021_hackathon | 482b7b59317b67fc37f67f1ccfeaadbf811c00ca | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from . import models
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
pass
admin.site.register(models.CharityAccount)
admin.site.register(model... | 23.55 | 51 | 0.825902 |
7bc7d9d5cee5d9dde6ac645c4d53467ceb951726 | 25,550 | py | Python | action-s710-weather.py | patrickjane/snipsweather | 0f28da377bc6961b6573146b86a285cb5caad9e0 | [
"MIT"
] | null | null | null | action-s710-weather.py | patrickjane/snipsweather | 0f28da377bc6961b6573146b86a285cb5caad9e0 | [
"MIT"
] | null | null | null | action-s710-weather.py | patrickjane/snipsweather | 0f28da377bc6961b6573146b86a285cb5caad9e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Snips Weather + DarkSky
# -----------------------------------------------------------------------------
# Copyright 2019 Patrick Fial
# ------------------------------------------------------... | 43.378608 | 208 | 0.54998 |
c8e8762d08042a7ecfe20d205406514b2bdc0a1f | 409 | py | Python | letspuppet/floatdataframe.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 15 | 2018-05-16T02:39:01.000Z | 2021-05-22T13:12:55.000Z | letspuppet/floatdataframe.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | null | null | null | letspuppet/floatdataframe.py | pchaos/wanggejiaoyi | 60242d465bf10d4be46ee6eafc99557affc2a52e | [
"MIT"
] | 9 | 2018-05-16T00:47:34.000Z | 2021-11-26T05:39:48.000Z | # coding: utf-8
"""
Created on Wed Sep 20 23:00:44 2017
@author: 久久为功
"""
def floatdataframe(df,changecollist):
"""
DataFrame中的特定列变成float类型
:param df:
:param changecollist:
:return:
"""
for col in df.columns:
if col in changecollist:
df[col]=df[col].apply(lambda x:0 i... | 17.041667 | 68 | 0.603912 |
8d269b7f7fd465100e12dc80eb5cb0ab395e884c | 309,191 | py | Python | ODOS-main/DDOS.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | ODOS-main/DDOS.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | ODOS-main/DDOS.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | # coding=utf-8
#Obfuscate BY Aldi Bachtiar Rifa
#😂😂😂😂😂😂😂😂😂😂😂😂😂
Aldi=['0000000000', '00000000000000000000000000000000000', '00000000000000000000000000000000', '000000000000000000000000000000000000000000000', '000000000000000000000000000000000000000000', '000000000000000000000000000000000000000000000', '0000... | 51,531.833333 | 309,122 | 0.954879 |
8d6a3626e0bad6c415e2952be8ca66494ef8c7b6 | 2,217 | py | Python | src/onegov/gazette/forms/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/forms/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/forms/organization.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.form import Form
from onegov.form.fields import ChosenSelectField
from onegov.form.validators import UniqueColumnValue
from onegov.gazette import _
from onegov.gazette.models import GazetteNotice
from onegov.gazette.models import Organization
from onegov.gazette.validators import UnusedColumnKeyValue
from s... | 29.171053 | 69 | 0.643663 |
f53c7d796c290e7a565bdf797fcc335a3f213f26 | 3,440 | py | Python | test/test_npu/test_network_ops/test_roll.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_roll.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_roll.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... | 43 | 84 | 0.675291 |
275ea5251827d8863c09964a317a3976a5b9109f | 1,996 | py | Python | KnowledgeQuizTool/MillionHeroes/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | KnowledgeQuizTool/MillionHeroes/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | 68 | 2020-09-05T04:22:49.000Z | 2022-03-25T18:47:08.000Z | KnowledgeQuizTool/MillionHeroes/hero.py | JianmingXia/StudyTest | 66d688ad41bbce619f44359ea126ff07a923f97b | [
"MIT"
] | null | null | null | import urllib.request, sys,base64,json,os,time,baiduSearch
from PIL import Image
from aip import AipOcr
start = time.time()
os.system("adb shell /system/bin/screencap -p /sdcard/screenshot.png")
os.system("adb pull /sdcard/screenshot.png ./screenshot.png")
'''
汉王ocr 涨价涨价了。。
host = 'http://text.aliapi.hanvon.com'
path... | 25.589744 | 127 | 0.665832 |
8b55ddcbc5ed6be782ec1c0750771119d694a309 | 3,439 | py | Python | test/test_npu/test_network_ops/test_mm.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_mm.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_mm.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... | 36.585106 | 80 | 0.637976 |
9a4e05959a19ac6955565e1f0e5add181923db84 | 1,177 | py | Python | Python/Strings/Find_a_string.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Python/Strings/Find_a_string.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | Python/Strings/Find_a_string.py | vinayvinu500/Hackerrank | e185ae9d3c7dc5cd661761142e436f5df6a3f0f1 | [
"MIT"
] | null | null | null | import re
# https://www.hackerrank.com/challenges/find-a-string/problem?h_r=internal-search
def count_substring(string, sub_string):
pattern = re.compile(sub_string)
match = pattern.search(string)
print(match)
count = 0
# while loop integration
while match is not None:
count += 1
... | 18.983871 | 81 | 0.582838 |
ef2152a70871a5147b8f4e1dfb79b7e90e23e2b9 | 669 | py | Python | pacman-arch/test/pacman/tests/replace-and-upgrade-package.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/replace-and-upgrade-package.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/replace-and-upgrade-package.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = 'Simultaneously replace and upgrade a package'
# replacement package
sp1 = pmpkg('foo1', '1-2')
sp1.replaces = ['foo=1-1']
sp1.conflicts = ['foo=1-1']
self.addpkg2db('sync', sp1)
# upgrade package
sp2 = pmpkg('foo', '2-1')
self.addpkg2db('sync', sp2)
# depend on upgraded package to pull it into tr... | 23.892857 | 65 | 0.690583 |
088a1196785ffba97836707c97edce24019d54c7 | 11,134 | py | Python | frappe-bench/apps/erpnext/erpnext/config/accounts.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/accounts.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/config/accounts.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Billing"),
"items": [
{
"type": "doctype",
"name": "Sales Invoice",
"description": _("Bills raised to Customers.")
},
{
"type": "doctype",
"name": "Purchase Invoice",
"... | 21.874263 | 86 | 0.51446 |
3ebe7b3bfd1729458870029715e3c5cec0535a7d | 952 | py | Python | web-brutator-master/lib/core/Config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | web-brutator-master/lib/core/Config.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | web-brutator-master/lib/core/Config.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/env python3
# -*- coding: utf-8 -*-
import os
VERSION = '0.2'
BANNER = """
__ __ ___. __________ __ __
/ \ / \ ____\_ |__ \______ \_______ __ ___/ |______ _/ |_ ___________
\ \/\/ // __ \| __ \ ______ | | _/\_ __ \ ... | 39.666667 | 90 | 0.380252 |
de5be975c5e2295c6fa130d39faab8906495c0d4 | 689 | py | Python | vorl9.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl9.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | vorl9.py | haenno/FOM-BSc-WI-Semster3-Skriptsprachen-Python | bb34b6b1ba7e8fe7b22ce598a80d5011122c2d4a | [
"MIT"
] | null | null | null | # 9. Vorlesung 28.11.2020, Skript Python 5 (07_Python_05.pdf)
# Nachholtermin vom 26.11. 20 Uhr ohne Übungen
# Übung: Bilder skalieren
import cv2
scale = 1.0
filename = "gleisdreieck.jpg"
while True:
image = cv2.imread(filename, cv2.IMREAD_COLOR)
image_resized = cv2.resize(image, None, fx=scale, fy=scale, ... | 26.5 | 94 | 0.660377 |
de73d3d555d0ac90278a40cbd75fcbeb5b933a7b | 726 | py | Python | ProjectEuler_plus/euler_045.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_045.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | ProjectEuler_plus/euler_045.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from math import sqrt
N, a, b = list(map(int, input().strip().split()))
if a == 3 and b == 5:
for i in range(1, N + 1):
n1 = (sqrt((8 * i) + 1) - 1) / 2
n2 = (sqrt((24 * i) + 1) + 1) / 6
if n1.is_integer() and n2.is_integer():
print(i)
elif a ==... | 30.25 | 49 | 0.436639 |
defcd4acbe37971214af0dea01afd0b7fb85bc89 | 60 | py | Python | python/python_new/Python 3/numbersort.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_new/Python 3/numbersort.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_new/Python 3/numbersort.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | A=[4,5,8,2,3]
A.sort(reverse=True)
print("Sorted list :",A)
| 15 | 24 | 0.633333 |
5f0e39adc7cd0c92e12db92c8e92b852c5106db3 | 70 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.1-sting.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.1-sting.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-008/pg-8.1-sting.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | s = "hello"
print(len(s))
l = len(s)
print(l)
s = " "
print(len(s))
| 7.777778 | 13 | 0.514286 |
263334b0743b849b04e4ac3296e6854520da7542 | 1,780 | py | Python | Openharmony v1.0/vendor/hisi/hi35xx/third_party/uboot/test/py/tests/test_ofplatdata.py | clkbit123/TheOpenHarmony | 0e6bcd9dee9f1a2481d762966b8bbd24baad6159 | [
"MIT"
] | 1 | 2022-02-15T08:51:55.000Z | 2022-02-15T08:51:55.000Z | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/test/py/tests/test_ofplatdata.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | hihope_neptune-oh_hid/00_src/v0.1/device/hisilicon/third_party/uboot/u-boot-2020.01/test/py/tests/test_ofplatdata.py | dawmlight/vendor_oh_fun | bc9fb50920f06cd4c27399f60076f5793043c77d | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
import pytest
import u_boot_utils as util
OF_PLATDATA_OUTPUT = '''
of-platdata probe:
bool 1
byte 05
bytearray 06 00 00
int 1
intarray 2 3 4 0
longbytearray 09 0a 0b 0c 0d 0e 0f 10 11
string message
stringarray "multi-word" "message" ""
of-platdata ... | 25.070423 | 68 | 0.720225 |
26ec82c69a5c145b08a3c97bebccb09390e4a906 | 1,313 | py | Python | Packs/XMatters/Scripts/WaitForKey/WaitForKey.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/XMatters/Scripts/WaitForKey/WaitForKey.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/XMatters/Scripts/WaitForKey/WaitForKey.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 typing import Dict, Any
import traceback
def wait_for_key(args: Dict[str, Any]):
context_key = args.get('context_key', 'None')
max_iterations = 10
try:
max_iterations = int(args.get('iterations', 10))
except (ValueError, Type... | 26.795918 | 89 | 0.650419 |
e4a48fa1e4a7c198d3858c35b0d6f9edf4894fe0 | 8,409 | py | Python | autojail/config/network.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 6 | 2020-08-12T08:16:15.000Z | 2022-03-05T02:25:53.000Z | autojail/config/network.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-03-30T10:34:51.000Z | 2021-06-09T11:24:00.000Z | autojail/config/network.py | ekut-es/autojail | bc16e40e6df55c0a28a3059715851ffa59b14ba8 | [
"MIT"
] | 1 | 2021-11-21T09:30:58.000Z | 2021-11-21T09:30:58.000Z | import itertools
from collections import defaultdict
from ipaddress import (
IPv4Interface,
IPv4Network,
IPv6Network,
ip_interface,
ip_network,
)
from logging import getLogger
from pathlib import Path
from typing import Any, Dict, List, Tuple
from autojail.model.config import AutojailConfig
from .... | 36.402597 | 122 | 0.555833 |
5f695d99ba26af1a63dc98a3ca9aa98964fb74c4 | 912 | py | Python | multimeter/test/test_waehlen.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/test/test_waehlen.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | multimeter/test/test_waehlen.py | tropi-frutti/facharbeit-fhg | e162014a9d12e60c616d78c14166c75414acda7b | [
"MIT"
] | null | null | null | '''
Created on 24.02.2017
@author: steinorb
'''
import unittest.mock
import waehlen
class WaehlenTest(unittest.TestCase):
@unittest.mock.patch('builtins.input') # mock the builtin input() method
def testAuswahl(self, mock_input):
mock_input.return_value = "1"
auswahl = waehle... | 28.5 | 77 | 0.653509 |
3972a3f48260c4e4e0fe2db529510367e5828299 | 3,894 | py | Python | Pythonskripte/p3env/fftOnSlice.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Pythonskripte/p3env/fftOnSlice.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | Pythonskripte/p3env/fftOnSlice.py | NoahEmbedded/EmbeddedKWD | 2380d56b0b75bae4fedeb60885358332766f7319 | [
"MIT"
] | null | null | null | from pydub import AudioSegment as AS
from PIL import Image
import numpy as np
import os
def spektrogramm_von_pfad_binned(pfad):
audiogesamt=AS.from_wav(pfad)
spektrogramm = []
start = 0
ende = 40
anzahl_frame_werte = 0.04*audiogesamt.frame_rate
fenster = np.hamming(anzahl_frame_werte)
whil... | 35.724771 | 89 | 0.667694 |
845a397d7ea56bc9432d35ad8a37180d0971b606 | 5,595 | py | Python | python_experiments/data_analysis/vldbj_data_parsing/topk_precision_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/data_analysis/vldbj_data_parsing/topk_precision_statistics.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/data_analysis/vldbj_data_parsing/topk_precision_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.vldbj_data_parsing.probesim_querying_time_statistics import probesim_gt_tag
def get_tag_info(file_path, tag, functor=lambda x: x[0]):
# print file_path
if not os.path.exists(file_path):
return None
with open(file_path) as ifs:
lst = map(lambda line... | 46.239669 | 114 | 0.614477 |
8462ec16b14ad85409ca31abd63f165bec19975d | 2,345 | py | Python | measure/ModelMeter.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/ModelMeter.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | measure/ModelMeter.py | surfmachine/language-detection | b44fbb4c7b59fc70388197653060cee67b5a2ee7 | [
"MIT"
] | null | null | null | import pandas as pd
from measure.StopWatch import StopWatch
class ModelMeter:
"""Model Meter to measure the score and elapsed time of a model prediction."""
def __init__(self, debug=False):
self.debug = debug
def eval_score(self, model, csv_file):
result = self.eval(model, csv_file)
... | 29.683544 | 101 | 0.522388 |
ffeae5b292d7a641b8f90e6f3eeee0e120254e9c | 5,446 | py | Python | SC101_Assignments/SC101_Assignment4/babygraphics.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment4/babygraphics.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | SC101_Assignments/SC101_Assignment4/babygraphics.py | JIllchen487/StanCode101 | 8025dd4e4cf0cb3d14d7314ef4ea6dfff3e5b5cc | [
"MIT"
] | null | null | null | """
File: babygraphics.py
Name:
--------------------------------
SC101 Baby Names Project
Adapted from Nick Parlante's Baby Names assignment by
Jerry Liao.
"""
import tkinter
import babynames
import babygraphicsgui as gui
FILENAMES = [
'data/full/baby-1900.txt', 'data/full/baby-1910.txt',
'data/full/baby-192... | 34.0375 | 139 | 0.632207 |
f2962c7681f8f7d04dab704c8b2437a38c81ce62 | 444 | py | Python | rev/InfiniteFreeTrial/src/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | rev/InfiniteFreeTrial/src/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | rev/InfiniteFreeTrial/src/solve.py | NoXLaw/RaRCTF2021-Challenges-Public | 1a1b094359b88f8ebbc83a6b26d27ffb2602458f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
def xor(a, b):
out = []
for x, y in zip(a, b):
out.append(x^y)
return out
def display(bs):
for b in bs:
print(chr(b), end='')
print("")
xorcheck = [9,22,23,15,23,86,22,68,58,24,83,111,20,3,42,6,111,49,28,71,42,6,45,95,81,27,0,70,74,0,4,85,102,80,1,76]
flag = [or... | 23.368421 | 115 | 0.567568 |
8a25db07bc6ab13322d8dd53cbb6a6d3a0d197f1 | 406 | py | Python | musterloesungen/1.1/stadt_land_fluss.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/1.1/stadt_land_fluss.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | musterloesungen/1.1/stadt_land_fluss.py | giu/appe6-uzh-hs2018 | 204dea36be1e53594124b606cdfa044368e54726 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Kurs: Python: Grundlagen der Programmierung für Nicht-Informatiker
# Semester: Herbstsemester 2018
# Homepage: http://accaputo.ch/kurs/python-uzh-hs-2018/
# Author: Giuseppe Accaputo
# Aufgabe: 1.1
stadt = "Zuerich"
land = "Schweiz"
fluss = "Limmat"
print("Im folge... | 27.066667 | 76 | 0.679803 |
6a67f5010546dde0232cee0797e4373012c15d6c | 7,819 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/redfish/idrac_redfish_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/redfish/idrac_redfish_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/remote_management/redfish/idrac_redfish_info.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Dell EMC Inc.
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
... | 32.579167 | 156 | 0.657629 |
6a73b92fb764bec8c664f35353562a74b3c6b087 | 2,834 | py | Python | kaizo.py | YAYDHBERAKTAIK/SAMA | 2a9f5c680ca663ba935a54b422ecf2d80ce81da8 | [
"Apache-2.0"
] | null | null | null | kaizo.py | YAYDHBERAKTAIK/SAMA | 2a9f5c680ca663ba935a54b422ecf2d80ce81da8 | [
"Apache-2.0"
] | null | null | null | kaizo.py | YAYDHBERAKTAIK/SAMA | 2a9f5c680ca663ba935a54b422ecf2d80ce81da8 | [
"Apache-2.0"
] | null | null | null | """
UDP Flooder.
TOOL DDOS ATTACK BY XALBADOR.
"""
import signal
import time
import socket
import random
import threading
import sys
import os
from os import system, name
os.system("clear")
test = input()
if test == "n":
exit(0)
ip = str(input(" HOST/IP:"))
port = int(input(" PORT:"))
choice = st... | 24.859649 | 123 | 0.602682 |
0a971c2a9236059014690b085fcf2cbde6b8edf7 | 4,269 | py | Python | src/logging/ska_sdp_logging/core_logging.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 2 | 2019-07-15T09:49:34.000Z | 2019-10-14T16:04:17.000Z | src/logging/ska_sdp_logging/core_logging.py | ska-telescope/sdp-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 17 | 2019-07-15T14:51:50.000Z | 2021-06-02T00:29:43.000Z | src/logging/ska_sdp_logging/core_logging.py | ska-telescope/sdp-configuration-prototype | 8c6cbda04a83b0e16987019406ed6ec7e1058a31 | [
"BSD-3-Clause"
] | 1 | 2019-10-10T08:16:48.000Z | 2019-10-10T08:16:48.000Z | """
Core logging functionality.
This module depends only on the Python standard library.
"""
# pylint: disable=invalid-name
# pylint: disable=too-many-instance-attributes
# pylint: disable=broad-except
# pylint: disable=fixme
import logging
import sys
import time
from typing import Iterable
# Logging standard versio... | 28.085526 | 75 | 0.606699 |
0aa309fa440ffe9cb563f6bf491223e1655dd14a | 67 | py | Python | generator/generator/__init__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 29 | 2017-06-21T19:29:07.000Z | 2022-02-17T12:26:24.000Z | generator/generator/__init__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 34 | 2017-06-26T14:31:02.000Z | 2022-02-03T16:40:41.000Z | generator/generator/__init__.py | pratik-ingle/asprilo | 597854307d3e87e71942294b6cdf7cc10185f4a9 | [
"MIT"
] | 22 | 2017-06-29T11:08:42.000Z | 2022-02-03T16:16:49.000Z | # -*- coding: utf-8 -*-
from generator.release import __version__
| 16.75 | 41 | 0.701493 |
0ac0d84284faa9c01afa22dfdacb6ce5ee43b94c | 2,537 | py | Python | HXP/2020/crypto/nanothorpe/service.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | HXP/2020/crypto/nanothorpe/service.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | HXP/2020/crypto/nanothorpe/service.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
from octothorpe import octothorpe
from base64 import b64decode, b64encode
from datetime import datetime, timedelta, timezone
from flask import Flask, make_response, redirect, render_template, request
from socket import MSG_WAITALL, socket
from struct import unpack
from urllib.parse import parse... | 36.242857 | 98 | 0.656681 |
0ac1cc6395331593cd114924b1129c4a75a5f4f1 | 298 | py | Python | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 72/72.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 72/72.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Exercises/Exercises/Exercise 72/72.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | #Create a script that let the user type in a search term and opens and search on the browser for that term on Google
import webbrowser
query = input("Enter your Google query: ")
url = "https://www.google.com/?gws_rd=cr,ssl&ei=NCZFWIOJN8yMsgHCyLV4&fg=1#q=%s" % str(query)
webbrowser.open_new(url)
| 37.25 | 116 | 0.755034 |
e40021f2e32b6571de12d4a877aa37cfa344096a | 505 | py | Python | source/pkgsrc/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-11-20T22:46:39.000Z | 2021-11-20T22:46:39.000Z | source/pkgsrc/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | source/pkgsrc/chat/spectrum/patches/patch-spectrumctl_spectrum_env.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | null | null | null | $NetBSD: patch-spectrumctl_spectrum_env.py,v 1.1.1.1 2011/02/07 06:31:22 schnoebe Exp $
#
# allow the spectrum user to be substituted in.
#
--- spectrumctl/spectrum/env.py.orig 2010-07-13 17:38:39.000000000 +0000
+++ spectrumctl/spectrum/env.py
@@ -18,7 +18,7 @@ def get_uid():
username = os.environ['SPECTRUM_USER'... | 28.055556 | 87 | 0.70495 |
7ca632345846b5275fb7d0e7a60822f8878618d4 | 13,929 | py | Python | fhirclient/r4models/coverageeligibilityrequest.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/coverageeligibilityrequest.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | fhirclient/r4models/coverageeligibilityrequest.py | Healthedata1/Flask-PL | 88a2f40ca430c4cbb9fbded7fc92fdc166ebb9f1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest) on 2019-05-07.
# 2019, SMART Health IT.
from . import domainresource
class CoverageEligibilityRequest(domainresource.DomainResource):
""" Coverag... | 41.210059 | 130 | 0.622945 |
6b3a25ce9d983a966ee8674e5a000292c99b61ec | 826 | py | Python | demos/System_Dynamics/Compartment_Models/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 56 | 2020-07-08T23:23:15.000Z | 2022-03-11T20:43:09.000Z | demos/System_Dynamics/Compartment_Models/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 41 | 2020-07-11T23:24:06.000Z | 2022-01-28T13:28:07.000Z | demos/System_Dynamics/Compartment_Models/run.py | w-ghub/demos | 6382676fae89bd5a190626612712fcedf17bca6d | [
"MIT"
] | 39 | 2020-07-15T11:35:04.000Z | 2022-02-01T16:02:51.000Z | # The following imports NEED to be in the exact order
from cadCAD.engine import ExecutionMode, ExecutionContext, Executor
# Simulation configs, input any new simulations here
from sir import config
from seir import config
from seird import config
from stochastic_seir import config
from cadCAD import configs
import p... | 30.592593 | 74 | 0.771186 |
6b3ed83563be94336a99c60588aba13bed3afc46 | 206 | py | Python | palindrome-number/palindrome-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | palindrome-number/palindrome-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | palindrome-number/palindrome-number.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | class Solution:
def isPalindrome(self, x: int) -> bool:
x = str(x)
for i in range(int(len(x)/2)):
if x[i]!=x[-i-1]:
return False
return True
| 22.888889 | 43 | 0.446602 |
8671e9eae529a0e7b7c402d2aad574054a29e6d7 | 1,466 | py | Python | tests/integration/server/api/util_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | tests/integration/server/api/util_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | tests/integration/server/api/util_tests.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 34.904762 | 80 | 0.648704 |
ed5dda18502043baa611132e63460d38e8fa45da | 3,446 | py | Python | new-docs/examples/data_access/sqlalchemy/setup.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-07-08T17:36:08.000Z | 2021-07-08T17:36:08.000Z | new-docs/examples/data_access/sqlalchemy/setup.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 2 | 2021-03-24T19:24:40.000Z | 2021-03-24T19:54:46.000Z | new-docs/examples/data_access/sqlalchemy/setup.py | saschajullmann/oso | 85d07c6a1825acba5ec043c917bff6e0f5c7128f | [
"Apache-2.0"
] | 1 | 2021-03-24T19:51:45.000Z | 2021-03-24T19:51:45.000Z | import codecs
import os
import sys
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/vir... | 40.541176 | 102 | 0.683691 |
ed8af5eebc2fd914a28350b5db59acf96d3023bb | 3,201 | py | Python | bonner-raddialog-crawler.py | martin-ueding/bonner-raddialog-crawler | e2bc69f469f86332ff3e76bd9cde267e3895ed79 | [
"MIT",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | bonner-raddialog-crawler.py | martin-ueding/bonner-raddialog-crawler | e2bc69f469f86332ff3e76bd9cde267e3895ed79 | [
"MIT",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | bonner-raddialog-crawler.py | martin-ueding/bonner-raddialog-crawler | e2bc69f469f86332ff3e76bd9cde267e3895ed79 | [
"MIT",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2017 Martin Ueding <dev@martin-ueding.de>
# Licensed under the MIT/Expat license.
import argparse
import re
import os
from bs4 import BeautifulSoup
import requests
import xml.etree.ElementTree as ET
import yaml
def parse_comment(tag):
meta = tag.sele... | 23.195652 | 75 | 0.588566 |
9c0efe1240c0581622e451e97b0dd09882f913f5 | 1,333 | py | Python | Packs/CommonScripts/Scripts/AfterRelativeDate/AfterRelativeDate_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CommonScripts/Scripts/AfterRelativeDate/AfterRelativeDate_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CommonScripts/Scripts/AfterRelativeDate/AfterRelativeDate_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from AfterRelativeDate import main
import demistomock as demisto
def test_date_match(mocker):
"""
Given a date and relative date, when the date is sooner than the specified date, return bool true.
"""
args_value = {
"left": "2020-10-12T22:17:17",
"right": "30 years ago"
}
mock... | 26.66 | 114 | 0.659415 |
1307a193ff952048892d9fbf0a6493bb4d80f1eb | 129 | py | Python | sandbox/character/character.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | sandbox/character/character.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | 1 | 2022-03-22T23:50:32.000Z | 2022-03-22T23:50:32.000Z | sandbox/character/character.py | gergelyszaz/SandboxVN | b6855d1c952df66296e8fb3af42c2f8b46908a07 | [
"MIT"
] | null | null | null | import abc
class Character:
@abc.abstractmethod
def update(self, time: int) -> None:
raise NotImplementedError
| 16.125 | 40 | 0.682171 |
13cc107f4b719b6ab80468b7da5580e3638cacb8 | 10,160 | py | Python | tests/onegov/activity/fixtures/scenario.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/activity/fixtures/scenario.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/activity/fixtures/scenario.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from datetime import datetime, timedelta, time
from faker import Faker
from onegov.activity import Activity
from onegov.activity import ActivityCollection
from onegov.activity import AttendeeCollection
from onegov.activity import BookingCollection
from onegov.activity import ... | 33.979933 | 79 | 0.659154 |
b9d79dd47c98044c0844c8df1cfa29a6cc7ab505 | 88 | py | Python | admin-tutorial/AdminFields/fields_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 5 | 2020-07-14T07:48:10.000Z | 2021-12-20T21:20:10.000Z | admin-tutorial/AdminFields/fields_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 7 | 2021-03-26T03:13:38.000Z | 2022-03-12T00:42:03.000Z | admin-tutorial/AdminFields/fields_/apps.py | zhengtong0898/django-decode | 69680853a4a5b07f6a9c4b65c7d86b2d401a92b1 | [
"MIT"
] | 1 | 2021-02-16T07:04:25.000Z | 2021-02-16T07:04:25.000Z | from django.apps import AppConfig
class FieldsConfig(AppConfig):
name = 'fields_'
| 14.666667 | 33 | 0.75 |
e010906aef7b078bb0b546d3224dfb3335a7e604 | 784 | py | Python | chillow/controller/controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 3 | 2021-01-17T23:32:07.000Z | 2022-01-30T14:49:16.000Z | chillow/controller/controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-01-17T13:37:56.000Z | 2021-04-14T12:28:49.000Z | chillow/controller/controller.py | jonashellmann/informaticup21-team-chillow | f2e519af0a5d9a9368d62556703cfb1066ebb58f | [
"MIT"
] | 2 | 2021-04-02T14:53:38.000Z | 2021-04-20T11:10:17.000Z | import multiprocessing
from abc import ABCMeta, abstractmethod
from chillow.model.game import Game
from chillow.service.ai.artificial_intelligence import ArtificialIntelligence
from chillow.view.view import View
class Controller(metaclass=ABCMeta):
"""Connects the services to execute the game logic and controls ... | 29.037037 | 93 | 0.704082 |
e014f08d8509e16e77d45e3afdb8ea61e8f38cdd | 2,788 | py | Python | lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py | hanzhan1/llvm | efe40bb5c797b102088e3cd2579a0f57ccf93310 | [
"Apache-2.0"
] | null | null | null | """
Test std::deque functionality with a decl from dbg info as content.
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDbgInfoContentDeque(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(["libc++"])
... | 39.267606 | 79 | 0.557747 |
164f81a004eaef80b42b14b36f4154ecf4e47b2f | 5,641 | py | Python | test/test_npu/test_network_ops/test_log2.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_log2.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_log2.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... | 36.869281 | 74 | 0.639071 |
bcffb0186d3d2f63e2d6a0bf9a93243d3b20d790 | 4,069 | py | Python | Webpage/utils/keycloak.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | Webpage/utils/keycloak.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | 46 | 2022-01-08T12:03:24.000Z | 2022-03-30T08:51:05.000Z | Webpage/utils/keycloak.py | ASV-Aachen/Website | bbfc02d71dde67fdf89a4b819b795a73435da7cf | [
"Apache-2.0"
] | null | null | null | import os
from django.contrib.auth.models import User, Group
from keycloak import KeycloakAdmin, KeycloakOpenID
from cruises.models import sailor
from member.models import role, profile
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def getKeycloackAdmin()-> KeycloakAdmin:
ke... | 30.593985 | 85 | 0.565249 |
54fc089f97f7ce1f0bd227d32ae53560d333a49c | 3,001 | py | Python | 21-fs-ias-lec/13-RaptorCode/src/encoder.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/encoder.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/encoder.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | import numpy as np
import fountain
import utils
from utils import NUMBER_OF_ENCODED_BITS, Z, TransmissionPackage
class Encoder:
def __init__(self, MAX_NUMBER_OF_PACKAGES=10000): # data are the too be encoded bytes
self._lt = fountain.LT()
self.MAX_NUMBER_OF_PACKAGES = MAX_NUMBER_OF_PACKAGES # M... | 50.016667 | 116 | 0.633456 |
9181b8c7c4cca10c32e255d81eb18a2fcb22a490 | 8,604 | py | Python | src/data_preparation/data_preparation.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | 2 | 2020-03-25T15:48:48.000Z | 2022-02-02T18:36:24.000Z | src/data_preparation/data_preparation.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | null | null | null | src/data_preparation/data_preparation.py | HaasStefan/Pixorize_2020 | 31dbc537a68195003f50ae989e3c4677c9c96ac4 | [
"MIT"
] | null | null | null | import cv2
from torchvision import transforms
from PIL import Image
import random, os
import numpy as np
from skimage.util import random_noise
class DataPreparation:
# __init__ function for initialisation
def __init__(self, source_images_dir):
# Needed directories
self.source_images_dir = sour... | 38.24 | 119 | 0.61483 |
be82a775ba44cf3909f5c4aab07fdb9bf465537b | 270 | py | Python | exercises/zh/test_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/zh/test_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/zh/test_01_09.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert "for ent in doc.ents" in __solution__, "你有遍历实体吗?"
assert iphone_x.text == "iPhone X", "你确定iphone_x包含了所有正确的词符吗?"
__msg__.good(
"完美!当然你也不用一定要这么手动来做。"
"下一个练习我们来学习spaCy的基于规则的matcher,"
"使用它我们就可以在文本中寻找到特定的词语和短语了。"
)
| 27 | 65 | 0.651852 |
22b67483720f00cf01d732ed431a2600d6d7efb9 | 1,013 | py | Python | Packs/Pcysys/Scripts/PenteraDynamicTable/PenteraDynamicTable.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Pcysys/Scripts/PenteraDynamicTable/PenteraDynamicTable.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Pcysys/Scripts/PenteraDynamicTable/PenteraDynamicTable.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 *
def pentera_dynamic_table(incident: dict = None):
if not incident:
raise ValueError('No incident')
custom_fields = incident.get('CustomFields')
if not custom_fields:
raise ValueError('No custom fields')
operation_type = c... | 27.378378 | 72 | 0.711747 |
22d141a1d741a8451f382d7be5b3ffdd97b20a11 | 905 | py | Python | exercises/pt/solution_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/pt/solution_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/pt/solution_01_12_01.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("en_core_web_sm")
matcher = Matcher(nlp.vocab)
doc = nlp(
"After making the iOS update you won't notice a radical system-wide "
"redesign: nothing like the aesthetic upheaval we got with iOS 7. Most of "
"iOS 11's furniture remains the same a... | 36.2 | 97 | 0.727072 |
22f43dc8aa0ce238533ad92cb7527e77d940d68b | 1,238 | py | Python | rattler/settings/development.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 2 | 2017-12-17T21:28:22.000Z | 2018-02-02T14:44:58.000Z | rattler/settings/development.py | IT-PM-OpenAdaptronik/Webapp | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | 118 | 2017-10-31T13:45:09.000Z | 2018-02-24T20:51:42.000Z | rattler/settings/development.py | OpenAdaptronik/Rattler | c3bdde0ca56b6d77f49bc830fa2b8bb41a26bae4 | [
"MIT"
] | null | null | null | from .base import *
import sys
# DEBUG = True equals Development-Mode
DEBUG = True
# Cache Settings https://docs.djangoproject.com/en/2.0/ref/settings/#caches
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': 'cache:11211',
'KEY_PREFIX': ... | 28.790698 | 97 | 0.651858 |
a3f763c48290df07c3fb939cdb47515363df1020 | 2,573 | py | Python | jumeaux/logger.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 11 | 2017-10-02T01:29:12.000Z | 2022-03-31T08:37:22.000Z | jumeaux/logger.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 79 | 2017-07-16T14:47:17.000Z | 2022-03-31T08:49:14.000Z | jumeaux/logger.py | ihatov08/jumeaux | 7d983474df4b6dcfa57ea1a66901fbc99ebababa | [
"MIT"
] | 2 | 2019-01-28T06:11:58.000Z | 2021-01-25T07:21:21.000Z | # -*- coding:utf-8 -*-
from owlmixin import OwlEnum
import sys
import logging.config
class Color:
BLACK = "\033[30m"
RED = "\033[31m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
BLUE = "\033[34m"
PURPLE = "\033[35m"
CYAN = "\033[36m"
WHITE = "\033[37m"
END = "\033[0m"
BOLD = "\038... | 24.980583 | 92 | 0.561601 |
a3f84bb24be75de74b04db76508e3316da470ae3 | 871 | py | Python | analyzer/emoji_test.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | 2 | 2019-01-15T12:22:43.000Z | 2021-09-08T15:58:49.000Z | analyzer/emoji_test.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | 47 | 2018-11-08T14:06:13.000Z | 2019-01-05T17:40:26.000Z | analyzer/emoji_test.py | ringvorlesung2019mgm/twitter-bingo | f0a1f40024e335977b395049618dafda123e7a8f | [
"Apache-2.0"
] | null | null | null | from emoji import analyze_emoji_sentimens
from sentimentanalysis import get_tweet_sentiment
def test_analyze_emoji_sentimens():
assert 3/4.0 == analyze_emoji_sentimens("I 😍 python!")
assert -3/4.0 == analyze_emoji_sentimens("Perl is 💩")
assert ((3/4.0)+(-1/4.0)) / \
2 == analyze_emoji_sentimens(... | 41.47619 | 87 | 0.738232 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.