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
tests/simulators/test_tcm.py
jason-neal/companion_simulations
1
12783351
import os import pytest import simulators from simulators.tcm_module import (tcm_helper_function, setup_tcm_dirs) from simulators.tcm_script import parse_args @pytest.mark.parametrize("star, obs, chip", [ ("HD30501", 1, 1), ("HD4747", "a", 4)]) def test_tcm_helper_function(sim_config, star, obs, chip): ...
2.25
2
src/orders/migrations/0007_OrderPromoCodes.py
denkasyanov/education-backend
151
12783352
<gh_stars>100-1000 # Generated by Django 2.2.13 on 2020-09-30 13:14 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('orders', '0006_PromoCodeComments'), ] operations = [ migrations.AddField( m...
1.515625
2
yah/types/responses.py
sunsx0/yah
0
12783353
<reponame>sunsx0/yah import typing import dataclasses as dc from .household import Household @dc.dataclass class ResponseBase: status: str request_id: str @dc.dataclass class HouseholdsResponse(ResponseBase): households: typing.List[Household] = dc.field(default_factory=list)
2.4375
2
fiasco_api/tags/urls.py
xelnod/fiasco_backend
0
12783354
<filename>fiasco_api/tags/urls.py from django.urls import path from .views import TagListCreateView, TagRetrieveUpdateDestroyView urlpatterns = [ path('', TagListCreateView.as_view()), path('<int:pk>/', TagRetrieveUpdateDestroyView.as_view()), ]
1.640625
2
devscripts/make_supportedsites.py
olipfei/yt-dlp
11
12783355
<filename>devscripts/make_supportedsites.py #!/usr/bin/env python3 import optparse import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from yt_dlp.extractor import list_extractor_classes def main(): parser = optparse.OptionParser(usage='%prog OUTFILE.md') _, ...
2.484375
2
src/diary/api/models.py
hoest/online-dagboek
1
12783356
import datetime import diary import itsdangerous ROLE_USER = 0 ROLE_ADMIN = 1 """ User-diary many-to-many relationship """ dairy_user_table = diary.db.Table( "dairy_user", diary.db.Model.metadata, diary.db.Column("diary_id", diary.db.Integer, diary.db.ForeignKey("diary.id")),...
2.546875
3
eng_to_kana_test/test_morae_kana_converter.py
yokolet/transcript
2
12783357
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import unittest from eng_to_kana.morae_kana_converter import MoraeKanaConverter class TestMoraeKanaConverter(unittest.TestCase): def setUp(self): self.func = MoraeKanaConverter().convertMorae def test_1(self): ...
2.46875
2
uptee/lib/templatetags/revision.py
teeworldsCNFun/upTee
2
12783358
from django import template from django.core.cache import cache register = template.Library() @register.simple_tag def revision(): rev = cache.get('current_revision') if rev == None: from lib.revision_hook import get_revision, set_cache rev = get_revision() set_cache(rev) return "...
2.0625
2
Paddle_Industry_Practice_Sample_Library/nlp_projects/nlu/bilstm_with_crf/model.py
linuxonly801/awesome-DeepLearning
1
12783359
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2.203125
2
globus_search_cli/commands/index/role/delete.py
globus/globus-search-cli
1
12783360
<filename>globus_search_cli/commands/index/role/delete.py import click from globus_search_cli.config import get_search_client from globus_search_cli.parsing import globus_cmd, index_argument from globus_search_cli.printing import format_output @globus_cmd("delete", help="Delete a role (requires admin or owner)") @in...
2.078125
2
experiment_automator/image_uploader.py
mpolatcan/ml-notifier
1
12783361
<filename>experiment_automator/image_uploader.py from experiment_automator.exceptions import ImageUploaderException from experiment_automator.constants import SlackConstants, OAuthConstants, FlickrConstants, OtherConstants from experiment_automator.oauth_client import OAuthClient from experiment_automator.utils import ...
2.171875
2
Solver/threshold.py
steveknipmeyer/ModelRelief
0
12783362
<reponame>steveknipmeyer/ModelRelief #!/usr/bin/env python """ .. module:: Threshold :synopsis: Support for applying thresholds to image components. .. moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np from services import Services class Threshold: """ A class for Support for applying thresholds to ...
2.671875
3
honeysnap/__init__.py
honeynet/honeysnap
7
12783363
# $Id$ import main
1.117188
1
apps/product/admin.py
gurnitha/django-russian-ecommerce
1
12783364
<gh_stars>1-10 # apps/home/admin.py # Django locals from django.contrib import admin # Django local from apps.product.models import Category, Product, Images class CategoryAdmin(admin.ModelAdmin): list_display = ['title','parent', 'status'] list_filter = ['status'] class ProductImageInline(admin.TabularIn...
1.921875
2
deployutils/apps/django/settings.py
nomadigital/djaodjin-deployutils
5
12783365
<gh_stars>1-10 # Copyright (c) 2019, Djaodjin Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of c...
1.203125
1
scripts/addons/animation_nodes/nodes/object/object_visibility_output.py
Tilapiatsu/blender-custom_conf
2
12783366
import bpy from bpy.props import * from ... base_types import AnimationNode, VectorizedSocket attributes = [ ("Hide Viewport", "hide", "hide_viewport", "useHideViewportList"), ("Hide Render", "hideRender", "hide_render", "useHideRenderList"), ("Hide Select", "hideSelect", "hide_select", "useHideSelectList"...
2.28125
2
fusion/fusion/settings.py
souluanf/django-essencial
0
12783367
<filename>fusion/fusion/settings.py import os import dj_database_url try: from .settings_local import * except ImportError: pass BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ENVIRONMENT = os.environ.get('ENVIRONMENT', 'development') INTERNAL_IPS = ['127.0.0.1'] ALLOWED_HOSTS = ['*'...
1.664063
2
users/views.py
Fhoughton/Babble
0
12783368
<reponame>Fhoughton/Babble from django.shortcuts import render, redirect #from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from django.contrib.auth.decorators import login_required from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm def register(reques...
2.171875
2
lifetracker/tracker/urls.py
KenN7/LifeTracker
0
12783369
from django.conf.urls import url, include import django.contrib.auth.views import tracker.views urlpatterns = [ url(r'^$', tracker.views.tracker_page, name='tracker-page'), url(r'^door-opener$', tracker.views.door_opener, name='door-opener'), url(r'^login$', django.contrib.auth.views.login, {'t...
1.71875
2
prune_model/export_saved_model.py
smsaladi/EASTdb
0
12783370
<filename>prune_model/export_saved_model.py """ Convert Keras model to tensorflow format for serving """ import argparse import tensorflow.compat.v1 as tf def convert_tfserving(model_fn, export_path): """Converts a tensorflow model into a format for tensorflow_serving `model_fn` is the model filename ...
3.265625
3
app.py
Mastermindzh/Subdarr
6
12783371
<filename>app.py """Subdarr Subdarr is a module which listens to post requests with movie/serie information and downloads subtitles in the languages requested. """ import json import os import meinheld import datetime from datetime import timedelta from logger.logger import log from flask import Flask, request, send_...
2.796875
3
edalize/trellis.py
QuickLogic-Corp/edalize
2
12783372
<reponame>QuickLogic-Corp/edalize # Copyright edalize contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os.path from edalize.edatool import Edatool from edalize.yosys import Yosys from importlib import import_module class Trellis(Edatool):...
1.945313
2
rllib_integration/sensors/sensor.py
rsuwa/rllib-integration
22
12783373
#!/usr/bin/env python # Copyright (c) 2021 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Here are defined all the CARLA sensors """ import copy import math import...
2.4375
2
stock_portfolio/models/junction.py
katcosgrove/stock-portfolio
0
12783374
from sqlalchemy import ( Index, Column, Integer, String, ForeignKey, ) # from sqlalchemy.orm import relationship from .meta import Base class Junction(Base): __tablename__ = 'user_portfolios' id = Column(Integer, primary_key=True) stock_id = Column(String, ForeignKey('stocks.symbol'),...
2.359375
2
dos/classification/breast_cancer_wisconsin.py
disooqi/COMP-6321-Project
1
12783375
import pandas as pd from scipy.io import arff from sklearn.preprocessing import OneHotEncoder, LabelEncoder, OrdinalEncoder, StandardScaler from sklearn.impute import SimpleImputer from sklearn.pipeline import Pipeline from sklearn.compose import ColumnTransformer from sklearn.neural_network import MLPClassifier from s...
2.421875
2
setup.py
jonhadfield/fval
0
12783376
#!/usr/bin/env python import os import re import sys from setuptools import (setup, find_packages) if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload -r pypi') sys.exit() install_requires = ['colorama', 'colorlog', 'PyYAML>=3.11', ...
1.546875
2
jd/api/rest/OrderCheckRefuseOrderQueryRequest.py
fengjinqi/linjuanbang
5
12783377
<reponame>fengjinqi/linjuanbang from jd.api.base import RestApi class OrderCheckRefuseOrderQueryRequest(RestApi): def __init__(self,domain='gw.api.360buy.com',port=80): RestApi.__init__(self,domain, port) self.date = None self.page = None def getapiname(self): return 'biz.order.checkRefuseOrder.query'...
2.109375
2
Math/P07 - reverseInteger.py
HarshOza36/LeetCode_Problems
0
12783378
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ num = x x = str(abs(x)) out = int(x[::-1]) if(out > 2**31 -1 or out < -2**31): return 0 elif(num < 0): return -1*out else: ...
3.515625
4
game.py
projeto-de-algoritmos/Lista2_GustavoM_JoaoM
0
12783379
import pygame from screens import AnswerScreen, FinishScreen, InfoScreen, MenuScreen, QuestionScreen, TestSceen from time import sleep class Game: # Game constants WIDTH = 1024 HEIGHT = 768 GAME_NAME = '<NAME>' INTRO_TEXT = '' # Game states running = True __screens = {} current_sc...
3.171875
3
main.py
winogradoff/VK-Chat-Guard
3
12783380
<filename>main.py from os import environ, remove from datetime import datetime from hashlib import md5 from time import sleep from requests import get, post from vk import API from apscheduler.schedulers.blocking import BlockingScheduler class ChatGuard: def __init__(self, token, chat_id, title, cache_url, cache_...
2.5
2
tools/notebook/extensions/wstl/magics/_location_test.py
jianliyyh/healthcare-data-harmonization
1
12783381
# Copyright 2020 Google LLC. # # 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, soft...
2.25
2
async_scrapy_api/__init__.py
QYLGitHub/async_scrapyd_api
0
12783382
<reponame>QYLGitHub/async_scrapyd_api<filename>async_scrapy_api/__init__.py """" scrapyd api 的异步实现 """ from .client import ScrapyApi as _ScrapyApi class AsyncScrapyApi(_ScrapyApi): pass version = __version__ = '0.0.1' __all_ = ["AsyncScrapyApi"]
1.289063
1
password/strongPasswd.py
Gao-zl/tools
0
12783383
<reponame>Gao-zl/tools<gh_stars>0 # -*- coding:utf-8 -*- ''' Version: V1.0 Time: 2020.08.21 Author: Gaozhl ''' import string import random char_set = {'small': 'abcdefghijklmnopqrstuvwxyz', 'nums': '0123456789', 'big': 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'special': '^!\$%&/()...
2.9375
3
test.py
TopShares/DuoWan
0
12783384
#encoding:utf-8 import requests ID = '137442' url = 'http://tu.duowan.cn/gallery/%s.html' % ID headers = { 'User-Agent': 'Mozilla/5.0 (Linux; U; Android 8.1.0; zh-cn; OE106 Build/OPM1.171019.026) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/9.2 Mobile Safari/537.36', 'Ref...
2.84375
3
examples/simple.py
ldn-softdev/pyeapi
126
12783385
#!/usr/bin/env python from __future__ import print_function import pyeapi connection = pyeapi.connect(host='192.168.1.16') output = connection.execute(['enable', 'show version']) print(('My system MAC address is', output['result'][1]['systemMacAddress']))
2.3125
2
bpy_lambda/2.78/scripts/addons_contrib/io_scene_map/export_map.py
resultant-gamedev/bpy_lambda
0
12783386
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
1.851563
2
AluraProjects/Brasilidades/telefone.py
matheusm0ura/Python
0
12783387
<filename>AluraProjects/Brasilidades/telefone.py<gh_stars>0 import re class TelefoneBr: def __init__(self, telefone): if self.valida_numero(telefone): self.numero = telefone else: raise ValueError("Número inválido.") def valida_numero(self, telefone): padrao = "([0-9]{2})([0-9]{4,5})([...
3.390625
3
tests/sentry/eventstream/kafka/test_protocol.py
mlapkin/sentry
0
12783388
<gh_stars>0 from __future__ import absolute_import import pytest import pytz from datetime import datetime from sentry.eventstream.kafka.protocol import ( InvalidPayload, InvalidVersion, UnexpectedOperation, parse_event_message, ) from sentry.utils import json def test_parse_event_message_invalid_pa...
2.09375
2
i3pystatus/pomodoro.py
fkusei/i3pystatus
413
12783389
import subprocess from datetime import datetime, timedelta from i3pystatus import IntervalModule from i3pystatus.core.desktop import DesktopNotification STOPPED = 0 RUNNING = 1 BREAK = 2 class Pomodoro(IntervalModule): """ This plugin shows Pomodoro timer. Left click starts/restarts timer. Right c...
2.734375
3
modules/molpro/RHF_Parser.py
Krzmbrzl/molpro-python
0
12783390
<reponame>Krzmbrzl/molpro-python from typing import List from typing import Iterator from typing import Optional import itertools from molpro import ProgramParser from molpro import register_program_parser from molpro import utils from molpro import RHF_Data from molpro import MolproOutput from molpro import ParserDa...
2.734375
3
simulate_data.py
bdhammel/line-visar-analysis
1
12783391
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.interpolate import interp2d from scipy.ndimage import convolve1d from PIL import Image c = 299792.0 # um/ns class Ray: def __init__(self, lambda0: "um" = .532, pulse_length: "ns" = 10, radius:...
2.53125
3
researchWork/__init__.py
VladimirZubavlenko/ikaf42-app
0
12783392
default_app_config = 'researchWork.apps.ResearchWorkConfig'
1.070313
1
azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/operation_result_info.py
JonathanGailliez/azure-sdk-for-python
1
12783393
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
2.09375
2
src/BertForIntent/Settings.py
drdauntless/TC-Bot
0
12783394
import json class Settings: def __init__(self, filename): self.json_file = None with open(filename) as f: self.json_file = json.load(f) self.hh_sheet_id = self.json_file['hh_sheet_id'] self.ha_sheet_id = self.json_file['ha_sheet_id'] # List of str: names of the...
2.703125
3
tests/test_base.py
byashimov/django-pkgconf
15
12783395
<reponame>byashimov/django-pkgconf<filename>tests/test_base.py<gh_stars>10-100 from django.test import SimpleTestCase from django.test.utils import override_settings import myconf import mymixinconf import myprefixconf class MyConfTest(SimpleTestCase): def test_setup(self): self.assertEqual(myconf.__name...
2.359375
2
Challenges/Desafio019.py
JeffersonYepes/Python
0
12783396
<filename>Challenges/Desafio019.py from random import choice print('****** Sorteio de Alunos ******') a1 = str(input('Digite o nome do aluno 1: ')) a2 = str(input('Digite o nome do aluno 2: ')) a3 = str(input('Digite o nome do aluno 3: ')) a4 = str(input('Digite o nome do aluno 4: ')) print('O aluno escolhido é: {}'.fo...
3.625
4
algorithm/utils.py
tangxyw/RecAlgorithm
13
12783397
import tensorflow as tf def train_input_fn(filepath, example_parser, batch_size, num_epochs, shuffle_buffer_size): """ 模型的训练阶段input_fn Args: filepath (str): 训练集/验证集的路径 example_parser (function): 解析example的函数 batch_size (int): 每个batch样本大小 num_epochs (int): 训练轮数 s...
2.765625
3
tests/test_final.py
justanr/objtoolz
1
12783398
<reponame>justanr/objtoolz<filename>tests/test_final.py from objtoolz.metas.final import Final import pytest def test_cant_inherit_from_final(): class FinalTest(object): pass FinalTest = Final('FinalTest', (FinalTest,), {}) with pytest.raises(TypeError) as err: class SubclassedFinalTest(...
2.40625
2
write-up/Fortnight Challenge 2022/Cryptography/Really Silly Algorithm/server.py
compsec-hcmus/hcmus-fortnight-wu
0
12783399
#!/usr/bin/env python3 import binascii import threading from time import * import socketserver from string import hexdigits from Crypto.Util.number import getPrime, inverse, bytes_to_long, long_to_bytes banner = """ Welcome to my supreme signing server! Send me a signed command, I will verify and do it for you, I wil...
2.71875
3
tests/test_runtime.py
NathanDeMaria/aws-lambda-r-runtime
134
12783400
import base64 import json import re import unittest import boto3 from tests import get_version, get_function_name, is_local from tests.sam import LocalLambdaServer, start_local_lambda class TestRuntimeLayer(unittest.TestCase): lambda_server: LocalLambdaServer = None @classmethod def setUpClass(cls): ...
2.328125
2
Module 3/Chapter 4/urlsqli.py
kongjiexi/Python-Penetration-Testing-for-Developers
34
12783401
import requests url = "http://127.0.0.1/SQL/sqli-labs-master/Less-1/index.php?id=" initial = "'" print "Testing "+ url first = requests.post(url+initial) if "mysql" in first.text.lower(): print "Injectable MySQL detected" elif "native client" in first.text.lower(): print "Injectable MSSQL detected" elif "syntax er...
2.84375
3
pims/filters/global_histogram.py
hurondp/pims
2
12783402
<gh_stars>1-10 # * Copyright (c) 2020-2021. Authors: see NOTICE file. # * # * 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 # ...
2.203125
2
exercises/solution_01_28b.py
ali4413/Ali-Mehrabifard
0
12783403
<reponame>ali4413/Ali-Mehrabifard import pandas as pd # The database hockey_players = pd.read_csv('data/canucks.csv', index_col = 0) # Find the total salary of the team and save it in an object called `player_cost` player_cost = hockey_players[['Salary']].sum() # Display it player_cost
3.546875
4
apps/projects/fields.py
ExpoAshique/ProveBanking__s
0
12783404
from collections import OrderedDict from vendors.models import Vendor from .models import StaffingRequest def requests_as_choices(): choices = OrderedDict() requests = StaffingRequest.objects.all().order_by('-id') for request in requests: choices[request.project] = choices.get(request.project, []...
2.46875
2
ke_tool/evaluate_transe_inductive.py
MichalPitr/KEPLER
98
12783405
<filename>ke_tool/evaluate_transe_inductive.py import argparse import graphvite as gv import graphvite.application as gap import numpy as np import json from tqdm import tqdm def main(): parser = argparse.ArgumentParser() parser.add_argument('--entity_embeddings', help='numpy of entity embeddings') parser....
2.34375
2
examples/representation/extract_ir2vec.py
ComputerSystemsLaboratory/YaCoS
8
12783406
#! /usr/bin/env python3 """ Copyright 2021 <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 wri...
2.109375
2
python/shipRoot_conf.py
Plamenna/proba
0
12783407
<reponame>Plamenna/proba import ROOT, atexit, sys #-----prepare python exit----------------------------------------------- ROOT.gInterpreter.ProcessLine('typedef double Double32_t') def pyExit(): x = sys.modules['__main__'] if hasattr(x,'run'): del x.run if hasattr(x,'fMan'): del x.fMan if hasattr(x,'fRun'): del x...
2.109375
2
analyzer.py
thatwist/volunteer-tools
0
12783408
<filename>analyzer.py from model import Post from dataclasses import dataclass, replace, asdict from abc import ABC, abstractmethod import re class Rule(ABC): @abstractmethod def analyze(self, post: Post): pass @dataclass class RegexpRule(Rule): def __init__(self, regexps: dict[str, list[str...
2.6875
3
examples/routes/resequence_route.py
route4me/route4me-python-sdk
10
12783409
# -*- coding: utf-8 -*- from route4me import Route4Me API_KEY = "11111111111111111111111111111111" def main(): r4m = Route4Me(API_KEY) route = r4m.route response = route.get_routes(limit=1, offset=0) if isinstance(response, dict) and 'errors' in response.keys(): print('. '.join(response['err...
2.734375
3
FLAME/FLAME.py
marabouboy/FLAME
6
12783410
<filename>FLAME/FLAME.py #!/usr/bin/python3 #FLAME 0.1.4 #Import Packages: import argparse, io import pysam import FLAME_FUNC.FLAME_FUNC as FF #Break this down into each part based on the command. ##################### # Need to be fixed List: # Fix the comments within FLAME.py. It is a bit wonkey with different expla...
2.984375
3
termpixels/unix_keys.py
loganzartman/termpixels
17
12783411
<filename>termpixels/unix_keys.py import re from copy import copy from termpixels.terminfo import Terminfo from termpixels.keys import Key, Mouse class KeyParser: def __init__(self): self.pattern_key_pairs = {} def register_key(self, pattern, key): self.pattern_key_pairs[pattern] = key ...
2.828125
3
qs/rpcserver.py
pediapress/qserve
0
12783412
<filename>qs/rpcserver.py #! /usr/bin/env python from __future__ import print_function import traceback from builtins import object from builtins import str from past.builtins import basestring try: import simplejson as json except ImportError: import json from gevent import pool, server as gserver, Greenl...
2.234375
2
Double Pendulum.py
NitulKalita/Python-CLI
6
12783413
<reponame>NitulKalita/Python-CLI import string from typing import List import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from double_pendulum import DoublePendulum def random_hex() -> str: hex_value = "".join( np.random.choice( list(string.hexdigits)...
3.3125
3
phoenix/monitor/views/__init__.py
TeriForey/fawkes
7
12783414
from pyramid.events import subscriber from phoenix.events import JobFinished, JobStarted import logging LOGGER = logging.getLogger("PHOENIX") @subscriber(JobStarted) def notify_job_started(event): event.request.session.flash( '<h4><img src="/static/phoenix/img/ajax-loader.gif"></img> Job Created. Please...
2.28125
2
src/classify.py
ybayle/ISM2017
7
12783415
# -*- coding: utf-8 -*- #!/usr/bin/python # # Author <NAME> # E-mail <EMAIL> # License MIT # Created 03/11/2016 # Updated 11/12/2016 # Version 1.0.0 # """ Description of classify.py ====================== save train & test in files read train & test for list of classifier train/test gather resul...
2.5
2
tools/check_python_format.py
cockroachzl/recommenders-addons
584
12783416
<filename>tools/check_python_format.py #!/usr/bin/env python from subprocess import check_call, CalledProcessError def check_bash_call(string): check_call(["bash", "-c", string]) def _run_format(): files_changed = False try: check_bash_call( "find . -name '*.py' -print0 | xargs -0 yapf --style=./...
2.984375
3
drone_awe/params/Validation/FreeflyAlta8/drone.py
rymanderson/Drone-Models
2
12783417
params = { 'wingtype': 'rotary', 'rotorquantity': 8, 'diagonal': 1.325, 'batterycells': 6, 'batteryvoltage': 22.2, 'batterycapacity': 10000, 'batterytype': 'LiPo', 'numbatteries': 2, 'numbatteriesconnection': 'parallel', 'max_takeoffweight': 18.1, 'takeoffweight': 6.2, 'max_payload': 9.1, 'specific_power': 145, 'props'...
1.203125
1
src/richard/playlists/urls.py
pyvideo/richard
51
12783418
# richard -- video index system # Copyright (C) 2012, 2013, 2014, 2015 richard contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
1.796875
2
lib/UITableDelegate.py
apimetre/MetreAppUI_v0.25
0
12783419
<gh_stars>0 # Python imports import os import numpy as np import datetime as datetime import time import json from pytz import timezone # Pythonista imports import ui class TData (ui.ListDataSource): def __init__(self, scale, items=None): ui.ListDataSource.__init__(self, items) self.xscale = scal...
2.5
2
scripts/venv/lib/python2.7/site-packages/cogent/align/pycompare.py
sauloal/cnidaria
3
12783420
#!/usr/bin/env python # Very slow. See compare.pyx from __future__ import division import cogent.util.progress_display as UI from cogent.util.modules import importVersionedModule, ExpectedImportError __author__ = "<NAME>" __copyright__ = "Copyright 2007-2012, The Cogent Project" __credits__ = ["<NAME>", "<NAME>"] __...
2.203125
2
KeylessTranspositionCipher.py
roysaurabh1308/Cryptographic-Algorithms
0
12783421
<gh_stars>0 # Keyless Transaposition Cipher def encrypt(plain): i = 0 j = 1 cipher = "" cipher1 = "" cipher2 = "" while(i < len(plain)): cipher1 += plain[i] i += 2 while(j < len(plain)): cipher2 += plain[j] j += 2 pos = len(cipher1) cipher = cipher1 + cipher2 return(cipher, pos) def ...
4.125
4
examples/csj/s0/csj_tools/wn.2.prep.text.py
treeaaa/wenet
1,166
12783422
import os import sys # train test1 test2 test3 def readtst(tstfn): outlist = list() with open(tstfn) as br: for aline in br.readlines(): aline = aline.strip() outlist.append(aline) return outlist def split_train_tests_xml(xmlpath, test1fn, test2fn, test3fn): test1list ...
2.65625
3
Python/smallest-integer-divisible-by-k.py
RideGreg/LeetCode
1
12783423
# Time: O(k) # Space: O(1) # 1015 # Given a positive integer K, you need find the smallest positive integer N such that # N is divisible by K, and N only contains the digit 1. # # Return the length of N. If there is no such N, return -1. # 1 <= K <= 10^5 class Solution(object): def smallestRepunitDivByK(self, K...
3.5625
4
src/sima/riflex/generatortorquefault.py
SINTEF/simapy
0
12783424
# Generated with GeneratorTorqueFault # from enum import Enum from enum import auto class GeneratorTorqueFault(Enum): """""" NONE = auto() LOSS = auto() BACKUP = auto() def label(self): if self == GeneratorTorqueFault.NONE: return "No generator torque fault" if self ==...
3.078125
3
pynnet/wrapper.py
walkerning/kaldi-fix
0
12783425
import os def test_net(dir_net='exp/dnn4_pretrain-dbn_dnn/final.nnet'): flag = os.system('./local/nnet/test_wer.sh %s >/dev/null 2>&1 '%dir_net)# assert flag == 0 os.system('bash show_dnn test > res.log') content = open('res.log').read() res = float(content.split()[1]) return res def finetun...
1.90625
2
training/twop/onevone.py
NoMoor/83Plus
0
12783426
<filename>training/twop/onevone.py from math import pi from twop.defending import Defending onevone_exercises = [ Defending("Optimizer Testing", car_y=1000, car_spin=-pi / 2), ]
1.671875
2
Android/NDK/android-ndk-r20b-win/prebuilt/windows-x86_64/lib/python2.7/plat-win32/STDDEF.py
X018/CCTOOL
0
12783427
# Generated by h2py from /buildbot/src/googleplex-android/ndk-release-r20/prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/bin/../lib/gcc/x86_64-w64-mingw32/4.8.3/include/stddef.h __WCHAR_TYPE__ = int NULL = 0
0.933594
1
qap-lp/plots.py
j-kota/LP-QAP
0
12783428
<filename>qap-lp/plots.py import numpy as np import os import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.cm as cm from scipy.spatial import ConvexHull import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import torch.nn.funct...
1.78125
2
examples/xrd/o2t_simulation_nimnsb_inp.py
LukeSkywalker92/heuslertools
0
12783429
from heuslertools.xrd import O2TSimulation from heuslertools.xrd.materials import NiMnSb, InP import xrayutilities as xu import numpy as np import matplotlib.pyplot as plt ##### LAYERSTACK ##### sub = xu.simpack.Layer(InP, np.inf) lay1 = xu.simpack.Layer(NiMnSb, 400, relaxation=0.0) layerstack = xu.simpack.Pseudomorph...
2.125
2
reminder.py
NikitaMikhailov/bot_herobot
0
12783430
<reponame>NikitaMikhailov/bot_herobot<filename>reminder.py #!/usr/bin/env bash # !/bin/bash # !/bin/sh # !/bin/sh - from vk_api import VkUpload from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType import datetime, requests, vk_api, calendar from vk_api.utils import get_random_id # сделать проверку при переход...
2.046875
2
dungeonlevelfactory.py
co/TheLastRogue
8
12783431
from dungeonfeature import new_stairs_up import dungeonfeature import terrain import tile from dungeonlevel import DungeonLevel def get_empty_tile_matrix(width, height): return [[tile.Tile() for x in range(width)] for y in range(height)] def unknown_level_map(width, height, depth): ...
3.015625
3
spam_filter/__main__.py
vjaos/SpamFilter
0
12783432
import numpy as np import pandas as pd from .nlp_utils.classifier import NaiveBayesClassifier from .nlp_utils.tokenizer import NGramTokenizer DATASET_PATH = 'spam_filter/data/spam.csv' def preprocess_data(): dataset = pd.read_csv(DATASET_PATH, encoding='latin-1') dataset.rename(columns={'v1': 'labels', 'v2'...
2.640625
3
Script/Tool/md2pdf.py
dtcxzyw/NCEEHelper
1
12783433
#!/usr/bin/python3 # -*- coding: utf-8 -*- import pypandoc import os print("Pandoc", pypandoc.get_pandoc_version()) base = "../../Note/" for r, ds, fs in os.walk(base): for f in fs: if f.endswith(".md"): src = r+"/"+f dst = src.replace(".md", ".pdf") print(src, "->", ...
2.828125
3
test/conftest.py
onefinestay/pylytics
5
12783434
from mysql.connector.errors import OperationalError import pytest from test.helpers import db_fixture, execute @pytest.fixture(scope="session") def warehouse(): return db_fixture("test_warehouse") @pytest.fixture def empty_warehouse(warehouse): cursor = warehouse.cursor() cursor.execute("SHOW TABLES") ...
2.1875
2
clickbay/urls.py
kilonzijnr/Click-Bay
0
12783435
from .import views from django.urls import path from django.conf import settings from django.conf.urls.static import static from . views import * # Application Views urlpatterns = [ path('', views.user_login, name='login'), path('logout/', views.user_logout, name='logout'), path('signup/', views.user_sign...
1.960938
2
python/examples/barcode_scanner.py
VNOpenAI/daisykit
13
12783436
import cv2 import json from daisykit.utils import get_asset_file from daisykit import BarcodeScannerFlow config = { "try_harder": True, "try_rotate": True } barcode_scanner_flow = BarcodeScannerFlow(json.dumps(config)) # Open video stream from webcam vid = cv2.VideoCapture(0) while(True): # Capture the...
3.140625
3
texaslan/users/forms.py
hsmeans/texaslan.org
2
12783437
from django import forms from django.contrib.auth import get_user_model from django.template.defaultfilters import filesizeformat from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import Group from os import path from .models import User from texaslan.applications.models import A...
2.21875
2
source/tui.py
krustowski/textovka-tui
0
12783438
<filename>source/tui.py<gh_stars>0 #!/usr/bin/env python3 # encoding: utf-8 __author__ = "krustowski" __email__ = "<EMAIL>" __license__ = "MIT" __date__ = "Sunday, Apr 5, 2020" __version__ = "1.0" try: import npyscreen except: print("Run './setup.py install' first...") exit() from source.api import Api i...
2.234375
2
one/utils/environment/idp.py
DNXLabs/one
5
12783439
import click from PyInquirer import prompt from one.utils.environment.common import get_credentials_file, get_config_file, get_idp_file, write_config from one.utils.prompt import style from one.docker.image import Image from one.docker.container import Container from one.__init__ import CLI_ROOT from one.prompt.idp imp...
2.109375
2
dustbin/tests.py
chiro2001/cumcm-a
0
12783440
import matplotlib.pyplot as plt import pandas as pd from utils import * # 主索节点的坐标和编号 data1 = pd.read_csv("data/附件1.csv", encoding='ANSI') # print('主索节点的坐标和编号:\n', data1) nodes_data = {} for d in data1.itertuples(): nodes_data[d[1]] = { # 'position': tuple(d[2:]), 'position_raw': np.array(d[2:]), ...
2.984375
3
ads/routes.py
sinisaos/starlette-piccolo-rental
3
12783441
<gh_stars>1-10 from starlette.routing import Route, Router from ads.endpoints import (ad, ad_create, ad_delete, ad_edit, ad_images, ads_list, edit_upload, filter_search, image_delete, image_edit, maps, review_create, review_delete, review...
1.929688
2
__init__.py
deckvig/calibre-douban
0
12783442
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2011, Kov<NAME> <<EMAIL>>; 2011, <NAME> <<EMAIL>>' __docformat__ = 'restructuredtext en' import time try: from queue import Empty, Queue except ImportError: from Queue import Empty, Queue from cal...
2.15625
2
squeezenet_test.py
smbadiwe/SqueezeNetWithCIFAR10
0
12783443
<filename>squeezenet_test.py import matplotlib.pyplot as plot import pickle from funcy import last, partial from operator import getitem def plot_history(history): legends = ["train loss", "test loss", "train accuracy", "test accuracy"] i = 0 def plot_values_collection(title, values_collection): ...
2.96875
3
exercise 6.5.py
tuyanyang/python_exercise
0
12783444
str = 'X-DSPAM-Confidence: 0.8475' colpos = str.find(':') number = float(str[colpos+1:]) print(number)
2.90625
3
Build_Web_With_Flask/Building web applications with Flask_Code/chapter03/chapter03/ex01.py
abacuspix/NFV_project
0
12783445
# coding:utf-8 with open('parent.html', 'w') as file: file.write(""" {% block template %}parent.html{% endblock %} =========== I am a powerful psychic and will tell you your past {#- "past" is the block identifier #} {% block past %} You had pimples by the age of 12. {%- endblock %} Tremble before my power!!! ""...
3.203125
3
.tox/scenario/lib/python2.7/site-packages/barbicanclient/tests/test_cas.py
bdrich/neutron-lbaas
0
12783446
# Copyright (c) 2013 Rackspace, 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
1.796875
2
config/arch/arm/devices_cortex_m4/mbedos_config.py
Microchip-MPLAB-Harmony/mbed_os_rtos
0
12783447
# coding: utf-8 """***************************************************************************** * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * re...
1.03125
1
computer_vision/06_translating_images.py
KECB/learn
2
12783448
import numpy as np import cv2 # Translation is the shifting of objects location. If you know the shift in # (x,y) direction, let it be (t_x,t_y), you can create the transformation matrix # M as follows: # # M = | 1 0 t_x | # | 0 1 t_y | # # You'll need to make it into a Numpy array of type np.floa...
3.921875
4
DSA/stack/stack_using_linked_list.py
RohanMiraje/DSAwithPython
2
12783449
class Node: def __init__(self, data): self.data = data self.next = None class Stack: """ADT - abstract data type- just LIFO - operations performed from top only O(1) operations - push, pop push- insert at beg in list pop- delete at beg in list applicati...
3.953125
4
rebelykos/core/teamserver/modules/iam_role_info.py
Takahiro-Yoko/rebelykos
1
12783450
import boto3 from rebelykos.core.response import Response as res from rebelykos.core.teamserver.module import Module class RLModule(Module): def __init__(self): super().__init__() self.name = "role_info" self.description = ("List all RoleNames if RoleName not specified." ...
2.03125
2