max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
contents/exprvpnmon.py | dietolead/ExpressVPN | 2 | 51300 | #! /usr/bin/python3
# monitoring for expressvpn and restarting the connection everytime it wigs out
from os import environ
from time import sleep
from shutil import copyfile
from sys import exit
import subprocess, pexpect
def check_location(loc):
"""Makes sure the location is valid. I'm just going to list the big... | 2.796875 | 3 |
backend/tournesol/throttling.py | iamnkc/tournesol | 0 | 51301 | <reponame>iamnkc/tournesol
from rest_framework.throttling import AnonRateThrottle, ScopedRateThrottle, UserRateThrottle
class BurstAnonRateThrottle(AnonRateThrottle):
"""
Limit the rate of API calls that may be made by an anonymous users.
Should be used to define a rate for a short period of time.
""... | 2.828125 | 3 |
autodraft/draftHost/logic/fantasy.py | gnmerritt/autodraft | 0 | 51302 | import datetime as d
import uuid
from django.utils import timezone
from draftHost import models
from json import JsonObject, JsonTime, EmailMasker
from performance import ReadOnlyCachedAttribute
import nfl, draft
class JsonFantasyRoster(JsonObject):
fields = ['slots',]
show_id = False
class JsonFantasyDraf... | 2.265625 | 2 |
src/__init__.py | smkell/pyfbl | 0 | 51303 | from flags import Flags
class PositionElgibility(Flags):
""" Bitwise enum for marking a player's egibility.abs
"""
catcher = ()
first_base = ()
second_base = ()
third_base = ()
short_stop = ()
outfield = ()
left_field = ()
center_field = ()
right_field = ()
designated_h... | 2.8125 | 3 |
merge.py | PeWu/python-geneteka | 1 | 51304 | <reponame>PeWu/python-geneteka<filename>merge.py
#!/usr/bin/python3
"""
Merges raw data from geneteka into larger json files.
"""
from collections import defaultdict
import html
import json
import os
import re
INPUT_DIR = 'data_raw'
OUTPUT_DIR = 'data'
def extractNotes(value):
match = re.search(r'i.png" title="... | 2.515625 | 3 |
src/tests/test_style.py | yifengyou/learn-pagure | 0 | 51305 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
<NAME> <<EMAIL>>
Tests for flake8 compliance of the code
"""
from __future__ import unicode_literals, absolute_import
import os
import subprocess
import sys
import unittest
import six
REPO_PATH = os.path.abspath(
... | 2.3125 | 2 |
tests/effects/test_equalizer.py | Nikolay-Lysenko/sinethesizer | 8 | 51306 | """
Test `sinethesizer.effects.equalizer` module.
Author: <NAME>
"""
from typing import Any, Dict, List
import numpy as np
import pytest
from scipy.signal import spectrogram
from sinethesizer.effects.equalizer import apply_equalizer
from sinethesizer.synth.core import Event
from sinethesizer.oscillators import gen... | 2.203125 | 2 |
etw/evntprov.py | tyh2333/pywintrace | 247 | 51307 | <filename>etw/evntprov.py
########################################################################
# Copyright 2017 FireEye Inc.
#
# 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:/... | 1.328125 | 1 |
stamper/views.py | uploadcare/stump | 0 | 51308 | <gh_stars>0
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.views.generic import View
from django.utils import timezone
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators... | 2.046875 | 2 |
python/search/bfs.py | c43721/Algorithms | 0 | 51309 | <reponame>c43721/Algorithms<filename>python/search/bfs.py<gh_stars>0
queue = []
visited = []
def bfs(visited, graph, start, target):
visited.append(start)
queue.append(start)
while queue:
cur = queue.pop(0)
if cur == target:
break
for child in graph[cur]:
i... | 3.8125 | 4 |
survivor_pool/models/pick_dict.py | bitedgeco/survivor-pool | 2 | 51310 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
INITIAL_PICKS = [
{"user_id": 1, "event_id": 1, "team": "home", "week": 1},
{"user_id": 2, "event_id": 7, "team": "home", "week": 1},
{"user_id": 3, "event_id": 8, "team": "away", "week": 1},
{"user_id": 4, "event_id": 6, "t... | 1.773438 | 2 |
output/models/nist_data/list_pkg/short/schema_instance/nistschema_sv_iv_list_short_min_length_5_xsd/__init__.py | tefra/xsdata-w3c-tests | 1 | 51311 | from output.models.nist_data.list_pkg.short.schema_instance.nistschema_sv_iv_list_short_min_length_5_xsd.nistschema_sv_iv_list_short_min_length_5 import NistschemaSvIvListShortMinLength5
__all__ = [
"NistschemaSvIvListShortMinLength5",
]
| 1.0625 | 1 |
_old.py | lrcfmd/PhaseSelect | 1 | 51312 | <filename>_old.py
import sys
import json
import pickle
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.preprocessing import StandardScaler
from Atom2Vec.Atom2Vec_encoder import Atom2Vec
from AtomicModel import * #Endtoend, RankingAE
from utils import *
from post_process import *
class Phas... | 2.53125 | 3 |
find_pole.py | gaowanlu/electronic-design-competition | 4 | 51313 | <reponame>gaowanlu/electronic-design-competition
import sensor, image,struct,math
import utils
import Message
class Pole(object):
flag=0
x=0
y=0
angle=0
distance=0
poleData=Pole()
IMG_CENTER_X=int(utils.IMG_WIDTH/2)
IMG_CENTER_Y=int(utils.IMG_HEIGHT/2)
black_threshold=(18, 47, -31, 3, -42, -16)
d... | 2.953125 | 3 |
tests/bitmovin/bitmovin_test_case.py | camberbridge/bitmovin-python | 44 | 51314 | <gh_stars>10-100
import unittest
import logging
import sys
from tests import utils
class BitmovinTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.utils = utils
self.settings = self.utils.get_settings()
if not self.settings or ... | 2.421875 | 2 |
lumbermill/misc/SimpleStats.py | dstore-dbap/LumberMill | 15 | 51315 | # -*- coding: utf-8 -*-
import os
import sys
import time
import socket
import psutil
import datetime
from collections import defaultdict
import lumbermill.utils.DictUtils as DictUtils
from lumbermill.BaseThreadedModule import BaseThreadedModule
from lumbermill.utils.Decorators import ModuleDocstringParser, setInterval... | 2.40625 | 2 |
migrations/versions/43162db35c55_.py | NeverLeft/FLASKTPP | 0 | 51316 | """empty message
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2018-06-12 14:27:07.207294
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | 1.890625 | 2 |
ehr_ml/featurizer.py | som-shahlab/ehr_ml | 4 | 51317 | from __future__ import annotations
import datetime
import json
from abc import ABC, abstractmethod
from collections import defaultdict, deque, namedtuple
from typing import (
Any,
Deque,
Dict,
Iterator,
List,
Mapping,
Optional,
Set,
TextIO,
Tuple,
)
import numpy as np
import sc... | 2.6875 | 3 |
redeploy_rancher_workload.py | PerrorOne/rancher-update-workload | 0 | 51318 | from datetime import datetime
import logging
import os
import sys
from typing import List
import requests
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', level=logging.INFO)
required_environment_variables: List[str] = [
'RANCHER_BEARER_TOKEN',
'RANCHER_CLUSTER_ID',
'RANCH... | 2.328125 | 2 |
scripts/check_db.py | brl0/bripy | 0 | 51319 | <filename>scripts/check_db.py
from sqlalchemy import create_engine
import pandas as pd
database = 'fileinfo.db'
engine = create_engine(f'sqlite:///{database}')
df = pd.read_sql('SELECT * FROM files;', engine)
print(df.info())
print(df.head())
| 2.703125 | 3 |
Train_SDAE/stacked_dae.py | glrs/StackedDAE | 28 | 51320 | <gh_stars>10-100
from __future__ import division
import tensorflow as tf
import numpy as np
import time
import sklearn
from sklearn.metrics import precision_score, confusion_matrix
from sklearn.metrics import recall_score, f1_score, roc_curve
from dae import DAE_Layer
from os.path import join as pjoin
#from utils i... | 2.21875 | 2 |
lib/bes/text/text_fit.py | reconstruir/bes | 0 | 51321 | <gh_stars>0
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from .string_lexer import string_lexer as lexer
from bes.compat.StringIO import StringIO
class text_fit(object):
'Fit text into bounded areas keeping words intact.'
@classmethod
def fit_text(clazz, text, widt... | 2.8125 | 3 |
tests/test_utils.py | fareszr/app | 0 | 51322 | <filename>tests/test_utils.py
from app.config import ALLOWED_REDIRECT_DOMAINS
from app.utils import random_string, random_words, sanitize_next_url
def test_random_words():
s = random_words()
assert len(s) > 0
def test_random_string():
s = random_string()
assert len(s) > 0
def test_sanitize_url():
... | 2.734375 | 3 |
model/productshelflife.py | beda-software/fhir-py-experements | 0 | 51323 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProductShelfLife) on 2020-02-03.
# 2020, SMART Health IT.
import sys
from dataclasses import dataclass, field
from typing import ClassVar, Optional, List
from .backboneelement i... | 2.1875 | 2 |
examples/simple.py | AhmadNaruto/pyromenu | 1 | 51324 | <reponame>AhmadNaruto/pyromenu<gh_stars>1-10
from pyrogram import Client, Message, Filters, ReplyKeyboardRemove
from pyromenu import *
app = Client("simple usage")
# create simple keyboard
menu = KMenu(
KRow(KButton("1"), KButton("2"), KButton("3")),
KRow(KButton("4"), KButton("5")),
KRow(KButton("close")... | 2.671875 | 3 |
src/resources/weather_widgets.py | logyball/raspberry-pi-vacation-planner | 1 | 51325 | from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QWidget, QLabel
from PyQt5.QtCore import Qt
from src.resources.base_containers import BaseVContainer
from src.backend.styling import load_stylesheet
from src.backend.config import ConfigFunctions
class SnowReport(BaseVContainer):
label: QLabel = None
... | 2.421875 | 2 |
storyscript/compiler/semantics/__init__.py | marqov/storyscript | 1 | 51326 | # -*- coding: utf-8 -*-
from storyscript.compiler.semantics.Semantics import Semantics
__all__ = ['Semantics']
| 0.96875 | 1 |
tests/unit/cmds/test_cmd_my_name.py | gsfellis/noob_snhubot | 2 | 51327 | <filename>tests/unit/cmds/test_cmd_my_name.py
import string
import random
from cmds import my_name
from Bot import Bot
class TestCmdMyName(object):
cmd = "what's my name?"
uid = ''.join(random.choice(string.ascii_uppercase + string.digits)
for _ in range(9))
bot = Bot(uid, None, None)
... | 3.15625 | 3 |
tests/test_cases.py | kpdemetriou/spectral-aead | 0 | 51328 | <filename>tests/test_cases.py
import binascii
import spectral
def test_encryption(cases):
for key, nonce, plaintext, associated, ciphertext, mac in cases:
key, nonce, plaintext, associated, ciphertext, mac = map(
binascii.unhexlify, (key, nonce, plaintext, associated, ciphertext, mac)
... | 2.734375 | 3 |
src/django_include_bootstrap/migrations/0002_auto_20200112_1311.py | xelaxela13/django_include_bootstrap | 0 | 51329 | # Generated by Django 3.0.2 on 2020-01-12 13:11
from django.db import migrations
bootstrap_version = "4.4.1"
jquery_version = "3.3.1"
popover_version = "1.14.3"
fontawesome_version = "4.7.0"
urls_settings = [
{
"library": 4,
"version": bootstrap_version,
"url": f"https://stackpath.bootstra... | 1.484375 | 1 |
USB/python/test-usb2001tc.py | wjasper/Linix_Drivers | 100 | 51330 | #! /usr/bin/python3
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | 2.9375 | 3 |
src/nlp/main.py | Ophir-Gal/sm-scraper | 1 | 51331 | <reponame>Ophir-Gal/sm-scraper
from src.nlp.util import * ; import src.nlp.util as util
from src.nlp.pipeline import pipeline, state_dict
from src.nlp.classifiers import classifiers
import flask
app = flask.Flask(__name__)
@app.route('/get-relevance-classifiers')
def get_relevance_classifiers():
names = sort... | 2.375 | 2 |
Medium/621. Task Scheduler/solution (1).py | czs108/LeetCode-Solutions | 3 | 51332 | # 621. Task Scheduler
class Solution:
# Greedy
def leastInterval(self, tasks: List[str], n: int) -> int:
# Maximum possible number of idle slots is defined by the frequency of the most frequent task.
freq = [0] * 26
for t in tasks:
freq[ord(t) - ord('A')] += 1
freq.... | 3.546875 | 4 |
app.py | MHolmblad13/LoLCalcDash | 0 | 51333 | <reponame>MHolmblad13/LoLCalcDash
import dash
import dash_bootstrap_components as dbc
external_stylesheets = [dbc.themes.CERULEAN,'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets,#)
suppress_callback... | 1.523438 | 2 |
examples/color_cycle.py | tonymke/tkursed | 0 | 51334 | import itertools
import sys
import tkinter
import tkursed
class ColorCycleExample(tkursed.SimpleTkursedWindow):
def __init__(self) -> None:
super().__init__()
self.color_cycle = itertools.cycle(
[
(255, 0, 0),
(0, 255, 0),
(0, 0, 255),
... | 2.546875 | 3 |
app/realoem.py | ballon3/electricdisc | 0 | 51335 | import httpx
import requests
from bs4 import BeautifulSoup as bso
class BMW:
BASE_URL = 'https://www.realoem.com/bmw/'
LANGUAGE = 'enUS'
URL = f"{BASE_URL}{LANGUAGE}"
'https://www.realoem.com/bmw/enUS/partgrp?id=0573-USA-12-1991-K569-BMW-K_75_RT_0565,0573_&mg=46'
'https://www.realoem.com/bmw/enU... | 2.921875 | 3 |
ambra_sdk/service/entrypoints/generated/session.py | agolovkina/sdk-python | 0 | 51336 | <reponame>agolovkina/sdk-python<filename>ambra_sdk/service/entrypoints/generated/session.py
""" Session.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import AuthFailed
from ambra_sdk.exceptions.service import BadPassword
from ambra_sdk.exceptio... | 1.804688 | 2 |
core/models/model.py | Latterlig96/airflow-model-trainer | 0 | 51337 | import timm
import torch.nn as nn
import torch
from pytorch_lightning import LightningModule
import torchmetrics
from typing import Dict, Any
class EfficientNetB1(nn.Module):
def __init__(self):
super().__init__()
self.backbone = timm.create_model(
'efficientnet_b1', pretrained=True, ... | 2.28125 | 2 |
emtf_nnet/keras/quantization/default_quantize_scheme.py | jiafulow/emtf-nnet | 0 | 51338 | <filename>emtf_nnet/keras/quantization/default_quantize_scheme.py
# The following source code was originally obtained from:
# https://github.com/tensorflow/model-optimization/blob/v0.7.0/tensorflow_model_optimization/python/core/quantization/keras/default_8bit/default_8bit_quantize_scheme.py
# https://github.com/tensor... | 1.570313 | 2 |
core/modules/main/views.py | ferreiravinicius/animehub | 0 | 51339 | <gh_stars>0
from flask import Blueprint, render_template, abort
from jinja2 import TemplateNotFound
main = Blueprint('main', __name__)
@main.route('/')
def hello():
"""Render main page"""
try:
return render_template('home.html')
except TemplateNotFound:
abort(404) | 2.28125 | 2 |
stackoverflow-solutions/submission-scripts/SO_Q65710921_scraping_bball_stats_site.py | MarkMoretto/python-examples-main | 1 | 51340 | <gh_stars>1-10
"""
Purpose: Stackoverflow answer
Date created: 2021-01-13
URL: https://stackoverflow.com/questions/65710921/need-assistance-scraping-html-able-from-basketball-reference/65711123?noredirect=1#comment116182533_65711123
Contributor(s):
<NAME>.
"""
import re
from urllib.request import urlopen
url =... | 3.078125 | 3 |
bot/tickers_list.py | MasonLyons/Binance-Trading-Bot | 0 | 51341 | <gh_stars>0
import os
# use if needed to pass args to external modules
import sys
# used for directory handling
import glob
import time
import threading
#gogo MOD telegram needs import request
import requests
# needed for the binance API / websockets / Exception handling
from binance.client import Client
from binance... | 2.34375 | 2 |
tests/test_utils.py | shapiromatron/get_litter | 5 | 51342 | <reponame>shapiromatron/get_litter
from litter_getter.utils import get_author_short_text, normalize_author
class TestNormalizeAuthors:
def test_expected(self):
# test no initials
assert normalize_author("Smith") == "Smith"
assert normalize_author("Smith") == "Smith"
assert normaliz... | 2.75 | 3 |
shreya/reference/cognitive_engine_connection.py | FYQ0919/Your_First_Decentralized_Application_Python | 2 | 51343 | <filename>shreya/reference/cognitive_engine_connection.py
from flask import Blueprint, request
job_execution = Blueprint('job_execution')
@job_execution.route('/api/request_state_from_blockchain', methods=['POST'])
def request_state_from_blockchain():
'''
Checks if all executors involved have reported their... | 2.3125 | 2 |
oceanAcouPy/__init__.py | IvanaEscobar/oceanAcouPy | 0 | 51344 | <reponame>IvanaEscobar/oceanAcouPy
from oceanAcouPy import attenuation
from oceanAcouPy import beamform
from oceanAcouPy import bottomLoss
from oceanAcouPy import moi
from oceanAcouPy import reflCoeff
from oceanAcouPy import soundSpeed
from oceanAcouPy import normalModes
from oceanAcouPy import detectThreshold
from oce... | 1.46875 | 1 |
example03.py | eanorambuena/XEngine | 3 | 51345 | <filename>example03.py
from xengine import *
from OpenGL.GL import * # pip install PyOpenGL
from xengine.shaders import STANDARD_SHADER
vertex_shader, fragment_shader = STANDARD_SHADER
def setup(window):
a = 300
A = Point(0, 0, 0, MAGENTA)
B = Point(a, 0, 0, CIAN)
C = Point(0, a, 0, ... | 2.578125 | 3 |
test_HW1.py | zinhart/kvs_boost | 0 | 51346 | import unittest
import subprocess
import requests
PORT=8080
class TestHW1(unittest.TestCase):
def test1(self):
res = requests.get('http://localhost:'+str(PORT)+'/check')
self.assertEqual(res.text, 'This is a GET request', msg='Incorrect response to GET request to /check endpoint')
self.assertEqual... | 3.046875 | 3 |
lang/c/leetcode/ugly.264.py | liuyang1/test | 8 | 51347 | <gh_stars>1-10
def ugly1():
q2, q3, q5 = [2], [3], [5]
while 1:
# print q2, q3, q5
if q2[0] < q3[0] and q2[0] < q5[0]:
ret = q2.pop(0)
q2.append(ret * 2)
q3.append(ret * 3)
q5.append(ret * 5)
elif q3[0] < q2[0] and q3[0] < q5[0]:
... | 3.3125 | 3 |
features/kill.py | magnusstubman/mal00 | 3 | 51348 | <reponame>magnusstubman/mal00<gh_stars>1-10
from features import addFeature
import messages
from messages import OutgoingMessage
class KillCommand:
command = 'kill'
def run(arguments, implant):
if not implant:
print('use implant first!')
else:
message = OutgoingMessage(KillCommand.command, Non... | 2.671875 | 3 |
fourpisky/feeds/asassn.py | 4pisky/fourpisky-core | 2 | 51349 | import lxml
import lxml.html
from collections import defaultdict
import voeventparse as vp
import datetime
import iso8601
from astropy.coordinates import SkyCoord
import astropy.units as u
from fourpisky.voevent import (
create_skeleton_4pisky_voevent,
asassn_alert_substream,
get_stream_ivorn_prefix,
)
fro... | 2.25 | 2 |
source/args_parse.py | thiagoolsilva/parq-analyser | 3 | 51350 | """
Copyright (c) 2020 <NAME>
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 in writing, software
di... | 2.34375 | 2 |
tests/filters_test.py | ivan-californias/swcli | 0 | 51351 | <gh_stars>0
import unittest
from filters import Filters
from tests.data import data
class TestFilters(unittest.TestCase):
def setUp(self):
self.filters = Filters(None)
def test_filter_data_equal(self):
filtered = self.filters.filter_data(data, 'name', '=', '<NAME>')
self.assertEqual(... | 3.34375 | 3 |
code/Python/vtk_development/VTK_Example/Plotting/SpiderPlot.py | nhyilin/devNotes | 0 | 51352 | #!/usr/bin/env python
import vtk
import random
numTuples = 12
bitter = vtk.vtkFloatArray()
bitter.SetNumberOfTuples(numTuples)
crispy = vtk.vtkFloatArray()
crispy.SetNumberOfTuples(numTuples)
crunchy = vtk.vtkFloatArray()
crunchy.SetNumberOfTuples(numTuples)
salty = vtk.vtkFloatArray()
salty.SetNumberOfTuples(num... | 2.28125 | 2 |
my_model.py | indrajithshetty/cancer-ai-mlnd | 0 | 51353 | class MyModel:
def get_model(self,input_h):
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
model = Sequential()
model.add(Conv2D(30, 5, padding='same',activation='relu',input_sha... | 3.109375 | 3 |
compress_songs.py | GenericMadScientist/CH-FFmpeg-Wrapper | 3 | 51354 | <filename>compress_songs.py<gh_stars>1-10
import concurrent.futures
import os
import re
import subprocess
import sys
def get_jobs(directory):
jobs = {"albums": [], "audio_files": [], "delete": []}
for root, _, files in os.walk(directory):
for f in files:
path = os.path.join(root, f)
... | 2.515625 | 3 |
SpeechSite/apps/Speech/apps.py | take2make/SpeechRecognitionSite | 0 | 51355 | from django.apps import AppConfig
class SpeechConfig(AppConfig):
name = 'Speech'
| 1.242188 | 1 |
src/openpersonen/contrib/demo/tests/test_admin.py | maykinmedia/open-personen | 2 | 51356 | from django.urls import reverse
from django_webtest import WebTest
from webtest import Text
from openpersonen.api.tests.factory_models import PersoonFactory, UserFactory
from openpersonen.contrib.demo.models import Kind, Ouder, Persoon
class TestPersoonAdmin(WebTest):
def setUp(self):
super().setUp()
... | 2.125 | 2 |
bindings/python/py_src/tokenizers/tools/visualizer.py | AnubhabB/tokenizers | 5,620 | 51357 | import os
import itertools
import re
from typing import List, Optional, Tuple, Dict, Callable, Any, NamedTuple
from string import Template
from typing import List
from tokenizers import Tokenizer, Encoding
dirname = os.path.dirname(__file__)
css_filename = os.path.join(dirname, "visualizer-styles.css")
with open(css_... | 2.75 | 3 |
backend/groups/admin.py | donicrazy/ChatApp | 0 | 51358 | from django.contrib import admin
from .models import (
ChatGroup,
GroupMembership,
GroupMessage,
GroupMessageInfo,
)
admin.site.register(ChatGroup)
admin.site.register(GroupMembership)
admin.site.register(GroupMessage)
admin.site.register(GroupMessageInfo)
| 1.390625 | 1 |
test.py | Schumi543/bitbar_gcal_event | 2 | 51359 | <filename>test.py<gh_stars>1-10
import unittest
from get_gcal_next_event import _parse_event
# detail see. https://developers.google.com/calendar/v3/reference/events
event_base = {"summary": "event_name", "start": {"dateTime": "2020-01-01T00:00:00+09:00"}}
event_with_meet = event_base.copy()
event_with_meet["hangout... | 2.671875 | 3 |
successor/skaters/scalarskaters/scalartsaskaters.py | microprediction/successor | 0 | 51360 | from successor.skaters.scalarskaters.scalarskaterfactory import scaler_skater_factory
def suc_tsa_p2_d0_q1(y,s,k,a=None,t=None,e=None,r=None):
return scaler_skater_factory(y=y,s=s,k=k,skater_name='tsa_p2_d0_q1',n_input=160)
SCALAR_TSA_SKATERS = [suc_tsa_p2_d0_q1]
| 1.601563 | 2 |
src/rocket/stage2/src/trajectory/__init__.py | proballstar/atlas | 0 | 51361 | <filename>src/rocket/stage2/src/trajectory/__init__.py
from . import trajectory_calc | 1.195313 | 1 |
shopapp/shoptrans/migrations/0015_auto_20181209_1600.py | biseshbhattarai/Transaction-Microservice | 0 | 51362 | <gh_stars>0
# Generated by Django 2.1 on 2018-12-09 10:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shoptrans', '0014_auto_20181209_1554'),
]
operations = [
migrations.AlterField(
model_name='product',
name... | 1.460938 | 1 |
compiler/router/tests/07_big_test.py | panicmarvin/OpenRAM | 0 | 51363 | #!/usr/bin/env python2.7
"Run a regresion test the library cells for DRC"
import unittest
from testutils import header
import sys,os
sys.path.append(os.path.join(sys.path[0],"../.."))
sys.path.append(os.path.join(sys.path[0],".."))
import globals
import debug
import calibre
OPTS = globals.OPTS
class big_test(unittes... | 2.203125 | 2 |
tests/test_02_dxf_graphics/test_238_tolerance.py | jpsantos-mf/ezdxf | 1 | 51364 | <reponame>jpsantos-mf/ezdxf<filename>tests/test_02_dxf_graphics/test_238_tolerance.py
# Copyright (c) 2019 <NAME>
# License: MIT License
import pytest
import ezdxf
from ezdxf.entities.tolerance import Tolerance
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
TOLERANCE = """0
TOLERANCE
5
0
330
0
10... | 2.09375 | 2 |
MIDIInput.py | Dan-field/Jazz | 1 | 51365 | <filename>MIDIInput.py<gh_stars>1-10
###############################################################
# MIDI Input class by <NAME> #
# #
# contains functions to be used in the improvisor #
# check out www.github.com/dan-fi... | 2.640625 | 3 |
core/argo/core/network/s-vae/hyperspherical_vae/ops/ive.py | szokejokepu/natural-rws | 164 | 51366 | # Copyright 2016 The TensorFlow 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 applica... | 2.296875 | 2 |
makeGif.py | andersdot/modelMWkinematics | 0 | 51367 | import imageio
import numpy as np
import sys
filenamepre = sys.argv[1]
filenamepost = sys.argv[2]
images = []
frames = np.arange(35, 165)
for i in range(9):
for j in range(9):
filename = '{0}_{1:03d}_{2:03d}.{3}'.format(filenamepre, i+1, j+1, filenamepost)
print filename
images.append(imag... | 2.71875 | 3 |
gen_fdm.py | lljbash/FastTT | 6 | 51368 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
alpha = np.random.rand(7)
alpha /= np.linalg.norm(alpha, 1)
n = 40
def index_to_position(index):
p = 0
a, b, c, d, e, f = index
index = [a, d, b, e, c, f]
for i in index:
p = p * n + i
return p
if __name__ == "__main__":
... | 3 | 3 |
measures/migrations/0005_auto_20210224_2242.py | uktrade/tamato | 14 | 51369 | # Generated by Django 3.1 on 2021-02-24 22:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("measures", "0004_rename_condition_component_measurement"),
]
operations = [
migrations.AlterModelOptions(
name="measurecondition",
... | 1.414063 | 1 |
src/pipeline/classification.py | heindorf/wsdmcup17-wdvd-classification | 2 | 51370 | # -----------------------------------------------------------------------------
# WSDM Cup 2017 Classification and Evaluation
#
# Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... | 1.421875 | 1 |
RKD/model/backbone/inception/google.py | pantheon5100/fmcw-finetune-RKD | 2 | 51371 | <filename>RKD/model/backbone/inception/google.py
import os
import torch
import torch.nn as nn
import h5py
from collections import OrderedDict
from torchvision.datasets.utils import download_url
__all__ = ["GoogleNet"]
class GoogleNet(nn.Sequential):
output_size = 1024
input_side = 227
rescale = 255.0
... | 2.203125 | 2 |
openpype/hosts/aftereffects/plugins/publish/collect_extension_version.py | 2-REC-forks/OpenPype | 87 | 51372 | import os
import re
import pyblish.api
from avalon import aftereffects
class CollectExtensionVersion(pyblish.api.ContextPlugin):
""" Pulls and compares version of installed extension.
It is recommended to use same extension as in provided Openpype code.
Please use Anastasiy’s Extension Manager ... | 2.25 | 2 |
py/mistql/cli.py | evinism/millieql | 263 | 51373 | <reponame>evinism/millieql
#!/usr/bin/env python3
from typing import Union
import argparse
from mistql import __version__
from mistql import query
import sys
import json
import logging
log = logging.getLogger(__name__)
parser = argparse.ArgumentParser(
description="CLI for the python MistQL query language implem... | 2.46875 | 2 |
footballleagues/views/players.py | RicardoSilveira23/TonicAppChallenge | 0 | 51374 | <reponame>RicardoSilveira23/TonicAppChallenge
import logging
from rest_framework import generics, status
from rest_framework.response import Response
from django.db.models.functions import Now
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import Paginator
from drf_yasg.utils import sw... | 2.09375 | 2 |
niimpy/test_read_sql.py | AaltoRSE/niimpy | 0 | 51375 | <gh_stars>0
import niimpy
from . import read
from . import sampledata
def test_read_sql():
data = niimpy.read_sql(sampledata.DATA, table='AwareScreen')
| 1.585938 | 2 |
tests/unit/test_idaho.py | DigitalGlobe/gbdxtools | 81 | 51376 | """
Authors: <NAME>, <NAME>
Contact: <EMAIL>
Unit tests for the gbdxtools.Idaho class
"""
import os
from gbdxtools import Interface
from gbdxtools.idaho import Idaho
from auth_mock import get_mock_gbdx_session
import vcr
import tempfile
import unittest
def force(r1, r2):
return True
my_vcr = vcr.VCR()
my_vcr.... | 2.0625 | 2 |
csvsplitter.py | harryhan1989/csvsplitter | 7 | 51377 | <gh_stars>1-10
import sys,os
import py2 as csv
import converter,iohelper
from itertools import groupby
def do_split(csvfilepath,colidx):
result = {}
header=[]
iohelper.delete_file_folder('splitted/')
iohelper.dir_create('splitted/')
with open(csvfilepath, 'rb') as csvfile:
csvreader = csv.r... | 2.71875 | 3 |
django_todo/apps/core/models.py | maxicecilia/django_todo | 0 | 51378 | <reponame>maxicecilia/django_todo<gh_stars>0
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class TaskManager(models.Manager):
def pending_tasks(self, user):
return super(TaskManager, self).get_queryset().filter(is_checked=False, user=user).order_by('-date... | 2.1875 | 2 |
polski/tests/test_main.py | Matt-Deacalion/Polskie | 4 | 51379 | import unittest
from main import Polski
class PolskiTest(unittest.TestCase):
def setUp(self):
self.polski = Polski()
| 2.296875 | 2 |
omd/versions/1.2.8p15.cre/share/check_mk/web/htdocs/main.py | NCAR/spol-nagios | 0 | 51380 | <reponame>NCAR/spol-nagios<filename>omd/versions/1.2.8p15.cre/share/check_mk/web/htdocs/main.py
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ... | 1.523438 | 2 |
MRT-and-LRT-Stations-master/combine.py | shamim-akhtar/tutorial-pathfinding | 6 | 51381 | import pandas as pd
bus_stops = pd.read_csv('./bus_stops.csv')
stations = pd.read_csv('./mrt_lrt.csv')
def strip_mrtlrt(row):
assert(
row['Name'].endswith(' MRT STATION') or\
row['Name'].endswith(' LRT STATION')
)
l = len(' MRT STATION')
return row['Name'][:-l]
stations['Name'] = sta... | 3.15625 | 3 |
osc_bge/branch/migrations/0017_bgeresource.py | jisuhan3201/osc-bge | 0 | 51382 | # Generated by Django 2.0.9 on 2018-12-13 09:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('branch', '0016_hoststude... | 1.734375 | 2 |
Projects/CPF/funcoes.py | EduardoArgenti/Python | 0 | 51383 | from random import randint
# Remove o ponto e hífen do CPF.
def removerFormatacaoCpf(cpf):
resultado = cpf.replace(".", "")
resultado = resultado.replace("-", "")
return resultado
# Adiciona o ponto e hífen no CPF.
def adicionarFormatacaoCpf(cpf):
cpfFormatado = ''
cpfFormatado += cpf[:3]
c... | 3.5 | 4 |
rhprocessor/output.py | rhodief/rhprocessor | 0 | 51384 | from typing import List
from .controls import ACTION_TYPE, ExecutionControl, Logger
from .processor import Processor
import curses
import datetime
FRAME_WIDTH = 100
APP_NAME = 'RhProcessor'
proc_map = None
class Slot():
def __init__(self, node_dict: dict, logger: Logger, execution_control: ExecutionControl, ids: ... | 2.171875 | 2 |
pipelines/lig/generation.py | wnbzhao/Local-Implicit-Grid-Pytorch | 3 | 51385 | import torch
import torch.optim as optim
from torch import autograd
import numpy as np
from tqdm import trange
import trimesh
from skimage import measure
import warnings
import time
from pipelines.utils.point_utils import sample_points_from_ray, np_get_occupied_idx, occupancy_sparse_to_dense
from pipelines.utils.postpr... | 2.203125 | 2 |
solve.py | Artisan-Lab/SMTimer | 5 | 51386 | import sys
import time
import json
import traceback
from six.moves import cStringIO
from pysmt.shortcuts import Solver
from pysmt.smtlib.parser import SmtLibParser
def process_data(data):
try:
data = json.loads(data)
atime = float(data["time"])
if 'smt_script' in data.keys():
d... | 2.5 | 2 |
manager/context_manager.py | chm10/MyShortcuts | 1 | 51387 | #!/us/bin/env python3
import time
class timer (object):
def __enter__(self):
self.start = time.time()
print('Timer starts at: %s' % self.start)
return self
def __exit__(self, type, value, traceback):
self.stop = time.time()
print('Timer stops at: %s' % sel... | 3.921875 | 4 |
EntityRelation/core/core.py | LG-1/EntityRelation | 2 | 51388 |
class EntityPair(object):
"""实体对
Atrributes:
entity1: WordUnit,实体1的词单元
entity2: WordUnit,实体2的词单元
"""
def __init__(self, entity1, entity2):
self.entity1 = entity1
self.entity2 = entity2
def get_entity1(self):
return self.entity1
def set_entity1(self, en... | 3.34375 | 3 |
mayan/apps/folders/forms.py | camerondphillips/MAYAN | 0 | 51389 | from __future__ import absolute_import, unicode_literals
import logging
from django import forms
from django.core.exceptions import PermissionDenied
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessEntry
from permissions.models import Permission
from .models import Folder
from .... | 2.078125 | 2 |
pythonCode/1.py | 8-vishal/6-DOF-robot-simulation | 0 | 51390 | import pybullet as sim
import time
pc = sim.connect(sim.GUI)
sim.setGravity(0, 0, -9.8)
path = "path to your URDF file"
armID = sim.loadURDF(path, basePosition=[0, 0, 0], useFixedBase=True)
while pc != 0:
sim.stepSimulation()
time.sleep(0.01)
| 2.3125 | 2 |
docs/golang/go-build-web-applications/module1/go-build-web-applications/test.py | PegasusWang/booknotes | 52 | 51391 | import requests
url = 'http://127.0.0.1:9000/api/comments'
resp = requests.post(
url,
data={
"name": "wnn",
"email": "<EMAIL>",
"comments": "comment",
"page_id":"2"
}
)
print(resp.text)
| 2.484375 | 2 |
examples/httpexample/views.py | stratoukos/celery | 1 | 51392 | <reponame>stratoukos/celery
from django.http import HttpResponse
from anyjson import dumps
def multiply(request):
x = int(request.GET["x"])
y = int(request.GET["y"])
retval = x * y
response = {"status": "success", "retval": retval}
return HttpResponse(dumps(response), mimetype="application/json"... | 2.3125 | 2 |
bom1/bom1/fetch_ID.py | vstenby/Best-of-Mat1 | 9 | 51393 | <filename>bom1/bom1/fetch_ID.py<gh_stars>1-10
def fetch_ID(url):
'''
Takes a video.dtu.dk link and returns the video ID.
TODO: This should make some assertions about the url.
'''
return '0_' + url.split('0_')[-1].split('/')[0] | 2.8125 | 3 |
edit_model/encdec/__init__.py | neulab/incremental_tree_edit | 32 | 51394 | <reponame>neulab/incremental_tree_edit
from .graph_encoder import SyntaxTreeEncoder
from .sequential_decoder import SequentialDecoder
from .transition_decoder import TransitionDecoder
| 0.769531 | 1 |
api/tests/python/models/test_user.py | jordiwes/namex | 1 | 51395 | <reponame>jordiwes/namex
from namex.models import User
def test_user(session, client):
"""Start with a blank database."""
user1 = User(username = 'thor', firstname = 'thor', lastname = 'g', sub = 'abcdefg', iss='http://nowhere.localdomain')
session.add(user1)
session.commit()
assert user1.id is... | 2.75 | 3 |
myblog/forms.py | kaka4NERV/my-blog | 0 | 51396 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import DataRequired, Length
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(5, 20)])
password = PasswordField('Passw... | 2.90625 | 3 |
workflow/coron.py | hchyhchyxh/tools | 45 | 51397 | <reponame>hchyhchyxh/tools
#!/usr/bin/python
# Copyright 2015 Coron
#
# 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 appl... | 1.898438 | 2 |
main.py | majickdave/musicmind_collector | 0 | 51398 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 05 20:42:19 2017
@author: david
"""
import audio_features0
import string
import json
import time
#Enter Artist Track and confirm lyrics and analysis
a = raw_input('Artist: ') ; b = raw_input('Track: ')
# a = 'london grammar'; b = 'oh woman'
if... | 2.90625 | 3 |
tsp_heuristics/heuristics/nn.py | Martins6/tsp-heuristics | 0 | 51399 | import numpy as np
from time import time
from typing import List, Tuple
from tsp_heuristics.heuristics.utils import get_tour_distance
def nn_algo(
dist_matrix: np.array,
start: int = 0
) -> Tuple[List, float]:
"""
From a start city index, get an Tour according to the Nearest Neighbor
algorithm from... | 3.453125 | 3 |