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
particle_environments/mager/observation.py
rallen10/ergo_particle_gym
0
12773551
<reponame>rallen10/ergo_particle_gym import numpy as np from copy import deepcopy from bisect import bisect, insort from particle_environments.common import distance, delta_pos from particle_environments.mager.world import SensingLimitedMortalAgent def format_observation(observe, objects, num_observations, observatio...
2.40625
2
src/act/arc/aCTCleaner.py
bryngemark/aCT
0
12773552
<filename>src/act/arc/aCTCleaner.py # aCTCleaner.py # # Cleans jobs from CE and ARC DB # import arc from act.common.aCTProcess import aCTProcess class aCTCleaner(aCTProcess): def processToClean(self): jobstoclean = self.db.getArcJobs("arcstate='toclean' and cluster='"+self.cluster+"' limit 100") ...
2.296875
2
capstone/capdb/migrations/0114_auto_20210420_2105.py
rachelaus/capstone
134
12773553
<filename>capstone/capdb/migrations/0114_auto_20210420_2105.py<gh_stars>100-1000 # Generated by Django 3.2 on 2021-04-20 21:05 import capdb.storages from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('capdb', '0113_auto_20210414_1532'), ] operation...
2.015625
2
arcade-romhacking-framework/make/patch_apply.py
zengfr/arcade-romhacking-framework
2
12773554
<filename>arcade-romhacking-framework/make/patch_apply.py #!/usr/bin/python # -*- coding:utf-8 -*- # (c) 2016 XingXing(<EMAIL>) # (c) 2020 zengfr(362505707#qq.com)(https://github.com/zengfr) import os import re import sys def patch_file(crosstools,fileelf,filemap,fileori,fileout): print 'patch_file processing',fi...
2.234375
2
faas/fastapi-lambda-docker/main.py
AtmaMani/pyChakras
0
12773555
# main app file from typing import Optional from fastapi import FastAPI, UploadFile, File, Request from fastapi.responses import HTMLResponse import json, os from pydantic import BaseModel from fastapi.templating import Jinja2Templates from mangum import Mangum # Create app, just like in Flask app = FastAPI() templat...
2.71875
3
SQL_best_practice_folder_scan.py
JanosLaci/scan_files_for_regex
0
12773556
import os import pathlib path_to_folder = pathlib.Path('.', 'folder_to_scan') def scan_folder_select_star(folder_to_scan=path_to_folder): with os.scandir(folder_to_scan) as dir_iterator: for file in dir_iterator: print(file.name) def main(): scan_folder_select_star() if __name__ == '...
3.40625
3
webcode/app/modules/submission_manager/views.py
joverbey/WebCode
1
12773557
# pylint: disable=no-name-in-module, f0401 from flask import request from flask.ext.login import login_required, current_user from app import app from app.database import session from app.util import serve_response, serve_error from app.modules.event_manager.models import Event from app.modules.project_manager.models i...
2.046875
2
projects/forms.py
18F/acquisitions.18f.gov
3
12773558
from django import forms from django.contrib.auth.models import User from django.contrib.postgres.forms import SimpleArrayField from projects.models import Buy, Project, IAA, AgencyOffice from projects.widgets import DurationMultiWidget from form_utils.forms import BetterModelForm from form_utils.widgets import AutoRes...
2.140625
2
demo/demo_reverse.py
VoraciousFour/VorDiff
0
12773559
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Dec 9 14:34:04 2019 @author: weiruchen """ from VorDiff.reverse_operator import ReverseOperator as rop from VorDiff.reverse_autodiff import ReverseAutoDiff as rad def create_reverse_vector(array): x, y = rad.reverse_vector(array) return x, y...
3.578125
4
ga/ga.py
pfrag/vassign
0
12773560
<reponame>pfrag/vassign<filename>ga/ga.py # -*- coding: utf-8 -*- """ Copyright 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 r...
2.125
2
tests/integration-tests/test_data.py
Krocodial/classy
0
12773561
<filename>tests/integration-tests/test_data.py<gh_stars>0 from selenium import webdriver from django.test import TestCase from selenium.webdriver.firefox.options import Options from django.urls import reverse import os, time from selenium.webdriver.common.keys import Keys import requests from requests.auth import HTTPB...
2.28125
2
commercia/offers/collections.py
commoncode/economica
2
12773562
<reponame>commoncode/economica<filename>commercia/offers/collections.py from cqrs.mongo import mongodb from cqrs.collections import DRFDocumentCollection from .models import Collection, Offer, OfferResourceContract from .serializers import ( CollectionSerializer, OfferResourceContractSerializer, OfferSerializer ) ...
1.890625
2
claircli/http_handler.py
jfabdo/claircli
16
12773563
<filename>claircli/http_handler.py # -*- coding: utf-8 -*- import logging import os from os.path import join, relpath from six.moves.SimpleHTTPServer import SimpleHTTPRequestHandler from functools import partial from threading import Thread from six.moves.BaseHTTPServer import HTTPServer logger = logging.getLogger(_...
2.328125
2
Contrib-Inspur/openbmc/poky/meta-selftest/lib/oeqa/runtime/cases/virgl.py
opencomputeproject/Rack-Manager
5
12773564
<filename>Contrib-Inspur/openbmc/poky/meta-selftest/lib/oeqa/runtime/cases/virgl.py from oeqa.runtime.case import OERuntimeTestCase from oeqa.core.decorator.depends import OETestDepends import subprocess import oe.lsb class VirglTest(OERuntimeTestCase): @OETestDepends(['ssh.SSHTest.test_ssh']) def test_kernel...
2.140625
2
hanibal/crm_gestion_faces/wizard/reporte_log_crm_listado_clientes.py
Christian-Castro/castro_odoo8
0
12773565
<filename>hanibal/crm_gestion_faces/wizard/reporte_log_crm_listado_clientes.py<gh_stars>0 # -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program ...
1.710938
2
tests/detail/serialization/test_nodes_impl.py
intdata-bsc/idact
5
12773566
import pytest from idact.core.auth import AuthMethod from idact.detail.allocation.allocation_parameters import AllocationParameters from idact.detail.config.client.client_cluster_config import ClusterConfigImpl from idact.detail.nodes.node_impl import NodeImpl from idact.detail.nodes.nodes_impl import NodesImpl from i...
1.90625
2
venv/lib/python2.7/site-packages/lettuce/django/tests/functional/djangoapp.py
GrupoMazoGuay/final
0
12773567
""" A minimal Django app, just one file. See: http://olifante.blogs.com/covil/2010/04/minimal-django.html """ import os from django.conf.urls.defaults import patterns from django.core.mail import send_mail from django.http import HttpResponse filepath, extension = os.path.splitext(__file__) ROOT_URLCONF = os.path.b...
2.40625
2
tools/demo_text.py
VDIGPKU/SReN_MM
1
12773568
<filename>tools/demo_text.py # -------------------------------------------------------- # Pytorch Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, based on code from <NAME> # -------------------------------------------------------- from __future__ import absolute_import from ...
2.171875
2
__init__.py
yulkang/augment3D
11
12773569
""" Augment 3D images of a focal lesion with 3D rotation, flip, and translation. import_mhd: Prepare patches from lung CT scan images and annotations. (See readme.md - Installation for details.) datasets: Retrieve patches after augmentation for training. classify_patch: Demonstrate the use of dataset...
1.875
2
src/Utils/__init__.py
bakkiaraj/WallPaperChanger
1
12773570
<filename>src/Utils/__init__.py # -*- coding: utf-8 -*- # @Author : <NAME> (nxp33721) # @EMail : <EMAIL> # @Software : Radar SoC GUI
0.964844
1
examples/combining_draggable_with_magnet.py
gottadiveintopython/draggable
13
12773571
from kivy.app import App from kivy.lang import Builder from kivy.factory import Factory from kivy.clock import Clock from kivy.properties import ( NumericProperty, StringProperty, BooleanProperty, ) import asynckivy as ak import kivy_garden.draggable class Magnet(Factory.Widget): ''' Inspired by http...
2.578125
3
test/components/stream_test.py
sytelus/longview
3,453
12773572
from tensorwatch.stream import Stream s1 = Stream(stream_name='s1', console_debug=True) s2 = Stream(stream_name='s2', console_debug=True) s3 = Stream(stream_name='s3', console_debug=True) s1.subscribe(s2) s2.subscribe(s3) s3.write('S3 wrote this') s2.write('S2 wrote this') s1.write('S1 wrote this')
2.140625
2
test_strategy.py
Nino-SEGALA/HuaweiChallenge
0
12773573
<gh_stars>0 # -*- coding: utf-8 -*- ''' Copyright (c) 2020 Huawei Technologies Sweden AB, All rights reserved. Authors: <NAME> ''' from robot_explorers import Strategy class Test(Strategy): '''Demo of strategy, observation, and action APIs''' def __init__(self): super().__init__() ...
3.015625
3
detect.py
ecr23xx/kp6d
3
12773574
import os import argparse from detect.eval.src.config import prepare_cfg, prepare_weight from detect.eval.src.dataset import prepare_dataset from detect.eval.src.detector import Detector def parse_arg(): parser = argparse.ArgumentParser(description='YOLO v3 evaluation') parser.add_argument('--bs', type=int, ...
2.234375
2
algorithms/RNN.py
DavidFellner/Malfunctions_in_LV_grid_datase
0
12773575
''' An Elman Network is implemented, taking the output of the last time step of the time series as prediction, and also to compute the training loss. This is done because this output is thought of as the most informed one. ''' import torch from torch import nn from sklearn.preprocessing import MaxAbsScaler from sklea...
2.890625
3
player.py
gorel/poker-server
0
12773576
from gamehelper import card2str import sqlite3 # Database column information PLAYER_ROUND_ID_COLUMN = 0 PLAYER_USER_ID_COLUMN = 1 PLAYER_TABLE_ID_COLUMN = 2 PLAYER_INITIAL_STACK_COLUMN = 3 PLAYER_STACK_COLUMN = 4 PLAYER_MY_TURN_COLUMN = 5 PLAYER_HAND1_COLUMN = 6 PLAYER_HAND2_COLUM...
3.125
3
reactive_robot/parsers/string.py
yusufcanb/reactive-robot
10
12773577
from reactive_robot.parsers.base import BaseParser class RawPayloadParser(BaseParser): def get_variables(self, message: bytes): if message: variables = message.decode("utf-8").split() return variables else: return []
2.40625
2
bucketsort.py
MichaelORegan/46887-COMPUTATIONAL-THINKING-WITH-ALGORITHMS-PROJECT
0
12773578
# <NAME> 05/May/2019 # https://www.sanfoundry.com/python-program-implement-bucket-sort/ def bucketSort(alist): largest = max(alist) length = len(alist) size = largest/length buckets = [[] for _ in range(length)] for i in range(length): j = int(alist[i]/size) if j != length: ...
3.875
4
source/src/molecule-unfolding/utility/QMUQUBO.py
qingfengtommy/quantum-ready-solution-for-drug-discovery
0
12773579
<reponame>qingfengtommy/quantum-ready-solution-for-drug-discovery<filename>source/src/molecule-unfolding/utility/QMUQUBO.py ######################################################################################################################## # The following class is the construction of QUBO model #################...
2.546875
3
walking.py
Cocodidou/projetFusee
0
12773580
<reponame>Cocodidou/projetFusee<filename>walking.py<gh_stars>0 # animate a stick person # stick figure by <NAME> import turtle import engine import random import math WIDTH = 640 HEIGHT = 480 FGCOLOR = 'grey70' BGCOLOR = 'grey23' POPCOLOR = 'white' POPPROB = 0.3 POPDURATION = 1 GROUNDPROB = 0.2 GROUNDX = -WIDTH / ...
3.21875
3
MSCL_Examples/Inertial/Python/setCurrentConfig.py
contagon/MSCL
53
12773581
<filename>MSCL_Examples/Inertial/Python/setCurrentConfig.py #import the mscl library import sys sys.path.append("../../dependencies/Python") import mscl #TODO: change these constants to match your setup COM_PORT = "COM4" try: #create a Serial Connection with the specified COM Port, default baud rate of 921600 ...
2.109375
2
Scripts/allele_specific_expression/summarize_ae.py
LijiangLong/2020-peel-paper
0
12773582
<filename>Scripts/allele_specific_expression/summarize_ae.py import pdb import pandas as pd import os def main(): read_count_file = '/Users/lijiang/Downloads/Reads_count.xlsx' ae_folder = '/Users/lijiang/Desktop/results' output_file = '/Users/lijiang/Desktop/summary_results.csv' df = pd.read_excel(rea...
2.625
3
ACME/loss/ReconstructionLoss.py
mauriziokovacic/ACME
3
12773583
from ..utility.strcmpi import * from .Loss import * class ReconstructionLoss(Loss): """ A class representing the standard autoencoder reconstruction loss Attributes ---------- fcn : str the reconstruction function to apply, either 'bce' or 'mse' """ def __init__(self, *args, fcn=...
2.578125
3
scripts/keras_benchmarks/run_benchmark.py
MikulasZelinka/benchmarks
2
12773584
<gh_stars>1-10 """ Main entry point for running benchmarks with different Keras backends.""" from models import mnist_mlp_benchmark from models import cifar10_cnn_benchmark from models import lstm_benchmark import upload_benchmarks_bq as bq import argparse import keras import json if keras.backend.backend() == "tenso...
2.328125
2
files/myMain.py
JessevanKempen/nutils
0
12773585
import numpy as np import pymc3 as pm import theano import theano.tensor as tt # for reproducibility here's some version info for modules used in this notebook import platform import IPython import matplotlib import matplotlib.pyplot as plt import emcee import corner import os from autograd import grad from files.myI...
2
2
resources/lib/parsers/AVIParser.py
mkwilliams14/service.tvtunes
0
12773586
<reponame>mkwilliams14/service.tvtunes # Copied (and slightly altered) from script.pseudotv.live # with permission of Lunatixz: # http://forum.xbmc.org/showthread.php?tid=177296 # On 21st January 2014 # https://github.com/Lunatixz/script.pseudotv.live/tree/master/resources/lib/parsers import os, struct from resou...
2.328125
2
utils/csvwriter.py
mfg92/Hantek1008Driver
12
12773587
<gh_stars>10-100 from typing import List, Any, Sequence, Callable, IO import threading import queue import csv # marking a child classes method with overrides makes sure the method overrides a parent class method # this check is only needed during development so its no problem if this package is not installed # to avo...
3.34375
3
tomography/src/Display.py
SamuelDoud/tomography
0
12773588
<gh_stars>0 """A user interface for interacting with the network.""" from tkinter import Tk, Frame, Button, Label, Entry, Menu, messagebox, Toplevel from tomography import Tomography from Node import Node, Server, EndUser from Connection import Connection from Link import Link class Display(Frame): """Provide th...
3.125
3
test/py/splines/test10.py
Ahdhn/lar-cc
1
12773589
<gh_stars>1-10 """ B-spline curve: effect of double or triple control points """ from larlib import * controls1 = [[0,0],[2.5,5],[6,1],[9,3]] controls2 = [[0,0],[2.5,5],[2.5,5],[6,1],[9,3]] controls3 = [[0,0],[2.5,5],[2.5,5],[2.5,5],[6,1],[9,3]] knots = [0,0,0,0,1,1,1,1] bspline1 = larMap( BSPLINE(3)(knots)(controls1)...
1.992188
2
coba/tests/test_environments_core.py
anrath/coba
0
12773590
<filename>coba/tests/test_environments_core.py<gh_stars>0 import unittest from typing import List from coba.pipes import MemoryIO from coba.config import CobaConfig, NullLogger from coba.environments import ( SimulatedInteraction, MemorySimulation, ClassificationSimulation, LambdaSimulation, CsvSimulation, Ar...
2.453125
2
chap_02/exe_036_dog_years.py
aleattene/python-workbook
0
12773591
""" It is commonly said that one human year is equivalent to 7 dog years. However this simple conversion fails to recognize that dogs reach adulthood in approximately two years. As a result, some people believe that it is better to count each of the first two human years as 10.5 dog years, and then count each additiona...
4.15625
4
pytropos/ast_transformer/__init__.py
helq/pytropos
4
12773592
from .miscelaneous import typed_ast3_to_ast from .transformer import PytroposTransformer, AstTransformerError __all__ = ["typed_ast3_to_ast", "PytroposTransformer", 'AstTransformerError']
1.226563
1
setup.py
fuzailpalnak/py-detect-track
2
12773593
<filename>setup.py<gh_stars>1-10 import os from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() current_dir = os.path.abspath(os.path.dirname(__file__)) try: with open(os.path.join(current_dir, "requirements.txt"), encoding="utf-8") as f: ...
1.625
2
Attempts/3piClient-Alexander Baran-Harper.py
SethuEapen/PrivacyNinja-Server
0
12773594
<reponame>SethuEapen/PrivacyNinja-Server<gh_stars>0 #<NAME>: https://www.youtube.com/watch?v=xfQlPWFlSgQ import socket host = '192.168.1.173' port = 5560 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) while True: command = input("Enter your command: ") if command == 'EXIT': ...
2.578125
3
linux/youtube_dl_script_linux.py
Frxhb/youtubedl_script
0
12773595
<filename>linux/youtube_dl_script_linux.py<gh_stars>0 from linux.functions_youtube_linux import check_installation from linux.functions_youtube_linux import type_abfrage from linux.functions_youtube_linux import move_audios from linux.functions_youtube_linux import move_videos check_installation.all_func_check() def ...
2.125
2
stock/urls.py
Praneeth-rdy/Innovation
0
12773596
<filename>stock/urls.py # Django Imports from django.urls import path, include # Standard Package Imports # Project Imports from . import views # Third Party Imports app_name = 'stock' urlpatterns = [ # path('', views.home, name='home'), path('', views.risk_return, name='risk-return'), path('portfoli...
1.859375
2
homework_1/scikitlearn_pipeline/pipeline.py
aigulkhkmv/deploy_course_hse
0
12773597
from sklearn.ensemble import AdaBoostClassifier from sklearn.pipeline import Pipeline from sklearn.preprocessing import Normalizer from homework_1.scikitlearn_pipeline.preprocessors import ConnectFeatures pipeline = Pipeline( steps=[ ("connect", ConnectFeatures(all=True)), ("norm", Normalizer()), ...
1.976563
2
thenewboston_node/business_logic/tests/test_blockchain/test_add_block.py
nishp77/thenewboston-node
30
12773598
<reponame>nishp77/thenewboston-node import pytest from thenewboston_node.business_logic.blockchain.base import BlockchainBase from thenewboston_node.business_logic.exceptions import ValidationError from thenewboston_node.business_logic.models import Block, NodeDeclarationSignedChangeRequest from thenewboston_node.core...
2.203125
2
Q21/sol.py
shivamT95/projecteuler
0
12773599
<gh_stars>0 divs = {} def sm(x): s = 0 for i in range(2,int(x**0.5)): if x%i == 0: s += i s += x/i if i*i == x: s -= i return s+1 for i in range(10001): divs[i] = sm(i) ans = 0 for i in range(10001): for j in range(10001): if divs[i] == j and divs[j] == i and i!=j: ans += i print(ans)
2.8125
3
src/ion/process/bootstrap/plugins/bootstrap_policy.py
scionrep/scioncc_new
2
12773600
#!/usr/bin/env python """Bootstrap process for system policy""" __author__ = '<NAME>, <NAME>' from pyon.public import log from ion.core.bootstrap_process import BootstrapPlugin from ion.process.bootstrap.load_system_policy import LoadSystemPolicy class BootstrapPolicy(BootstrapPlugin): """ Bootstrap plugin...
1.960938
2
src/secondaires/navigation/commandes/gouvernail/tenir.py
vlegoff/tsunami
14
12773601
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # raise o...
1.421875
1
MaudeMiner/settings.py
tklovett/MaudeMiner
3
12773602
####################### # MaudeMiner Settings # ####################### # Database settings DATABASE_PATH = '/Users/tklovett/maude/' DATABASE_NAME = 'maude' # These setting control where the text files and zip files retrieved from the FDA website are stored DATA_PATH = '/Users/tklovett/maude/data/' ZIPS_PATH = DATA_P...
1.40625
1
todolist/main/migrations/0001_initial.py
gda2048/TODOlist
1
12773603
# Generated by Django 2.2.2 on 2019-06-14 14:37 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Card', fields=[ ('id', models.AutoField(pri...
1.75
2
spid_cie_oidc/onboarding/views.py
freddi301/spid-cie-oidc-django
0
12773604
import json from django.core.paginator import Paginator from django.shortcuts import render, redirect from django.contrib import messages from django.utils.translation import gettext as _ from .forms import ( OnboardingRegistrationForm, OnboardingCreateTrustChain, OnboardingValidatingTrustMarkForm ) from ....
1.976563
2
tests/test_workspace.py
she11c0de/cubes
0
12773605
<reponame>she11c0de/cubes import unittest import os import json import re from cubes.errors import * from cubes.workspace import * from cubes.stores import Store from cubes.model import * from .common import CubesTestCaseBase # FIXME: remove this once satisfied class WorkspaceTestCaseBase(CubesTestCaseBase): def ...
2.546875
3
run-lab/gui.py
mes32/run-lab
0
12773606
<gh_stars>0 from Tkinter import * class GUI: def __init__(self): self.master = Tk() frame = Frame(self.master) frame.pack() self.exitButton = Button(frame, text="Exit", command=frame.quit) self.exitButton.pack(side=LEFT) def display(self): self.master.mainlo...
3.015625
3
twitter_fizzbuzz/auth.py
marcusgabrields/twitter_fizzbuzz
0
12773607
<reponame>marcusgabrields/twitter_fizzbuzz from decouple import config from requests_oauthlib import OAuth1Session API_KEY = config('API_KEY') API_SECRET_KEY = config('API_SECRET_KEY') ACCESS_TOKEN = config('ACCESS_TOKEN') ACCESS_TOKEN_SECRET = config('ACCESS_TOKEN_SECRET') def get_auth(): twitter_auth = OAuth...
2.265625
2
torchflare/callbacks/comet_logger.py
Atharva-Phatak/torchflare
86
12773608
"""Implements Comet Logger.""" from abc import ABC from typing import TYPE_CHECKING, List from torchflare.callbacks.callback import Callbacks from torchflare.callbacks.states import CallbackOrder from torchflare.utils.imports_check import module_available if TYPE_CHECKING: from torchflare.experiments.experiment ...
2.6875
3
statistics.py
clean-code-craft-tcq-1/start-stats-python-DivyaK-bit
0
12773609
<reponame>clean-code-craft-tcq-1/start-stats-python-DivyaK-bit<gh_stars>0 import math def calculateStats(numbers): Nums = {} if len(numbers) == 0: Nums = dict.fromkeys(['avg','min','max'],math.nan) #Sets all stats value to Nan for an empty list else: Nums["avg"] = sum(numbers)/len(numbers) Nums["mi...
2.859375
3
pybayenv/create_bin_dist.py
kristohr/pybayenv_beta
0
12773610
<filename>pybayenv/create_bin_dist.py import sys, string, re, os, commands, time #from scipy import stats #import scipy as sp import numpy as np #import matplotlib as mpl #from matplotlib import pyplot as plt class Locus_diff: def __init__(self, name, num_files): self.name = name.strip() ...
2.765625
3
tracking_policy_agendas/classifiers/xgb_clf.py
MohammadForouhesh/Computational-Political-Science-Papers-Implementations
1
12773611
<gh_stars>1-10 from xgboost import XGBClassifier from .meta_clf import MetaClf class XgbClf(MetaClf): def __init__(self, **kwargs): super().__init__(classifier_instance=XGBClassifier(n_estimators=300), **kwargs)
2.078125
2
problems/leetcode/convert-sorted-array-to-binary-search-tree.py
AravindVasudev/datastructures-and-algorithms
1
12773612
<gh_stars>1-10 # https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def sortedArrayTo...
3.53125
4
clip/mangled/__torch__/torch/nn/modules/linear/___torch_mangle_9449.py
shawwn/CLIP
6
12773613
<filename>clip/mangled/__torch__/torch/nn/modules/linear/___torch_mangle_9449.py class _LinearWithBias(Module): __parameters__ = ["weight", "bias", ] __buffers__ = [] weight : Tensor bias : Tensor training : bool
1.3125
1
alembic/versions/2afbc7d30a21_add_ip_address_to_database.py
PeterGrace/pi_director
12
12773614
<filename>alembic/versions/2afbc7d30a21_add_ip_address_to_database.py """add ip address to database Revision ID: 2afbc7d30a21 Revises: <KEY> Create Date: 2015-09-08 21:19:59.721831 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' branch_labels = None depends_on = None from ale...
1.585938
2
backend/Film/models.py
jspaeza/AppDjangoVue
0
12773615
<filename>backend/Film/models.py<gh_stars>0 from django.db import models class Film(models.Model): title = models.CharField(max_length=50) sinopsis = models.TextField() imagen = models.FileField(blank=False, null=True) def __str__(self): return self.imagen.name
1.875
2
tools/prune.py
CnybTseng/YOLOv3
1
12773616
<reponame>CnybTseng/YOLOv3<gh_stars>1-10 # -*- coding: utf-8 -*- # file: prune.py # brief: YOLOv3 implementation based on PyTorch # author: <NAME> # date: 2019/8/15 from __future__ import print_function import argparse import numpy as np import torch import torch.nn.functional as F import matplotlib.pyplot as plt from...
2.265625
2
backend/server/manage.py
map34/OceanHub
0
12773617
<reponame>map34/OceanHub<filename>backend/server/manage.py from flask_script import Command, Manager from oceanhub import app from oceanhub.scripts.shell import RunOceanHubShell from oceanhub.scripts.tests import RunOceanHubTests manager = Manager(app) class RunOceanHubServer(Command): def run(self): ap...
1.9375
2
e2end/model/fast_compilation.py
oplatek/e2end
14
12773618
<reponame>oplatek/e2end<filename>e2end/model/fast_compilation.py #!/usr/bin/env python # -*- coding: utf-8 -*- from . import E2E_property_decodingBase import tensorflow as tf import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) class FastComp(E2E_property_decodingBase): '''Dummy c...
2.015625
2
examples/conf.py
simple-lang/simple-docs
8
12773619
<reponame>simple-lang/simple-docs import sys import os import shlex this_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, this_path) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.mathjax', 'sphinx.ex...
1.546875
2
tools/UpInterrJava.py
Hydrogen-OS-P/build
33
12773620
<gh_stars>10-100 #!/usr/bin/env python ''' Created on 2012-12-20 @author: jock ''' import sys import os import re DIRECT_METHOD_FLAG = "# direct methods" class UpInterrJava(object): ''' classdocs ''' def __init__(self, addFile, inDir): ''' Constructor ''' self.idsL...
2.71875
3
Tasks/Filter.ByExtensions/task.py
esprengle/python-droppy-workspace
2
12773621
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import unicode_literals import os from shutil import copyfile class Task(object): """ Documentation: https://docs.droppyapp.com/tasks/filter-by-extensions """ def __init__(self, input_dir, output_dir, **kwargs): # Get keyword arguments...
2.75
3
ex5_cisco3_conf.py
ramyacr97/RamyaPython
0
12773622
from __future__ import unicode_literals, print_function from netmiko import Netmiko from getpass import getpass from jinja2 import FileSystemLoader, StrictUndefined from jinja2.environment import Environment password = getpass() env = Environment() env.loader = FileSystemLoader('.') cisco3 = { "host": 'cisco3.lasth...
2.265625
2
skill_data.py
wang-g/wang-g.github.io
0
12773623
<reponame>wang-g/wang-g.github.io from bs4 import BeautifulSoup import urllib2 import re def url_request(url): hdr = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36', 'Accept':'*/*'} request = urllib2.Request(url, headers=...
3.125
3
aiortc/codecs/__init__.py
dsvictor94/aiortc
1
12773624
from ..rtcrtpparameters import RTCRtcpFeedback, RTCRtpCodecParameters from .g711 import PcmaDecoder, PcmaEncoder, PcmuDecoder, PcmuEncoder from .opus import OpusDecoder, OpusEncoder from .vpx import VpxDecoder, VpxEncoder PCMU_CODEC = RTCRtpCodecParameters(name='PCMU', clockRate=8000, channels=1, payloadType=0) PCMA_C...
2.21875
2
wbia/guitool/__init__.py
dylanirion/wildbook-ia
6
12773625
# -*- coding: utf-8 -*- # flake8: noqa __version__ = '2.0.1' import logging import utool as ut ut.noinject(__name__, '[guitool.__init__]') # try: # # try seeing if importing plottool before any guitool things helps # import wbia.plottool # except Exception as ex: # import utool as ut # ut.printex(ex, '...
1.875
2
tests/test_core/test_clientcontroller.py
dls-controls/github-publish-test
0
12773626
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import setup_malcolm_paths from collections import OrderedDict import unittest from mock import MagicMock, patch, call # logging # import logging # logging.basicConfig(level=logging.DEBUG) # module imports from malcolm.controllers.d...
2.328125
2
writeDzn.py
alejandrohn/SCI-generator
0
12773627
<filename>writeDzn.py from printElement import PrintElement TAnswer = '%number of attributes' KAnswer = '%maximum size of support set' NAnswer = '%number of positive instances' MAnswer = '%number of negative instances' CAnswer = '%number of atMostOne Constraints' class ManageWriteDzn: global f def __init__...
2.78125
3
coffee/ik/ik_solver.py
kevinzakka/coffee
18
12773628
# Some implementation details regarding PyBullet: # # PyBullet's IK solver uses damped least squares (DLS) optimization. This is commonly # known as Levenberg-Marquardt (LM) optimization. from __future__ import annotations import dataclasses from typing import NamedTuple, Optional import numpy as np import pybullet ...
2.40625
2
tests/test_backends/test_base.py
ColinDuquesnoy/QCrash
30
12773629
from qcrash.backends.base import BaseBackend from qcrash.formatters.email import EmailFormatter import pytest def test_qsettings(): b = BaseBackend(None, '', '', None) assert b.qsettings() is not None def test_set_formatter(): b = BaseBackend(None, '', '', None) assert b.formatter is None b.set...
2.359375
2
2020/day_06/one.py
zigapk/adventofcode
0
12773630
count = 0 current_group = set() with open('in', 'r') as f: for line in f.readlines(): l = line.strip() if len(l) == 0: # this is end of the last group count += len(current_group) current_group = set() else: # add answers to the current group ...
3.671875
4
flydra_analysis/flydra_analysis/a2/stimulus_positions.py
elhananby/flydra
45
12773631
<gh_stars>10-100 stim_positions = { "double": [ [(0.4584, 0.2575, 0.2038), (0.4612, 0.2690, -0.0283)], # 3d location [(0.4601, 0.1549, 0.1937), (0.4614, 0.1660, -0.0358)], ], "double_20070301": [ [(0.4538, 0.2740, 0.1994), (0.4565, 0.2939, -0.0531)], # top highy [(0.4516, 0...
1.335938
1
tests/models/mantis_rcnn/test_mantis_rcnn_preds.py
ramaneswaran/mantisshrimp
0
12773632
<gh_stars>0 import pytest, torch from mantisshrimp import * @pytest.fixture(scope="module") def faster_rcnn_batch(): dataset = test_utils.sample_dataset() dataloader = MantisFasterRCNN.dataloader(dataset, batch_size=2) xb, yb = next(iter(dataloader)) return xb, list(yb) @pytest.fixture(scope="module...
2.125
2
code/shield/enableConfigure/lambda/index.py
aws-samples/aws-shield-advanced-rapid-deployment
1
12773633
import sys sys.path.insert(0,'./shield/enableConfigure/lambda') import json import boto3 import os import botocore import urllib3 import cfnresponse import logging logger = logging.getLogger('hc') logger.setLevel('DEBUG') shield_client = boto3.client('shield') iam_client = boto3.client('iam') s3_client = boto3.client...
1.890625
2
report_builder_demo/demo_second_app/admin.py
nazmizorlu/django-report-builder
560
12773634
from django.contrib import admin from .models import Bar @admin.register(Bar) class BarAdmin(admin.ModelAdmin): pass
1.21875
1
datasets/prepare_ytbvos.py
svip-lab/IVOS-W
26
12773635
import os import json import shutil import argparse import numpy as np from PIL import Image def getSeqInfo(dataset_dir, seq): ann_dir = os.path.join(dataset_dir, 'Annotations', '480p') seq_path = os.path.join(ann_dir, seq) frame_list = os.listdir(seq_path) frame_num = len(frame_list) frames = os...
2.3125
2
fhireval/test_suite/search/test_mod_prefix.py
ncpi-fhir/ncpi-fhir-platform-evaluation
0
12773636
<filename>fhireval/test_suite/search/test_mod_prefix.py import pytest import pdb from fhir_walk.model.patient import Patient test_id = f"{'2.2.1.2':<10} - Search Modifiers and Prefix" test_weight = 15 # TODO Write some tests def test_search_by_date(host): assert 0 == 1, "TODO - Write Test" def test_search_by_v...
2.265625
2
01_Python by Example Learning to Program in 150 Challenges by Nichola Lacey/03_chapter three strings/problem26.py
Magdyedwar1996/python-level-one-codes
1
12773637
""" 026 Pig Latin takes the first consonant of a word, moves it to the end of the word and adds on an “ay”. If a word begins with a vowel you just add “way” to the end. For example, pig becomes igpay, banana becomes ananabay, and aadvark becomes aadvarkway. Create a program that will ask the user to enter a word and ch...
4.3125
4
src/graph_visualize.py
sawyerWeld/PrefGAN
0
12773638
#graph_visualize.py from graphviz import Digraph import pairwise # Given a vector of the form generated in pairwise.py for # easy reading into NNs, produce a diagram of the represented graph def vec_to_graph(vec, name='no_name_graph', save=False, fromTorch=True): matrix = None if fromTorch: matrix = ...
2.78125
3
alephnull/live/broker.py
flatM/AlephNull
234
12773639
__author__ = 'oglebrandon' from logbook import Logger from ib.ext.Contract import Contract from ib.ext.ExecutionFilter import ExecutionFilter from ib.ext.Order import Order as IBOrder from alephnull.finance.blotter import Blotter from alephnull.utils.protocol_utils import Enum from alephnull.finance.slippage import T...
2.1875
2
assignment/assignment_day3_ans_cnn.py
minssoj/Learning_cnn
0
12773640
from tensorflow.keras.datasets import cifar10 from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten from tensorflow.keras.layers import Conv2D, MaxPooling2D from tensorflow.keras import utils import matplotlib.pyplot as plt num_classes = 10 im_rows = 32 ...
3.46875
3
students/k3340/laboratory_works/Pahmurin_Maksim/laboratiry_work_2/program/migrations/0007_auto_20200609_1524.py
imasyalol/ITMO_ICT_WebProgramming_2020
0
12773641
# Generated by Django 3.0.7 on 2020-06-09 12:24 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('program', '0006_auto_20200609_1522'), ] operations = [ migrations.AlterField( model_name='shedu...
1.421875
1
country_manager/countries/api/serializers.py
aleducode/country-manager
0
12773642
from django.db.models import fields from rest_framework import serializers from country_manager.countries.models import Country, Currency class SerializerCurrency(serializers.ModelSerializer): class Meta: model = Currency fields = ['code'] class BaseSerializerCountry(serializers.ModelSerializer...
2.15625
2
pdb_profiling/processors/pdbe/api.py
NatureGeorge/pdb-profiling
5
12773643
# @Created Date: 2020-01-12 01:27:18 pm # @Filename: api.py # @Email: <EMAIL> # @Author: <NAME> # @Last Modified: 2020-02-11 04:22:22 pm # @Copyright (c) 2020 MinghuiGroup, Soochow University from numpy import array, nan, count_nonzero import pandas as pd from typing import Union, Optional, Iterator, Iterable, Dict, L...
1.9375
2
pitop/robotics/pan_tilt_object_tracker.py
pi-top/pi-top-Python-SDK
28
12773644
from time import time from pitop.pma.servo_controller import ServoHardwareSpecs from .simple_pid import PID class PanTiltObjectTracker: _pid_tunings = { "slow": {"kp": 0.075, "ki": 0.002, "kd": 0.04}, "normal": {"kp": 0.25, "ki": 0.005, "kd": 0.1}, } _target_lock_range = 10 _slow_fps...
2.46875
2
bootstrapvz/providers/ec2/tasks/network.py
null0000/bootstrap-vz
0
12773645
<reponame>null0000/bootstrap-vz from bootstrapvz.base import Task from bootstrapvz.common import phases from bootstrapvz.common.tasks import apt from bootstrapvz.common.tasks import kernel import os.path class EnableDHCPCDDNS(Task): description = 'Configuring the DHCP client to set the nameservers' phase = phases.s...
2
2
vmware_nsx/plugins/nsx_v/vshield/edge_appliance_driver.py
yebinama/vmware-nsx
0
12773646
# Copyright 2013 VMware, 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...
1.507813
2
devconf/ast/mixins/node.py
everclear72216/ucapi
0
12773647
<filename>devconf/ast/mixins/node.py<gh_stars>0 class Node(object): def __init__(self): super().__init__() self.__filename = '' self.__children = [] self.__line_number = 0 self.__column_number = 0 def get_children(self) -> list: return self.__children def a...
2.75
3
name/__main__.py
nettle/python-template
0
12773648
<reponame>nettle/python-template<filename>name/__main__.py """ Name main """ import launcher if __name__ == "__main__": launcher.NameLauncher().run()
1.796875
2
lib.py
LeeBergstrand/HMMER-DB
1
12773649
#!/usr/bin/env python """ Created by: <NAME> Description: Functions for HMMER-DB. """ # Imports & Setup: import csv import sys from Bio import SeqIO import subprocess import re # Regex's LocusRegex = re.compile("\(Locus:\s\S*\)") LocationRegex = re.compile("\(Location:\s\[(\S*)\:(\S*)\]\((\S)\)\)") # ---------...
2.765625
3
tests/request_parsers/test_api_gateway_request_parser.py
gregchagnon/orm.cloud
0
12773650
<filename>tests/request_parsers/test_api_gateway_request_parser.py import unittest from orm_cloud.request_parsers.api_gateway_request_parser import ApiGatewayRequestParser json = """ { "body": "eyJ0ZXN0IjoiYm9keSJ9", "resource": "/{proxy+}", "path": "/thing", "httpMethod": "GET", "isBase64Encoded": true, ...
2.21875
2