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
pyrfuniverse/utils/__init__.py
happyCoderJDFJJ/pyrfuniverse
0
12772551
<reponame>happyCoderJDFJJ/pyrfuniverse<filename>pyrfuniverse/utils/__init__.py from .controller import RFUniverseController from .tobor_controller import RFUniverseToborController __all__ = [ 'RFUniverseController', 'RFUniverseToborController' ]
1.28125
1
example/drf_integrations_example/integrations/urls.py
yoyowallet/drf-integrations-framework
1
12772552
from rest_framework import routers from . import ecommerce_viewsets router = routers.DefaultRouter() router.register( r"ecommerce/purchase", ecommerce_viewsets.PurchasesViewSet, basename="api-purchases" ) urlpatterns = router.urls
1.6875
2
src/irobotframework/completion_finders.py
bollwyvl/irobotframework
9
12772553
# Copyright (c) 2018 Georgia Tech Research Corporation # Distributed under the terms of the BSD-3-Clause License """ Completion implementations """ # pylint: disable=W0613,C0330,R0913,W0703,R0914 import re from typing import List, Tuple from IPython.core.completerlib import get_root_modules from robot.libraries imp...
2.03125
2
recruiter/api_urls.py
b1pb1p/opensource-job-portal
199
12772554
<filename>recruiter/api_urls.py from django.urls import path, re_path from recruiter import api_views app_name = "api_recruiter" urlpatterns = [ path("login/", api_views.login_view, name="api_login"), path("out/", api_views.getout, name="getout"), path("change-password/", api_views.change_password, name...
2
2
mechroutines/es/newts/_irc.py
keceli/mechdriver
0
12772555
""" irc x """ import automol.reac import autofile import elstruct from mechlib.reaction import grid as rxngrid from mechlib.amech_io import printer as ioprinter from mechroutines.es import runner as es_runner from mechroutines.es.runner import qchem_params # Intrinsic Reaction Coordinates def execute_irc(zma, ts_inf...
2.265625
2
tools/reval_discovery.py
AdilSiddiqui131/OIM
231
12772556
<filename>tools/reval_discovery.py #!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- """Reval = re-eval. ...
2.3125
2
test/arch/ia32/test_mov_add.py
Flopz-Project/flopz
7
12772557
<gh_stars>1-10 from flopz.arch.ia32.ia32_generic_arch import IA32GenericArchitecture from flopz.arch.ia32.auto_instructions import * import pytest def test_mov(): arch = IA32GenericArchitecture() """ Reg to Reg """ mov64 = Mov(arch.rax, arch.rbx) assert(mov64.bytes() == b'\x48\x89\xd8') asse...
1.921875
2
backend/extractbeta.py
rachitnaruzu/resultnotifier
0
12772558
<gh_stars>0 import re import requests as rq from bs4 import BeautifulSoup ''' return a list of all the currenttly available data (result, notice, schedule, etc..... implement this method to return a list in this format (ex: a webscrape logic): [ { 'displayname': '2015 CSE VII SEM', # the name which w...
3.28125
3
backend/orders/api.py
hbutau/product-shop
0
12772559
<reponame>hbutau/product-shop from typing import List from django.shortcuts import get_object_or_404 from ninja import Router from .models import Order, LineItem from .schema import OrderSchemaIn, OrderSchemaOut router = Router() @router.post("") def create_order(request, payload: OrderSchemaIn): order_data = ...
2.171875
2
tests/integration/unit_test/test_unit_test_python2_7.py
aahung/aws-sam-cli-app-templates
0
12772560
from tests.integration.base import Base class UnitTest_python2_7_cookiecutter_aws_sam_hello_python(Base.PythonUnitTestBase): python_executable = "python2.7" directory = "python2.7/cookiecutter-aws-sam-hello-python" class UnitTest_python2_7_cookiecutter_aws_sam_step_functions_sample_app(Base.PythonUnitTestBa...
1.609375
2
termssrv/terms/models.py
rimvaliulin/termssrv
0
12772561
<filename>termssrv/terms/models.py from django.db import models from django.utils.translation import gettext_lazy as _ class Book(models.Model): """ The reference book of terms. The version of the reference book must be unique within that reference book. Name, short name are required. Descri...
2.453125
2
pysec/core/ctx.py
benhunter/owasp-pysec
416
12772562
<filename>pysec/core/ctx.py # Python Security Project (PySec) and its related class files. # # PySec is a set of tools for secure application development under Linux # # Copyright 2014 PySec development team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
2.359375
2
Library/Simulation.py
jonestcharles/physics-simulation
0
12772563
# -*- coding: utf-8 -*- """ Created on Fri Feb 19 18:03:59 2016 @author: jones_000 """ import copy as cp import numpy as np import math import Solver import Physics import Body import vector import matplotlib.pyplot as plt class Simulation(object): '''Parent Simulation class Attributes ---------- ...
3.140625
3
src/tests/sql_regression/test_python.py
margrit2103/github-actions-for-ci
0
12772564
from datetime import datetime import sys import getopt import glob import psycopg2 def get_parameters(): __all_pars, remainder = getopt.getopt ( sys.argv[1:], '', ['output-dir=','db-tag=','test-dir='] ) _parameters = {'output-dir':'.'} print ( f"Parameters {__all_pars}" ) for opt, arg in __all_pars...
2.4375
2
elstruct/elstruct/run.py
sjklipp/autoio
0
12772565
""" core run function """ from autorun import from_input_string def direct(input_writer, script_str, run_dir, prog, geo, charge, mult, method, basis, **kwargs): """ Generates an input file for an electronic structure job and runs it directly. :param input_writer: elstruct writer modul...
2.875
3
themis/pwm.py
celskeggs/themis
1
12772566
<gh_stars>1-10 from collections import namedtuple import themis.channel # all in milliseconds SpeedControlSpecs = namedtuple("SpeedControlSpecs", "rev_max rev_min rest fwd_min fwd_max frequency_hz") # from WPILib HAL TALON_SR = SpeedControlSpecs(0.989, 1.487, 1.513, 1.539, 2.037, 200.0) JAGUAR = SpeedControlSpecs(0....
2.25
2
examples/pytorch/vision/Face_Detection/eval.py
cw18-coder/EdgeML
719
12772567
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. import torch import torch.nn as nn import torch.utils.data as data import torch.backends.cudnn as cudnn import torchvision.transforms as transforms import os import time import argparse import numpy as np from PIL import Ima...
2.15625
2
testoutLF/lanefollowing/ros2_ws/src/lane_following/train/train.py
dr563105/basicad_framework
0
12772568
import os import numpy as np import tensorflow as tf from keras import backend as K from keras.models import Sequential from keras.layers import Conv2D, Dense, Activation, Flatten, Lambda, Dropout from keras.models import Sequential from keras.optimizers import Adam from utils import load_multi_dataset, mkdir_p, HDF5_P...
2.703125
3
tensor2tensor/models/attention_lm_moe.py
anishsingh20/tensor2tensor
0
12772569
<reponame>anishsingh20/tensor2tensor # Copyright 2017 Google 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 app...
1.820313
2
S4/S4 Library/simulation/objects/definition_manager.py
NeonOcean/Environment
1
12772570
<gh_stars>1-10 from _collections import defaultdict import weakref from sims4.tuning.instance_manager import InstanceManager from sims4.tuning.merged_tuning_manager import UnavailablePackSafeResourceError from sims4.tuning.tunable import TunableList, TunableReference import build_buy import objects.system import paths ...
1.828125
2
setup.py
AzatAI/pyvcgencmd
0
12772571
<reponame>AzatAI/pyvcgencmd #!/usr/bin/env python3 import os import sys from codecs import open from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) about = {} # create a empty dictionary to store the content of the __version__.py file # execute the __version__...
1.960938
2
src/server_app/app.py
colesturza/ECEN5033-Final-Project
0
12772572
import os from flask import Flask, request, jsonify, Response from flask_pymongo import PyMongo from bson.objectid import ObjectId from prometheus_flask_exporter import PrometheusMetrics app = Flask(__name__) app.config["MONGO_URI"] = "mongodb://mongo:27017/dev" mongo = PyMongo(app) db = mongo.db hostname = os.uname(...
2.796875
3
build/debian_system_builder/debian_system_builder.py
chaytanyasinha/openr
0
12772573
<filename>build/debian_system_builder/debian_system_builder.py #!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. from __future__ import absolute_import, division, print_function, unicode_literals import distutils.spawn import os import fbcode_builder_path from fbcode_builder import FBCodeBuilde...
2
2
adv/yurius.py
slushiedee/dl
45
12772574
from core.advbase import * from slot.a import * from slot.d import * def module(): return Yurius class Yurius(Adv): a3 = ('prep', 100) conf = {} conf['slots.a'] = Primal_Crisis()+Candy_Couriers() conf['slots.d'] = Gaibhne_and_Creidhne() conf['acl'] = """ if self.afflics.frostbite.get()...
1.96875
2
debate/api/serializers.py
steventimberman/debateIt
0
12772575
<filename>debate/api/serializers.py from rest_framework.serializers import ModelSerializer from debate.models import DebateTopic class DebateTopicSerializer(ModelSerializer): class Meta: model = DebateTopic fields = [ 'topic', 'description', 'timestamp', ...
2.015625
2
tests/sympc/tensor/grad/grad_functions_test.py
Boluwatifeh/SyMPC
0
12772576
<gh_stars>0 # stdlib from typing import List # third party import numpy as np import pytest import torch from sympc.session import Session from sympc.session import SessionManager from sympc.tensor import MPCTensor from sympc.tensor.grads.grad_functions import GradAdd from sympc.tensor.grads.grad_functions import Gra...
1.921875
2
bamboos/docker/environment/globalregistry.py
onedata/cluster-example
1
12772577
<filename>bamboos/docker/environment/globalregistry.py # coding=utf-8 """Authors: <NAME>, <NAME> Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Brings up a set of Global Registry nodes along with databases. They can create separate clusters. """ import copy ...
2
2
bluebrain/repo-bluebrain/packages/py-bluepy/package.py
BlueBrain/Spack
0
12772578
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyBluepy(PythonPackage): """Pythonic Blue Brain data access API""" homepage = "https:...
1.585938
2
ctapipe/calib/camera/tests/test_calibrator.py
maxnoe/ctapipe
0
12772579
from numpy.testing import assert_allclose from ctapipe.calib.camera import ( CameraCalibrator, HESSIOR1Calibrator, NullR1Calibrator ) from ctapipe.image.extractor import LocalPeakWindowSum from ctapipe.io import SimTelEventSource from ctapipe.utils import get_dataset_path from traitlets.config.configurable...
2.265625
2
scripts/download_log_archive.py
mmurayama/fujitsu-redfish-samples
7
12772580
<reponame>mmurayama/fujitsu-redfish-samples<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Sample script to download a log archive via iRMC Redfish API in Fujitsu PRIMERGY [Usage] - Download a log archive $ python download_log_archive.py -i 192.168.10.10 -u admin -p admin -f archive.zip ""...
1.859375
2
code/Series/pisano.py
mys-anusha/NISB-Rosetta-Code
4
12772581
<gh_stars>1-10 def pisano(m): prev,curr=0,1 for i in range(0,m*m): prev,curr=curr,(prev+curr)%m if prev==0 and curr == 1 : return i+1 def fib(n,m): seq=pisano(m) n%=seq if n<2: return n f=[0]*(n+1) f[1]=1 for i in range(2,n+1): f[i]=f[i-1...
3.375
3
plot_histogram.py
rickdberg/global_extrapolation
0
12772582
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Mar 25 14:52:28 2017 @author: rickdberg Module for applying machine learning method to flux data """ import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from pylab import savefig from user_parameters import (ml_outputs_path) meth = 'gbr...
2.515625
3
cart/urls.py
abhishek593/IITISOC_LaFrescoInPocket
0
12772583
<reponame>abhishek593/IITISOC_LaFrescoInPocket from django.urls import path from . import views app_name = 'cart' urlpatterns = [ path('list_items/', views.list_items, name='list_items'), path('add_item/', views.add_item, name='add_item'), path('show_cart/', views.show_cart, name='show_cart'), path('...
2.015625
2
web/utest/test_news.py
tangjx/migrant
0
12772584
# -*- coding:utf-8 -*- """ author <EMAIL> """ from bson import ObjectId import json from logic.utility import m_del,m_page,m_update,m_exists from unittest import TestCase from logic.news import hot class NewsCase(TestCase): def setUp(self): pass def test_hot(self): print 'one day news' ...
2.578125
3
evap/evaluation/migrations/0041_populate_semester_is_archived.py
felixrindt/EvaP
29
12772585
# Generated by Django 1.9.1 on 2016-02-20 21:11 from django.db import migrations def is_course_archived(course): assert (course._participant_count is None) == (course._voter_count is None) return course._participant_count is not None def is_semester_archived(semester): if semester.course_set.count() ==...
1.851563
2
codigo/Live173/exemplo_tk.py
BrunoPontesLira/live-de-python
572
12772586
from tkinter import Tk, Label root = Tk() a = Label(root, text='Live de Python', font=('Arial', 30)) a.pack() root.mainloop()
3
3
flightrl/rpg_baselines/ppo/ppo2_test.py
MarioBonse/flightmare
596
12772587
<reponame>MarioBonse/flightmare<filename>flightrl/rpg_baselines/ppo/ppo2_test.py<gh_stars>100-1000 import matplotlib.pyplot as plt import numpy as np import matplotlib.gridspec as gridspec def test_model(env, model, render=False): # fig = plt.figure(figsize=(18, 12), tight_layout=True) gs = gridspec.GridS...
2.015625
2
Aula 03/While.py
IsaacPSilva/LetsCode
0
12772588
### Malha de repetição (loop) - While ''' O while é bastante parecido com um 'if': ele possui uma expressão, e é executado caso ela seja verdadeira. Mas o if é executado apenas uma vez e depois o código segue adiante. O while não: ao final de sua execução, ele torna a testar a expressão, e caso ela seja verdadeira, e...
4.25
4
configuration/config.py
akhfzz/FastAPI-Shorten-case
0
12772589
from fastapi import FastAPI from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseSettings #root app = FastAPI() class Settings(BaseSettings): env: str = 'production' SECRET_KEY = "09d25e094faa6...
2.1875
2
tests/test_stream_handlers.py
vforgione/lager
0
12772590
<gh_stars>0 import codecs import io import os.path from capturer import CaptureOutput from lager.enums import Verbosity from lager.handlers import StreamHandler, StdErrHandler, StdOutHandler class TestStreamHandler: def setup_method(self, mtd): self.stream = io.StringIO() self.handler = StreamHa...
2.4375
2
test_numpy_embedding.py
morpheusthewhite/twitter-sent-dnn
314
12772591
<gh_stars>100-1000 import theano import numpy as np from dcnn import WordEmbeddingLayer from dcnn_train import WordEmbeddingLayer as TheanoWordEmbeddingLayer from test_util import assert_matrix_eq ########### NUMPY ########### vocab_size, embed_dm = 10, 5 embeddings = np.random.rand(vocab_size, embed_dm) sents = np.as...
2.453125
2
pyexamples/SimpleVideo.py
slovak194/Pangolin
1
12772592
<reponame>slovak194/Pangolin<gh_stars>1-10 import sys from pathlib import Path import os from matplotlib import pyplot as plt import argparse import numpy as np import time # add pangolin to PYTHONPATH homeDir = str(Path.home()) sys.path.append(os.path.join(homeDir, 'ws/Pangolin/build/src')) # import pypangolin impo...
2.421875
2
printing/main.py
notatallshaw/Grail-0.6
0
12772593
<reponame>notatallshaw/Grail-0.6<gh_stars>0 """HTML to PostScript translator. This module uses the AbstractWriter class interface defined by in the standard formatter module to generate PostScript corresponding to a stream of HTML text. The HTMLParser class scans the HTML stream, generating high-level calls to an Abs...
2.109375
2
python-learn/mult_process/process-pool.py
ljm516/python-repo
0
12772594
import os import random import time from multiprocessing import Pool def run_task(name): print('Task {task_name} (pid={pid}) is Running...'.format(task_name=name, pid=os.getpid())) time.sleep(random.randm() * 3) print('Task {task_name} end.'.format(task_name=name)) if __name__ == '__main__': print(...
3.09375
3
recipes/structopt/all/conanfile.py
rockandsalt/conan-center-index
562
12772595
import os from conans import ConanFile, tools from conans.errors import ConanInvalidConfiguration class StructoptConan(ConanFile): name = "structopt" homepage = "https://github.com/p-ranav/structopt" url = "https://github.com/conan-io/conan-center-index" description = "Parse command line arguments by d...
2.28125
2
classes/Text.py
JeanExtreme002/Aim-Coach
1
12772596
<filename>classes/Text.py from pygame import Surface from pygame import font class Text(object): """ Class for inserting text on the surface. """ DEFAULT_FONT = ('Comic Sans MS', 30) DEFAULT_COLOR = (255,0,0) def __init__(self,surface,x,y,text=None,text_font=DEFAULT_FONT,text_color=DEFAULT_CO...
3.734375
4
Aeneas/aeneas/aeneas/executejob.py
yalhaizaey/Dreich
25
12772597
<gh_stars>10-100 #!/usr/bin/env python # coding=utf-8 # aeneas is a Python/C library and a set of tools # to automagically synchronize audio and text (aka forced alignment) # # Copyright (C) 2012-2013, <NAME> (www.albertopettarin.it) # Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it) # Copyright (C) 2015-...
1.90625
2
Container/rm.py
qazbnm456/toolbox
0
12772598
"""This module contains `docker container rm` class""" from docker.errors import APIError from tsaotun.lib.Docker.Container.command import Command from tsaotun.cli import Tsaotun class Rm(Command): """This class implements `docker container rm` command""" name = "container rm" require = [] def __in...
2.828125
3
sonic-pde-tests/sonic_pde_tests/test_cpld.py
wbschwar/sonic-platform-pdk-pde
1
12772599
import pytest import sys import imp import subprocess import time # Global platform-specific cpldutil class instance platform_cpldutil = None # Loads platform specific cpldutil module from source def load_platform_cpldutil(json_config_data): global platform_cpldutil if platform_cpldutil is not...
2.171875
2
tests/test_LazyJSON.py
jameswenzel/jwp
6
12772600
<gh_stars>1-10 import unittest import os from LazyScripts.LazyJSON import * class jsonTest(unittest.TestCase): def setUp(self): self.cwd = os.path.dirname(os.path.realpath(__file__)) self.testpath = self.cwd + '/testdata/test.json' self.js = { '1992-12-17': {'name': 'James', '...
2.75
3
ports/devel/ninja/dragonfly/patch-configure.py
liweitianux/DeltaPorts
31
12772601
--- configure.py.intermediate 2014-12-12 13:05:20 UTC +++ configure.py @@ -41,6 +41,8 @@ class Platform(object): self._platform = sys.platform if self._platform.startswith('linux'): self._platform = 'linux' + elif self._platform.startswith('dragonfly'): + self._platform ...
2.078125
2
bytesCryptorMain.py
ZeroxTM/IDEA-HMK-Cryptor-1
0
12772602
<filename>bytesCryptorMain.py<gh_stars>0 __author__ = "<NAME>, <NAME>" __copyright__ = "2020 HMK-IDEA-Cryptor" __credits__ = ["<NAME>", "<NAME>"] __license__ = "MIT" __email__ = "<EMAIL>" import binascii from pckgIDEA.IDEA_bytestream import IDEA KEY = int('<KEY>', 16) cryptor = IDEA(KEY) # Initialize cryptor with 1...
2.84375
3
Exceptions.py
Pratyaksh7/PythonPrograms-Hackerrank
0
12772603
T = int(input()) for i in range(T): try: a, b = map(str, input().split()) print(int(int(a)//int(b))) except Exception as e: print("Error Code:", e)
3.078125
3
Diplomacy/commands.py
CScarame/DiplomacyBot
2
12772604
<filename>Diplomacy/commands.py ############# # Diplomacy turn.py # <NAME> # Set of possible commands that can be sent. ############# from Diplomacy.types import UnitType, OrderValidationError from Diplomacy.province import ProvinceBase, LandProvince, WaterProvince, CoastProvince, TwoCoastProvince from Diploma...
3.234375
3
datasets/utils/batch_collator.py
Nik-V9/AirObject
9
12772605
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- import os import torch import re import collections from torch._six import string_classes class BatchCollator(object): ''' pack dict batch ''' def __init__(self): super(BatchCollator,self).__init__() def __call__(self, batch): ...
2.671875
3
module/text_converter.py
5l1v3r1/saydog-framework
2
12772606
<reponame>5l1v3r1/saydog-framework<gh_stars>1-10 import os,sys,time from time import * r='\x1b[00m\x1b[91m' g='\x1b[00m\x1b[32m' y='\x1b[00m\x1b[33m' c='\x1b[00m\x1b[36m' w='\x1b[00m' u='\033[4m' b='\033[5m' def sprint(s): for c in s + '\n': sys.stdout.write(c) sys.stdout.flush() time.sleep...
2.421875
2
src/TulsiGenerator/Scripts/install_genfiles_tests.py
comius/tulsi
511
12772607
<gh_stars>100-1000 # Copyright 2018 The Tulsi 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 requ...
2.03125
2
pycroft/model/session.py
JuKu/pycroft
0
12772608
<filename>pycroft/model/session.py # -*- coding: utf-8 -*- # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. """ pycroft.model.session ~~~~~~~~~~~~~~ ...
2.328125
2
pivot_based_eccv2018/misc/optimizer.py
gujiuxiang/unpaired_im2text_iccv19
18
12772609
import os import torch import torch.nn as nn import torch.optim as optim from torch.nn.utils import clip_grad_norm import misc.utils as utils class Optim(object): def __init__(self, opt): self.last_ppl = None self.init_i2t(opt) self.init_nmt(opt) self._step = 0 self.opt = o...
2.3125
2
api/test/conftest.py
avikalpg/IndianVotingAssistant
8
12772610
import pytest @pytest.fixture def get_base_url(): base_url = "http://localhost:5000/" return base_url
1.6875
2
employee.py
vinayak1809/Python-Billing-Software
7
12772611
#==================imports=================== import sqlite3 import re import random import string from tkinter import * from tkinter import messagebox from tkinter import ttk from time import strftime from datetime import date from tkinter import scrolledtext as tkst #=======================================...
3.265625
3
evaluate/store_classifier_accuracy.py
shenkev/Exact-Inference-VAE-Robustness
3
12772612
<filename>evaluate/store_classifier_accuracy.py<gh_stars>1-10 import torch import numpy as np from PIL import Image from torchvision import datasets, transforms from mnist_model import Net from torch.autograd import Variable import os import pickle import logging import pdb def trim_to_28_from_32(data, num_data): ...
2.46875
2
app/views.py
BamX/dota2-matches-statistic
0
12772613
<filename>app/views.py from flask import jsonify, abort, request, make_response, render_template, redirect from app import app, auth, db, models from sqlalchemy.orm import aliased BASE_URL = "http://www.dotabuff.com" def allTeams(fameous): query = models.Team.query if fameous: query = query.filter(mod...
2.484375
2
settings.py
guoqiao/graphvizweb
0
12772614
<reponame>guoqiao/graphvizweb<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from os.path import abspath, dirname, join import sys BASE_DIR = dirname(abspath(__file__)) print BASE_DIR APPS_DIR = join(BASE_DIR, 'apps') sys.path.insert(0, APPS_DIR) WWW_DIR = join(BASE_DI...
1.789063
2
src/restic_compose_backup/containers_minecraft.py
Silthus/restic-compose-backup
0
12772615
<gh_stars>0 import os import logging from pathlib import Path from restic_compose_backup.containers import Container from restic_compose_backup.config import config, Config from restic_compose_backup import ( commands, restic, rcon ) from restic_compose_backup import utils logger = logging.getLogger(__na...
2.265625
2
derrida/common/solr_backend.py
making-books-ren-today/test_eval_4_derrmar
11
12772616
''' Haystack does not yet support range facets on Solr. This module provides subclasses of SolrSearchQuery and SolrSearchBackend to patch in range facet functionalty. ''' from haystack import connections from haystack.backends.solr_backend import SolrSearchQuery, SolrSearchBackend, \ SolrEngine from unidecode imp...
2.4375
2
figs12_13.py
asl-epfl/asl-it-2021
0
12772617
<gh_stars>0 import matplotlib.pyplot as plt import matplotlib as mpl import os from functions import * # %% getcontext().prec = 200 mpl.style.use('seaborn-deep') mpl.rcParams['text.usetex'] = True mpl.rcParams['font.family'] = 'serif' mpl.rcParams['text.latex.preamble'] = r'\usepackage{bm}' # %% Figure path FIG_PATH ...
2
2
control-api/app/api/endpoints/sensors.py
Towed-ROV/control-api
1
12772618
<reponame>Towed-ROV/control-api<gh_stars>1-10 import asyncio import json import queue import threading import time from multiprocessing import Queue from communication.data_saver_connection import DataSaverConnection from communication.payload_receiver import PayloadReceiver from communication.sensor_subscriber import...
2.375
2
ddf_utils/chef/procedure/merge_entity.py
semio/ddf_utils
2
12772619
<gh_stars>1-10 # -*- coding: utf-8 -*- """merge_entity procedure for recipes""" import logging from typing import List from .. helpers import debuggable from .. model.ingredient import DataPointIngredient from .. model.chef import Chef logger = logging.getLogger('merge_entity') @debuggable def merge_entity(chef:...
2.234375
2
quex/engine/state_machine/construction/TEST/test-repeat.py
smmckay/quex-mirror
0
12772620
#! /usr/bin/env python import sys import os sys.path.insert(0, os.environ["QUEX_PATH"]) from quex.engine.state_machine.core import * import quex.engine.state_machine.construction.repeat as repeat from quex.engine.state_machine.TEST_help.some_dfas import * if "--hwut-info" in sys.argv: print "DFA Operations:...
2.328125
2
main/forms.py
olnikiforov/djangoProject
0
12772621
<filename>main/forms.py """Forms for site.""" from django import forms from django.forms import ModelForm, Select, Textarea, TextInput from .models import Author, Comments, Post, Subscriber class PostForm(ModelForm): """Postform class.""" class Meta: """Meta class.""" model = Post f...
2.6875
3
learning_logs/apps.py
kevinbowen777/learning_log
0
12772622
from django.apps import AppConfig class LearningLogsConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" name = "learning_logs"
1.367188
1
handlers/qr.py
Cratosart/test_disc
0
12772623
<reponame>Cratosart/test_disc<gh_stars>0 import qrcode import secrets import string import os from PIL import Image, ImageDraw from aiogram import types from aiogram.dispatcher.filters import Command from utils import get_qr from utils import delete_user_qr from loader import dp, bot @dp.message_handl...
2.015625
2
model/npi.py
nienjiuntai/pytorch-npi
0
12772624
<reponame>nienjiuntai/pytorch-npi from torch.nn.modules.sparse import Embedding from tasks.add.env import AdditionEnv from tasks.add.core import StateEncoder, program_embedding import torch from torch import optim, tensor import torch.nn as nn import torch.nn.functional as F from torch.nn.modules import activation from...
2.484375
2
scripts/bus_factor/plot_normalized_commit_rates.py
a-paxton/oss-community-health
0
12772625
from glob import glob import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import argparse """ This is a reproduction of Fernando's 2011 normalized commit rate plot. This shows roughly the bus factor """ parser = argparse.ArgumentParser() parser.add_argument("--outname", "-o") args = parse...
2.5
2
pyrocov/sketch.py
corneliusroemer/pyro-cov
22
12772626
<reponame>corneliusroemer/pyro-cov # Copyright Contributors to the Pyro-Cov project. # SPDX-License-Identifier: Apache-2.0 import logging import re from collections import Counter, namedtuple import torch logger = logging.getLogger(__name__) MeanStd = namedtuple("MeanStd", ("mean", "std")) def murmur64(h): ""...
2.265625
2
fate/repeat.py
Mattias1/fate
0
12772627
<gh_stars>0 """This module provides a repeat mechanism for user input.""" from .document import Document from . import commands from functools import wraps class RepeatData: """A container object for all data we need.""" def __init__(self): self.last_user_input = [] self.last_command = None ...
3.40625
3
relativism.py
pau4o/quantumnik
16
12772628
# -*- coding: utf-8 -*- import os import sys from xml.dom import minidom from os.path import abspath, dirname, normcase, normpath, splitdrive # http://code.activestate.com/recipes/302594/ def commonpath(a, b): """Returns the longest common to 'paths' path. Unlike the strange os.path.commonprefix: - this...
2.84375
3
byceps/services/metrics/service.py
homeworkprod/byceps
23
12772629
<gh_stars>10-100 """ byceps.metrics.service ~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2014-2022 <NAME> :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from typing import Iterator from ...services.brand import service as brand_service from ...services.board import ( board_se...
1.671875
2
telegram_bot/config.py
YulLeo/meme-and-gifs-generator-telegram-bot
0
12772630
import os from pathlib import Path from dotenv import load_dotenv load_dotenv() API_TOKEN = os.getenv("TELEGRAM_API_TOKEN") SECRET_KEY = os.getenv("SECRET_KEY") ACCESS_KEY = os.getenv("ACCESS_KEY") OBJECT_STORAGE_IP = os.getenv("IN_DOCKER", "127.0.0.1") OBJECT_STORAGE_PORT = os.getenv("OBJECT_STORAGE_PORT", "9000"...
1.789063
2
packages/core/src/RPA/core/webdriver.py
FormulatedAutomation/rpaframework
2
12772631
<filename>packages/core/src/RPA/core/webdriver.py<gh_stars>1-10 import logging import os import platform import re import stat import subprocess import tempfile from pathlib import Path from typing import Any, List from selenium import webdriver from webdrivermanager import AVAILABLE_DRIVERS LOGGER = logging.getLogge...
2.34375
2
test/tests/chirc/tests/test_whois.py
Jusot/irc
2
12772632
import pytest from chirc import replies import chirc.tests.fixtures as fixtures class TestWHOIS(object): @pytest.mark.category("WHOIS") def test_whois1(self, irc_session): """ Test doing a WHOIS on a user (user2) that is not in any channels. """ client1 = irc...
2.140625
2
test/test_dtypes.py
fjarri/grunnur
1
12772633
import numpy import pytest from grunnur import dtypes from grunnur.modules import render_with_modules def test_normalize_type(): dtype = dtypes.normalize_type(numpy.int32) assert dtype == numpy.int32 assert type(dtype) == numpy.dtype def test_ctype_builtin(): assert dtypes.ctype(numpy.int32) == 'in...
2.375
2
pyapprox/examples/sparse_grid_examples.py
ConnectedSystems/pyapprox
26
12772634
<filename>pyapprox/examples/sparse_grid_examples.py from pyapprox.sparse_grid import * from pyapprox.univariate_quadrature import * def plot_2d_isotropic_clenshaw_curtis_sparse_grid(): num_vars = 2; level = 3 quad_rule = clenshaw_curtis_in_polynomial_order growth_rule = clenshaw_curtis_rule_growth samp...
2.5
2
theanet/layer/convpool.py
rakeshvar/theanet
55
12772635
<reponame>rakeshvar/theanet<gh_stars>10-100 import math import theano as th import theano.tensor as tt import theano.tensor.nnet as nnconv from theano.tensor.signal import pool from .layer import Layer, activation_by_name from .weights import init_wb float_x = th.config.floatX # ############################## ConvPoo...
2.1875
2
Tests/Marketplace/Tests/test_pack_dependencies.py
satyakidroid/content
799
12772636
<reponame>satyakidroid/content<gh_stars>100-1000 # type: ignore[attr-defined] from unittest.mock import patch import networkx as nx from Tests.Marketplace.packs_dependencies import calculate_single_pack_dependencies def find_pack_display_name_mock(pack_folder_name): return pack_folder_name class TestCalculateS...
2.09375
2
depthwise_graphviz.py
vladimirtomic/anari-ai
0
12772637
<reponame>vladimirtomic/anari-ai<filename>depthwise_graphviz.py ############################################## # # # Depthwise convolutional layer # # # ############################################## # Implort pygears ty...
2.171875
2
test/test_edit_contact.py
Gargamellos/python_training
0
12772638
<reponame>Gargamellos/python_training<filename>test/test_edit_contact.py from model.contact import Contact def test_edit_first_contact(app): app.contact.edit_first_contact(Contact(name ="edit", middlename ="edit", surname ="edit", nick ="edit", title ="edit", company = "edit", addres...
2.703125
3
average_water_vapour.py
ASVincent/swfo
0
12772639
<reponame>ASVincent/swfo<filename>average_water_vapour.py #!/bin/bash """ Create timeseries averages for the NOAA water vapour data. """ from datetime import datetime from pathlib import Path import numpy import h5py import pandas from wagl.geobox import GriddedGeoBox from wagl.hdf5.compression import H5CompressionF...
2.78125
3
gans/building_blocks/attention.py
christophstach/research-project-gan
1
12772640
import torch import torch.nn as nn from .convolution import Conv2d class SelfAttention2d(nn.Module): def __init__(self, in_channels, k=8, bias=False, eq_lr=False, spectral_normalization=False): super().__init__() self.wf = Conv2d(in_channels, in_channels // k, kernel_size=1, stride=1, padding=0,...
2.53125
3
pymultimatic/model/__init__.py
oliverpell/pymultiMATIC
30
12772641
<gh_stars>10-100 """Mapped model from the API.""" from .mode import ( # noqa: F401 Mode, OperatingMode, OperatingModes, QuickVeto, ActiveMode, SettingMode, SettingModes, ) from .timeprogram import TimeProgram, TimeProgramDay, TimePeriodSetting # noqa: F401 from .common import Component, Fu...
1.53125
2
libs/utils/android/workloads/uibench.py
MIPS/external-lisa
0
12772642
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2015, ARM Limited and contributors. # # 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 # # ...
1.96875
2
blood/migrations/0001_initial.py
Timoh97/Blood-G
0
12772643
<reponame>Timoh97/Blood-G # Generated by Django 3.2.9 on 2022-01-21 15:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('donor', '0002_auto_20210213_1602'), ('patient', '0001_initial'), ]...
1.84375
2
setup.py
anmolmalik01/package-installer
1
12772644
from setuptools import setup,find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name='python installer', version='0.0.1', license='MIT', author='<NAME>', author_email='<EMAIL>', description='A package installer for python', ...
1.492188
1
make_superpixel_dl.py
alsmeirelles/QuickAnnotator
0
12772645
<reponame>alsmeirelles/QuickAnnotator # + import argparse import glob import os import sys import traceback import cv2 import numpy as np import sklearn.feature_extraction.image import torch from skimage.segmentation import find_boundaries from skimage.segmentation import slic import json # - class LayerActivation...
2.28125
2
FamilyFood/lower_card/apps.py
ZST-Devs/HomeFood
2
12772646
from django.apps import AppConfig class LowerCardConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'lower_card'
1.445313
1
pichtest.py
PeterWinzell/RadarRPISwitch
0
12772647
import os import subprocess import sys import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(6,GPIO.IN) while True: val = GPIO.input(6) print(val) if val==1: break; time.sleep(0.2) print(' finished ' )
2.65625
3
dataset/Venice/3.make_3d_dataset.py
LeeJAJA/PHNet-pytorch
5
12772648
<filename>dataset/Venice/3.make_3d_dataset.py import os,os.path,re,shutil,json IMAGE_NUM = 2 SOURCE_PATH = '/.Venice/img_roi' EXPORT_PATH = '/.Venice/ablation' + str(IMAGE_NUM) ROI_PATH = '/.Venice/density_map_init' def mycopyfile(srcfile,dstfile): if not os.path.isfile(srcfile): print("not exist!"%(srcf...
2.5625
3
util/rev_info.py
ccwanggl/smartknob
3,836
12772649
<reponame>ccwanggl/smartknob import datetime import subprocess def git_short_rev(): try: return subprocess.check_output([ 'git', 'rev-parse', '--short', 'HEAD', ]).decode('utf-8').strip() except Exception: raise RuntimeError("Could not rea...
2.6875
3
test/pytest/test_anonymous_group.py
showipintbri/ttp
254
12772650
<filename>test/pytest/test_anonymous_group.py import sys sys.path.insert(0, "../..") import pprint from ttp import ttp def test_simple_anonymous_template(): template_1 = """interface {{ interface }} description {{ description | ORPHRASE }}""" data_1 = """ interface Port-Chanel11 description Storage Man...
2.59375
3