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
bpcs/array_bit_plane.py
BburnN123/bpcs
20
42000
<reponame>BburnN123/bpcs import itertools import numpy as np from .logger import log def xor_lists(a, b): assert len(a) == len(b) return [x ^ y for x,y in zip(a,b)] def arr_map(arr, fcn): """ arr is a bit-planed numpy array returns arr with fcn applied to each pixel in arr where pixel is ...
2.984375
3
anonlink-entity-service/e2etests/tests/test_project_run_results.py
Sam-Gresh/linkage-agent-tools
1
42001
<gh_stars>1-10 from e2etests.util import create_project_no_data, post_run, get_run_result def test_run_similarity_score_results(requests, similarity_scores_project, threshold): run_id = post_run(requests, similarity_scores_project, threshold) result = get_run_result(requests, similarity_scores_project, run_id...
2.265625
2
checklists_scrapers/tests/spiders/ebird/test_json_parser.py
StuartMacKay/checklists_scrapers
4
42002
<reponame>StuartMacKay/checklists_scrapers<gh_stars>1-10 """Tests for parsing the JSON output from the eBird API.""" from unittest import TestCase from checklists_scrapers.spiders import DOWNLOAD_FORMAT, DOWNLOAD_LANGUAGE from checklists_scrapers.spiders.ebird_spider import JSONParser from checklists_scrapers.tests.u...
2.6875
3
oldtoronto/diff_geojson.py
patcon/oldto
22
42003
<filename>oldtoronto/diff_geojson.py #!/usr/bin/env python3 """Diffs a before and after geojson producing deleted, after, changed and unchanged geojson files. This can be used to estimate what locations in the before input have been corrected in the after input. In order to estimate the correctness of features one can...
2.84375
3
sdk/python/pulumi_gcp/compute/region_instance_group_manager.py
sisisin/pulumi-gcp
121
42004
<filename>sdk/python/pulumi_gcp/compute/region_instance_group_manager.py<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi....
1.570313
2
script/share_search.py
pettersoderlund/fondout
0
42005
#-*- coding: utf-8 -*- import findsc import argparse import mysql.connector from random import randint if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-f", "--fund", help="Fund to use.") parser.add_argument("-g", "--google", help="Google list", action='store_true') p...
2.578125
3
p19.py
aleksanderhan/ProjectEuler
0
42006
# Funksjon som sjekker om året er et skuddår def is_leap_year(year): if year % 400 == 0: return True elif year % 100 == 0: return False elif year % 4 == 0: return True return False # Funksjon som returnerer hvilken ukedag året starter på. # (fungerer bare fra og m...
3.71875
4
backpack/extensions/secondorder/hbp/custom_module.py
pitmonticone/backpack
0
42007
"""Module extensions for custom properties of HBPBaseModule.""" from backpack.core.derivatives.scale_module import ScaleModuleDerivatives from backpack.core.derivatives.sum_module import SumModuleDerivatives from backpack.extensions.secondorder.hbp.hbpbase import HBPBaseModule class HBPScaleModule(HBPBaseModule): ...
2.015625
2
display.py
skarrea/sirf-utilities
0
42008
import sirf.STIR as pet from scipy.spatial.transform import Rotation as R import numpy as np def printGeoInfo(image : pet.ImageData) -> None: """Print geometrical data for image object. Args: image (pet.ImageData): Input image. """ print(image.get_geometrical_info().get_info()) def printAffin...
3.25
3
hyperplane_hasher.py
lateral/hyperplane-hasher
33
42009
import re import numpy as np import sympy as sp import random as rd from functools import reduce NORMAL_VECTOR_ID = 'hyperplane_normal_vector_%s_%i' NUM_NORMAL_VECS_ID = 'num_normal_vectors_%s' CHAMBER_ID = 'chamber_%s_%s' FVECTOR_ID = 'feature_vector_%s' FVEC_ID_EX = re.compile(r'feature_vector_([\S]*)') class Hype...
2.890625
3
tap_listrak/http.py
Radico/tap-listrak
0
42010
<filename>tap_listrak/http.py import zeep from singer import metrics WSDL = "https://webservices.listrak.com/v31/IntegrationService.asmx?wsdl" def get_client(config): client = zeep.Client(wsdl=WSDL) elem = client.get_element("{http://webservices.listrak.com/v31/}WSUser") headers = elem(UserName=config["u...
2.375
2
example/multistream/plotter/plot_parser.py
th7nder/mp-quic
0
42011
<gh_stars>0 import csv import numpy as np FIBER = "Światłowód" LTE = "LTE" class Result: def __init__(self, paths, streams): self.paths = paths self.streams = streams class Path: def __init__(self, t, ifs, srtt, throughput): self.time = t - t[0] self.ifs = ifs self.srtt = srtt self.throughput = throu...
2.828125
3
src/zope/pluggableauth/plugins/groupfolder.py
zopefoundation/zope.pluggableauth
2
42012
<reponame>zopefoundation/zope.pluggableauth ############################################################################## # # Copyright (c) 2004 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL sh...
1.335938
1
webapp/models/mnist_model.py
dushik/AdversarialDNN-Playground
125
42013
<filename>webapp/models/mnist_model.py<gh_stars>100-1000 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.Variable(initial) def bias_variable(shape): initial=tf.constant(0.1, shape=shape) r...
2.953125
3
main.py
Walkline80/Iot-Platform-SDK
0
42014
from Walkline import Walkline, WalklineButton, WalklineSwitch from WalklineUtility import WifiHandler from utime import sleep from config import * from machine import Pin led = Pin(2, Pin.OUT, value=0) relay = Pin(14, Pin.OUT, value=1) def main(): Walkline.setup(UID, DEVICE_ID, DEVICE_KEY) button = WalklineButton...
3.21875
3
foundation_tenant/management/commands/populate_tenant.py
smegurus/smegurus-django
1
42015
import os import sys from decimal import * from django.contrib.sites.models import Site from django.core.mail import send_mail from django.db.models import Sum from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.utils.translation import ugettext_lazy as _ from ...
1.851563
2
metro.py
rugggg/metroSolv
0
42016
<reponame>rugggg/metroSolv #Metro Solver #Given a metro system, this program will use Q Learning to determine what the #best route between a given start point and end point is, given the assumption that the time value of each trip between any two stops is equal. import numpy as np import random from keras.models imp...
3.796875
4
util/ps_generate_data.py
perfsonar/esmond
3
42017
#!/usr/bin/env python3 import argparse from pycassa.pool import ConnectionPool from pycassa.columnfamily import ColumnFamily from pycassa.system_manager import * from pycassa.cassandra.ttypes import NotFoundException import json import timeit import time import uuid import datetime import random from esmond.config im...
1.929688
2
03_GraphBasedPlanner/graph_ltpl/offline_graph/src/__init__.py
f1tenth/ESweek2021_educationclassA3
15
42018
import graph_ltpl.offline_graph.src.gen_edges import graph_ltpl.offline_graph.src.gen_node_skeleton import graph_ltpl.offline_graph.src.gen_offline_cost import graph_ltpl.offline_graph.src.main_offline_callback import graph_ltpl.offline_graph.src.prune_graph
0.925781
1
spider_learn/spider_learn01/urllib_learn/urllib19_urlerror.py
Fly365/py-learn
0
42019
import urllib.request request = urllib.request.Request("http://aa.bb.cc.com/") try: response = urllib.request.urlopen(request,timeout=5) response.close() except urllib.request.URLError as err: print(err.reason()) except ConnectionResetError as connErr: print(connErr) print("----line------")
2.890625
3
tests/integration/blueprints/admin/orga/conftest.py
GSH-LAN/byceps
33
42020
""" :Copyright: 2006-2021 <NAME> :License: Revised BSD (see `LICENSE` file for details) """ import pytest from tests.helpers import login_user @pytest.fixture(scope='package') def orga_admin(make_admin): permission_ids = { 'admin.access', 'orga_birthday.view', 'orga_detail.view', ...
1.9375
2
track/utils.py
hellohaptik/track-python
1
42021
import logging from phonenumbers.phonenumberutil import region_code_for_country_code logger = logging.getLogger('interakt') def require(name, field, data_type): """Require that the named `field` has the right `data_type`""" if not isinstance(field, data_type): msg = '{0} must have {1}, got: {2}'.form...
2.96875
3
Week 1 - Not so-simple Hello World/AhmadHelloWorld.py
Jasleenk47/BeginnerRoom-2020
5
42022
print("Starter") print("Ahmad") print("Hello World") print("Not so Simple")
1.796875
2
scripts/pipelines/training_pipeline_unsupervised.py
daniele21/Financial_Sentiment_Analysis
0
42023
<gh_stars>0 import logging from typing import Text, Dict from scripts.data.metrics import report from scripts.models.utils import init_model from scripts.pipelines.preprocessing_pipeline import preprocessing_pipeline from scripts.savings import save_model_data logger = logging.getLogger() def inference_without_trai...
2.296875
2
api/user_profile.py
Come-and-Unity/come-and-unity-backend
0
42024
"""User profile resource view""" from sqlalchemy.exc import IntegrityError from flask_jwt_extended import decode_token, create_access_token from sqlalchemy.orm import exc from flask import jsonify, request, session, make_response from flask_restful import Resource from flask_api import status from marshmallow import Va...
2.90625
3
programa idade/ex002.py
VISAOTECH/exerc-cio-Python
1
42025
<filename>programa idade/ex002.py def idade_pessoa(id): idp = int(id) if idp <0: return 'idade inválida' elif idp <12: return 'você ainda é uma criança' elif idp <18: return 'você é adolecente' elif idp <65: return 'Você já é adulto' elif idp <100: retur...
3.25
3
examples/storage_pools_store_serv.py
LaudateCorpus1/oneview-python
18
42026
<reponame>LaudateCorpus1/oneview-python # -*- coding: utf-8 -*- ### # (C) Copyright [2019] Hewlett Packard Enterprise Development LP # # 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...
2.140625
2
intermezzo/__init__.py
imdaveho/intermezzo
8
42027
<reponame>imdaveho/intermezzo<filename>intermezzo/__init__.py import os import platform import intermezzo from ._ffi import ffi PKGPATH = os.path.dirname(os.path.abspath(__file__)) OS = platform.system() ARCH = platform.machine() lib = None # TODO: differentiate between 32-bit and 64-bit if OS == 'Windows': if A...
2.21875
2
helita/sim/rh.py
temcomp/helita
4
42028
""" Set of programs and tools to read the outputs from RH (Han's version) """ import os import sys import io import xdrlib import numpy as np class Rhout: """ Reads outputs from RH. Currently the reading the following output files is supported: - input.out - geometry.out - atmos.out -...
3.140625
3
HDRutils/merge.py
catchchaos/HDRutils-pip
2
42029
import logging, tqdm import numpy as np import rawpy import colour_demosaicing as cd import HDRutils.io as io from HDRutils.utils import * logger = logging.getLogger(__name__) def merge(files, do_align=False, demosaic_first=True, normalize=False, color_space='sRGB', wb=None, saturation_percent=0.98, black_leve...
2.265625
2
mbv1/test.py
klightz/splitting
9
42030
import pickle import numpy as np import sys def eigen(num, split_num, layer_num): prefix = 'min_' layer_num = int(layer_num) num = str(num) #cur = [8, 8, 8, 8, 16, 16, 24, 24, 24, 24, 24, 24, 32, 32] #cur = [10, 12, 13, 13, 21, 29, 35, 37, 35, 25, 28, 28, 37, 32] #cur = [12, 12, 18, 17, 28, 54...
2.515625
3
ex088.py
nascimentobrenda24/PythonExercises
1
42031
<filename>ex088.py # Faça um programa que ajude um jogador da MEGA SENA a criar palpites. O programa vai perguntar quantos jogos serão # gerados e vai sortear 6 números entre 1 e 60 para cada jogo, cadastrando tudo em uma lista composta. from random import randint games = [] temp = [] print('-'*30) print(' JOG...
3.953125
4
src/__init__.py
UMCUGenetics/VUSualizer
0
42032
from flask import Flask from flask_pymongo import PyMongo from flask_admin import Admin #from flask_mongoengine import MongoEngine from flask_login import LoginManager # flask app = Flask(__name__) app.config.from_pyfile("config.py") # mongo db mongo = PyMongo(app) #db = MongoEngine() #db.init_app(app) # login manag...
2.375
2
tests/t37.py
jplevyak/pyc
3
42033
<filename>tests/t37.py a = (1, "asdf", 2.0) a = (2, "fdsa", 3.0) print a[0] print a[1] print a[2]
1.601563
2
django_mako_plus/models.py
wynnw/django-mako-plus
79
42034
# this app has no models; file here just to conform to Django
1.101563
1
template_flask/funcs.py
zacharybeebe/template_flask
0
42035
<filename>template_flask/funcs.py import os import site import venv import subprocess import time from random import choice, randrange from .constants import * def generate_random_secret_key(): key = '' for i in range(32): alpha = choice([chr(randrange(65, 91)), chr(randrange(97, 123))]) num =...
2.4375
2
janny/auth.py
icyphox/janny
5
42036
import requests import os from janny.config import logger def kube_auth(): session = requests.Session() # We're in-cluster if not os.path.exists(os.path.expanduser("~/.kube/config")): with open("/var/run/secrets/kubernetes.io/serviceaccount/token") as f: token = f.read() sess...
2.234375
2
application/utils/__init__.py
fajaragungpramana/backend-warungku-deprecated
1
42037
<filename>application/utils/__init__.py import os import uuid import requests from datetime import datetime from dotenv import load_dotenv from flask import jsonify, make_response, request # get .env path and set it load_dotenv('../backend-warungku/.env') # This function to get .env variable configuration # @params...
2.75
3
src/demo.py
diganthp/pi-vision
12
42038
# Author: <NAME> (<EMAIL>) 08/25/2016 """SqueezeDet Demo. In image detection mode, for a given image, detect objects and draw bounding boxes around them. In video detection mode, perform real-time detection on the video stream. """ from __future__ import absolute_import from __future__ import division from __future_...
3.046875
3
singleton.py
soaringfreely/blog
1
42039
<filename>singleton.py __author__ = 'Administrator' # class Foo(object): # instance = None # # def __init__(self): # self.name = 'alex' # @classmethod # def get_instance(cls): # if Foo.instance: # return Foo.instance # else: # Foo.instance = Foo() # ...
3.203125
3
src/ner/crf/predict.py
amit-kolluri/AI-underwriting
0
42040
<reponame>amit-kolluri/AI-underwriting from .helper import convert_text from .helper import make_prediction from .helper import sent2features import joblib def crf_prediction(text, model_path, model_name): # Load the model from the file model_name = "crf_model.pkl" crf_model = joblib.load(model_path + mod...
2.921875
3
datatracker/file.py
TarjinderSingh/datatracker
3
42041
#!/usr/bin/env python3 import os import sys from datetime import date import subprocess from logzero import logger from .utils import is_cloud_path, path_exists class File(): def __init__(self, tag, path, description, source=None): self.properties = { 'tag': tag, 'path': pa...
2.5
2
tarefa013/02/ClasseTeste.py
MateSilver/cs-2021-1
0
42042
<filename>tarefa013/02/ClasseTeste.py<gh_stars>0 import Cavalo, Cachorro, Preguica class AnimalTeste(): """cria tres animais""" def __init__(self): self._cavalo = Cavalo.cavalo('Ariel',6,'corre','manso') self._cachorro = Cachorro.cachorro('BatmanRuivo',4,'corre',7828544,'Labrador') self...
2.765625
3
text data gathering and cleaning/1. pnva: medical emergencies entity/script.py
enlighter/scripts
0
42043
import json from pprintpp import pprint with open('terms.txt') as terms_file: lines = terms_file.readlines() main_list = list() current = dict() for term in lines: if 'head:' in term: if current: main_list.append(current) term = term.strip() term = term.strip('head:') term = term.strip() current = dic...
3.125
3
__init__.py
fonsecag/Cluster_tools
0
42044
<reponame>fonsecag/Cluster_tools from run import MainHandler __version__ = '0.1'
0.777344
1
tests/test-matplotlib2.py
6tudent/pyemf
16
42045
#!/usr/bin/python useEMF=True import sys try: import matplotlib except: print("Requires matplotlib from http://matplotlib.sourceforge.net.") sys.exit() if useEMF: matplotlib.use('EMF') ext=".emf" else: matplotlib.use('Agg') ext=".png" from pylab import * semilogy([12,49,78,42,.15,2...
2.234375
2
temboo/core/choreography.py
jordanemedlock/psychtruths
7
42046
<filename>temboo/core/choreography.py ############################################################################### # # temboo.core.choreography.Choreography # temboo.core.choreography.InputSet # temboo.coreo.choreography.ResultSet # temboo.core.choreography.ChoreographyExecution # # Interface classes for calling and...
2.03125
2
ex032.py
ranierelm/Python_exercise
0
42047
<gh_stars>0 ano = int(input('Ano que você nasceu: ')) if ano%4==0 and ano%100!=0 or ano%400==0: print('Ano Bissexto') else: print('Não foi Bissexto')
3.5
4
ansible-devel/test/integration/targets/module_utils_urls/library/test_peercert.py
satishcarya/ansible
0
42048
<filename>ansible-devel/test/integration/targets/module_utils_urls/library/test_peercert.py #!/usr/bin/python # Copyright: (c) 2020, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclas...
2.171875
2
v0.1/test103.py
strickyak/pythonine
0
42049
def identity_(a): return a def add_(a, b): return a+b def sum_(vec): z = 0 for e in vec: z = add_(z, identity_(e)) return z def work(): try: return sum_([10, 20, 30]) except as ex: return 'BOGUS' return 'BOTTOM' class Foo: def bar(self, x): return x+work() assert Foo().bar(3) ...
3.3125
3
libconf.py
ZhouLiHai/QMonitor
1
42050
#!/usr/bin/python from __future__ import absolute_import, division, print_function import sys import os import codecs import io import re ESCAPE_SEQUENCE_RE = re.compile(r''' ( \\x.. # 2-digit hex escapes | \\[\\'"abfnrtv] # Single-character escapes )''', re.UNICODE | re.VERBOS...
2.5
2
db/scripts/script_select/select_efetividades.py
LeandroLFE/capmon
0
42051
# Requer atributo e atributo_comp = {"atributo": int (id_atributo), "atributo_comp" : int (id_atributo)} select_efetividades = lambda : """ Select fator FROM efetividades WHERE atributo = :atributo AND atributo_comp = :atributo_comp """
2.578125
3
src/parliamentbg/parliamentbg/pipelines.py
Georgitanev/python38_proj_adata
0
42052
<gh_stars>0 from sqlalchemy.orm import sessionmaker from .models import Parliament from .models import create_table from .models import db_connect # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html #...
2.59375
3
week_11_DS_N_Algorithm/05_Algorithm_II/03_Graph_Algorithm_Basics/실습1_디지털 세계 토지조사.py
bky373/elice-racer-1st
1
42053
<filename>week_11_DS_N_Algorithm/05_Algorithm_II/03_Graph_Algorithm_Basics/실습1_디지털 세계 토지조사.py<gh_stars>1-10 ''' 디지털 세계 토지조사 디지몬들이 살고 있는 추억의 세계 디지털 월드는 다양한 크기의 섬들로 이루어져있습니다. 당신은 디지털국토정보공사를 도와 디지털월드를 개발하기 위한 토지조사를 진행하기로 하였습니다. 디지털 월드는 정사각형모양으로 생겼고, 토지는 1, 해양은 0으로 구성되어있습니다. 1이 상,하,좌,우로 연결되어있는 경우를 섬이라고 합니다. 디지털 월드에 있는...
2.546875
3
tests/riscv/state_transition/state_transition_partial_force.py
jeremybennett/force-riscv
0
42054
# # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 # # THIS SOFTWARE IS PRO...
1.9375
2
examples/PIMA/pima_analyst.py
kamathhrishi/GreyNSights
19
42055
<reponame>kamathhrishi/GreyNSights<filename>examples/PIMA/pima_analyst.py import numpy as np from analyst import Analyst, Command, DataSource, DataWorker, Pointer from frameworks import framework frameworks = framework() pandas = frameworks.pandas identity = Analyst("Alice", port=65442, host="127.0.0.1") worker = Da...
2.71875
3
Code/pipeline_intra.py
meet-eu-21/Team-SB3
0
42056
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 9 09:58:58 2021 @author: apauron """ import get_files_cluster ## To get the filename import Compartments_SB3_cluster """ A pipeline for generating intrachromosomal compartments in the cluster. Keyword arguments : None Retur...
2.484375
2
gnuradio-3.7.13.4/gr-digital/python/digital/qa_ofdm_cyclic_prefixer.py
v1259397/cosmic-gnuradio
1
42057
#!/usr/bin/env python # # Copyright 2007,2010,2011,2013,2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 3, ...
2.515625
3
JAPL/meta/statement.py
japl-lang/japl-python
3
42058
from abc import ABC, abstractmethod from dataclasses import dataclass from .expression import Expression, Variable from .tokenobject import Token from typing import List, Any class Statement(object): """ A Base Class representing JAPL statements """ def accept(self, visitor): raise NotImpleme...
3.28125
3
test/test_torsion.py
arvigj/polyfem-python
11
42059
<gh_stars>10-100 import unittest import polyfempy as pf # from .utils import plot import os import platform class TorsionTest(unittest.TestCase): def test_run(self): root_folder = os.path.join("..", "3rdparty.nosync" if platform.system() == 'Darwin' else "3rdparty", "data") dir_path = os.path.di...
2.203125
2
code/sample_sign_verify_detached.py
nomhoi/pycades_build
3
42060
<reponame>nomhoi/pycades_build<filename>code/sample_sign_verify_detached.py import pycades store = pycades.Store() store.Open(pycades.CADESCOM_CONTAINER_STORE, pycades.CAPICOM_MY_STORE, pycades.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED) certs = store.Certificates assert(certs.Count != 0), "Certificates with privat...
2.140625
2
trove/tests/unittests/guestagent/test_mongodb_manager.py
denismakogon/trove
0
42061
# Copyright 2012 OpenStack Foundation # # 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 l...
1.78125
2
apps/breakfast/tools/Life/tools/cx/messages/CxDownload.py
mtaghiza/tinyos-main-1
0
42062
# # This class is automatically generated by mig. DO NOT EDIT THIS FILE. # This class implements a Python interface to the 'CxDownload' # message type. # import tinyos.message.Message # The default size of this message type in bytes. DEFAULT_MESSAGE_SIZE = 9 # The Active Message type associated with this message. AM...
2.390625
2
epoch_generate_particles_files/save_data.py
georgeholt1/epoch-generate-particles-files
0
42063
<filename>epoch_generate_particles_files/save_data.py # Author: <NAME> # License: MIT # Version: 0.1 """ Part of EPOCH Generate Particles Files. Functions to save the generated data. """ import numpy as np import os def save_1d(x_list, w_list, out_dir): '''Save 1D particle data. Parameters ----------...
3.1875
3
Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/__init__.py
Con-Mi/lambda-packs
3
42064
"""Imports for Python API. This file is MACHINE GENERATED! Do not edit. Generated by: tensorflow/tools/api/generator/create_python_api.py script. """ from tensorflow.core.framework.attr_value_pb2 import AttrValue from tensorflow.core.framework.attr_value_pb2 import NameAttrList from tensorflow.core.framework.graph_pb2...
1.328125
1
tests/test_commands.py
kreyoo/poetry-types
1
42065
from __future__ import annotations import subprocess import pytest from conftest import CustomTOMLFile @pytest.mark.parametrize("command", [["update"], ["types", "update"]]) def test_update(command: list[str], toml_file: CustomTOMLFile): content = toml_file.poetry content["dependencies"].add("requests", "^2...
2.03125
2
test/ode/conftest.py
jzitelli/poolvr.py
12
42066
<reponame>jzitelli/poolvr.py<filename>test/ode/conftest.py import logging _logger = logging.getLogger(__name__) import os.path from sys import stdout import numpy as np import pytest @pytest.fixture def ode_pool_physics(pool_table): from poolvr.ode_physics import ODEPoolPhysics return ODEPoolPhysics(table=poo...
1.851563
2
Day_05/day_5_OOP.py
SidhuK/100_days_of_Code
2
42067
<filename>Day_05/day_5_OOP.py<gh_stars>1-10 from turtle import Turtle, Screen import prettytable timmy = Turtle() print(timmy) timmy.shape("turtle") timmy.color("coral") timmy.forward(100) # turtle has certain attributes as an object # use object.attribute to get it my_screen = Screen() print(my_screen.canvheight) ...
3.59375
4
ac2/dev/dummydata.py
schnabel/audiocontrol2
36
42068
''' Copyright (c) 2018 Modul 9/HiFiBerry Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
2.015625
2
test/visualize_ply.py
shamitlal/convolutional_occupancy_networks
0
42069
import numpy as np import open3d as o3d import pickle import torch import ipdb st = ipdb.set_trace def apply_4x4(RT, xyz): B, N, _ = list(xyz.shape) ones = torch.ones_like(xyz[:,:,0:1]) xyz1 = torch.cat([xyz, ones], 2) xyz1_t = torch.transpose(xyz1, 1, 2) # this is B x 4 x N xyz2_t = torch.ma...
2.046875
2
lib/image.py
dn480000/img2palette
0
42070
""" Helper functions for image processing The color space conversion functions are modified from functions of the Python package scikit-image, https://github.com/scikit-image/scikit-image. scikit-image has the following license. Copyright (C) 2019, the scikit-image team All rights reserved. Redistribution and use in...
1.578125
2
desicos/conecylDB/__init__.py
saullocastro/desicos
1
42071
r""" =================================================== Cone / Cylinder DataBase (:mod:`desicos.conecylDB`) =================================================== .. currentmodule:: desicos.conecylDB The ``desicos.conecylDB`` module includes all the information about cones and cylinders required to reproduce structures...
1.851563
2
atlasview/atlasview.py
GaelleChapuis/iblapps
0
42072
""" TopView is the main Widget with the related ControllerTopView Class There are several SliceView windows (sagittal, coronal, possibly tilted etc...) that each have a SliceController object The underlying data model object is an ibllib.atlas.AllenAtlas object TopView(QMainWindow) ControllerTopView(PgImageCon...
3.125
3
multi_tenant/tenant/patch/contenttype.py
AnsGoo/djangoMultiTenant
1
42073
<gh_stars>1-10 from django.apps import apps as global_apps from django.conf import settings from django.contrib.contenttypes import management from django.contrib.contenttypes.management import get_contenttypes_and_models from django.db import DEFAULT_DB_ALIAS from multi_tenant.tenant import get_common_apps def crea...
2.03125
2
python/aad/plot_anomalies_rectangle.py
rislam/ad_examples
1
42074
import os import numpy as np import numpy.random as rnd import matplotlib.pyplot as plt import logging from pandas import DataFrame from common.gen_samples import * from common.data_plotter import * from aad.aad_globals import * from aad.aad_support import * from aad.forest_description import * from aad.anomaly_data...
2.328125
2
tests/test_backbones/test_alexnet.py
jcwon0/BlurHPE
0
42075
<reponame>jcwon0/BlurHPE import torch from mmpose.models.backbones import AlexNet def test_alexnet_backbone(): """Test alexnet backbone.""" model = AlexNet(-1) model.train() imgs = torch.randn(1, 3, 256, 192) feat = model(imgs) assert feat.shape == (1, 256, 7, 5) model = A...
2.609375
3
src/core/migrations/0006_auto_20190615_2123.py
RedMoon32/GKH
0
42076
<filename>src/core/migrations/0006_auto_20190615_2123.py<gh_stars>0 # Generated by Django 2.2.2 on 2019-06-15 21:23 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0005_auto_20190615_2113'), ] operations = [ migrations.RemoveField( ...
1.242188
1
view/uiHelpers.py
olk90/pyBLG
0
42077
import sys from PySide2.QtCore import QCoreApplication, QFile def load_ui_file(filename): ui_file = QFile(filename) if not ui_file.open(QFile.ReadOnly): print("Cannot open {}: {}".format(filename, ui_file.errorString())) sys.exit(-1) return ui_file def translate(context, text): retu...
2.390625
2
CMC/CheckMyChords/views.py
Ergaro/CheckMyChords
1
42078
from os import path from django.contrib import messages from django.contrib.auth import login, authenticate from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.mixins import LoginRequiredMixin from django.db.models import Q from django.http.response import ( HttpResponse, HttpRespo...
2.1875
2
networks/deep_sdf_decoder_color_film.py
AdamWang00/DeepSDF
0
42079
<reponame>AdamWang00/DeepSDF #!/usr/bin/env python3 import torch.nn as nn import torch import torch.nn.functional as F import numpy as np class FiLM(nn.Module): def __init__(self): nn.Module.__init__(self) self.relu = nn.ReLU() def forward(self, x, gammas, betas): return self.relu((gam...
2.71875
3
modelscript/scripts/relations/printer.py
ScribesZone/ModelScribes
1
42080
<gh_stars>1-10 # coding=utf-8 from typing import Optional from modelscript.base.modelprinters import ( ModelPrinter, ModelSourcePrinter, ModelPrinterConfig, ) from modelscript.metamodels.relations import ( RelationModel, METAMODEL ) __all__ = [ 'RelationModelPrinter', ] class RelationModelP...
2.390625
2
toto/plugins/plots/plot_roses.py
calypso-science/Toto
1
42081
<reponame>calypso-science/Toto import pandas as pd import os from ._do_roses import do_roses from ._do_bias_hist import do_bias_hist from ._do_density_diagramm import do_density_diagramm from ._do_perc_of_occurence import do_perc_of_occurence from ._do_qq_plot import qq_plot from ._thermocline import thermocline from t...
2.546875
3
metrics/precision_recall.py
yrunhaar/fact-ai
0
42082
# -*- coding: utf-8 -*- """ From https://github.com/msmsajjadi/precision-recall-distributions/blob/master/prd_from_image_folders.py """ # coding=utf-8 # Copyright: <NAME> (msajjadi.com) import prd_score as prd from improved_precision_recall import knn_precision_recall_features def compute_prc(orig_data,synth_data,...
2.296875
2
autogluon_utils/benchmarking/evaluation/runners/run_generate_clean_openml_original.py
jwmueller/autogluon-benchmarking
15
42083
import pandas as pd from autogluon.utils.tabular.utils.savers import save_pd from autogluon_utils.benchmarking.evaluation.preprocess import preprocess_openml from autogluon_utils.benchmarking.evaluation.constants import * def run(): results_dir = 'data/results/' results_dir_input = results_dir + 'input/raw/...
2.1875
2
coresender/requests/send.py
coresender/coresender-sdk-python
8
42084
__all__ = ["BodyType", "SendEmail"] import enum from typing import List, Dict from .core import CoresenderApiRequest, LoginMethod from .. import responses from .. import errors class BodyType(enum.Enum): text = 'text' html = 'html' class SendEmail(CoresenderApiRequest): _api_version: str = '1' _ap...
2.5
2
Aula5/gabarito_primes.py
CalicoUFSC/minicurso-python
8
42085
<filename>Aula5/gabarito_primes.py inputfile = open('primes.txt') lista = inputfile.read().split(',') inputfile.close() lista = sorted([int(i) for i in lista]) outputfile = open('primes_sorted.txt', 'w') for i in lista: outputfile.write(str(i)+',')
3.03125
3
test/hours/get.py
sbutler/spotseeker_server
0
42086
""" Copyright 2012, 2013 UW Information Technology, University of Washington 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...
1.921875
2
roman/roman_reverse.py
mapinis/intro-to-programming-public
0
42087
inp = input("Input roman numerals: ").upper() + " " tot = 0 numeralDict = { "I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000 } inp = list(inp) for charNum in range(len(inp)): char = inp[charNum] if(char == "I"): if(inp[charNum + 1] != "I" and inp[charNum + 1] != " "...
3.65625
4
PythonExercicios/ex025.py
gabjohann/python_3
0
42088
# Crie um programa que leia o nome de uma pessoa e diga se ela tem 'Silva' no nome nome = str(input('Digite seu nome completo: ')).strip() print('Seu nome tem Silva? {}'.format('SILVA' in nome.upper())) # Resolução da aula # nome = str(input('Qual é seu nome completo? ')).strip() # print('Seu nome tem Silva? {}'.for...
4.125
4
PXL_DIGITAL_JAAR_2/AI & Robotics/Oplossingen/Week3/Oef1/board.py
RubenMoensJonkersPXL/PXL-DIGITAL
0
42089
from copy import deepcopy from src.CourseMaterials.Week3.Oef1.place import Place class Board: starting_board = [[Place(x, y) for x in range(3)] for y in range(3)] def __init__(self, inner_board=starting_board, value="", children=[], parent_board=deepcopy(starting_board)): self.inner_board = deepcopy(i...
3.84375
4
hard-gists/2888380/snippet.py
jjhenkel/dockerizeme
21
42090
<filename>hard-gists/2888380/snippet.py import bottle from wsgiproxy.app import WSGIProxyApp # Remove "hop-by-hop" headers (as defined by RFC2613, Section 13) # since they are not allowed by the WSGI standard. FILTER_HEADERS = [ 'Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', ...
2.296875
2
eosfactory/core/vscode.py
tuan-tl/eosfactory
255
42091
''' .. module:: eosfactory.core.vscode :platform: Unix, Darwin :synopsis: Default configuration items of a contract project. .. moduleauthor:: Tokenika ''' import json import argparse import eosfactory.core.config as config INCLUDE_PATH = "includePath" LIBS = "libs" CODE_OPTIONS = "codeOptions" TEST_OPTIONS ...
2.140625
2
tests/functional/services/policy_engine/utils/api/query_vulnerabilities.py
rbrady/anchore-engine
1,484
42092
from tests.functional.services.policy_engine.utils.api.conf import ( policy_engine_api_conf, ) from tests.functional.services.utils import http_utils def get_vulnerabilities( vulnerability_ids=[], affected_package=None, affected_package_version=None, namespace=None, ): if not vulnerability_ids...
2.15625
2
admin_tools/theming/apps.py
asherf/django-admin-tools
711
42093
<gh_stars>100-1000 # coding: utf-8 from django.apps import AppConfig class ThemingConfig(AppConfig): name = 'admin_tools.theming'
0.9375
1
code/tmp_rtrip/test/subprocessdata/sigchild_ignore.py
emilyemorehouse/ast-and-me
24
42094
<gh_stars>10-100 import signal, subprocess, sys, time signal.signal(signal.SIGCHLD, signal.SIG_IGN) subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait() p = subprocess.Popen([sys.executable, '-c', 'print("albatross")']) num_polls = 0 while p.poll() is None: time.sleep(0.01) num_polls += 1 i...
2.375
2
tests/line_markers/test_init.py
jamescooke/flake8-aaa
44
42095
from flake8_aaa.line_markers import LineMarkers from flake8_aaa.types import LineType def test(): result = LineMarkers(5 * [''], 7) assert result.types == [ LineType.unprocessed, LineType.unprocessed, LineType.unprocessed, LineType.unprocessed, LineType.unprocessed, ...
2.296875
2
tests/integration/test_ssl_cert_authentication/test.py
anishbhanwala/ClickHouse
1
42096
import pytest from helpers.cluster import ClickHouseCluster import urllib.request, urllib.parse import ssl import os.path HTTPS_PORT = 8443 NODE_IP = '10.5.172.77' # It's important for the node to work at this IP because 'server-cert.pem' requires that (see server-ext.cnf). NODE_IP_WITH_HTTPS_PORT = NODE_IP + ':' + st...
2.078125
2
taskmanager/src/modules/tasks/application/retrieve/get_task_error_handle.py
acostapazo/event-manager
0
42097
<reponame>acostapazo/event-manager<filename>taskmanager/src/modules/tasks/application/retrieve/get_task_error_handle.py from meiga import Result from petisco.controller.errors.http_error import HttpError from taskmanager.src.modules.tasks.domain.errors import TaskNotFoundError class TaskNotFoundHttpError(HttpError):...
2.140625
2
aulaspythonintermediario/exercicios01/exercicio01/exercicio01.py
lel352/Curso-Python
1
42098
<reponame>lel352/Curso-Python<gh_stars>1-10 def saudacao(saudar, nome): print(saudar, nome) saudacao('Olá', 'Leandro')
2.828125
3
setup_py3.py
melviso-osvf/scenario_runner
0
42099
<reponame>melviso-osvf/scenario_runner<filename>setup_py3.py #!/usr/bin/python3 import setuptools from os import path, system, chdir from setuptools.command.install import install from setuptools import setup, find_packages from sys import platform class extra_install(install): """Extra operations required for...
1.789063
2