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
softgroup/data/__init__.py
thangvubk/SoftGroup
75
12785151
from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler from .s3dis import S3DISDataset from .scannetv2 import ScanNetDataset __all__ = ['S3DISDataset', 'ScanNetDataset', 'build_dataset'] def build_dataset(data_cfg, logger): assert 'type' in data_cfg _data_cfg = d...
2.28125
2
test/test_tcalib.py
askpatrickw/micropython-stubber
0
12785152
<gh_stars>0 #Lobo from tpcalib import Calibrate x = Calibrate() x.drawCrossHair(10,20,False) x.readCoordinates()
1.617188
2
src/timematic/_utils.py
MicaelJarniac/timematic
1
12785153
from datetime import time, timedelta from .constants import S_IN_H, S_IN_MIN, US_IN_S from .units import Microseconds def time_in_microseconds(time: time) -> Microseconds: return Microseconds( (time.hour * S_IN_H + time.minute * S_IN_MIN + time.second) * US_IN_S + time.microsecond ) def sub...
3.3125
3
challenges/slippy/slippy.py
nickbjohnson4224/greyhat-crypto-ctf-2014
4
12785154
<reponame>nickbjohnson4224/greyhat-crypto-ctf-2014 import os import hashlib import struct class SlippyCipher(object): def __init__(self, key): pass def weak_block_encrypt(self, block, subkey): """ This is a pretty terrible block cipher. Thankfully, we can make it much stronger...
3.40625
3
scripts/move_ptu_touch.py
westpoint-robotics/virtual_ptu
2
12785155
<filename>scripts/move_ptu_touch.py<gh_stars>1-10 #!/usr/bin/env python PKG = 'virtual_ptu' import roslib; roslib.load_manifest(PKG) import time from math import pi from threading import Thread import rospy from sensor_msgs.msg import Joy from std_msgs.msg import Float64 from dynamixel_controllers.srv import * from...
2.21875
2
data_importer/shapefiles.py
aaronfraint/data-importer
0
12785156
<reponame>aaronfraint/data-importer from pathlib import Path from postgis_helpers import PostgreSQL def import_shapefiles(folder: Path, db: PostgreSQL): """ Import all shapefiles within a folder into SQL. """ endings = [".shp", ".SHP"] for ending in endings: for shp_path in folder.rglob(f"*...
2.921875
3
main.py
mr-glt/NCAEP-2
0
12785157
import time import csv from tentacle_pi.TSL2561 import TSL2561 from Adafruit_BME280 import * from ctypes import * from picamera import PiCamera from time import sleep from datetime import datetime sensor = BME280(mode=BME280_OSAMPLE_8) tsl = TSL2561(0x39,"/dev/i2c-1") tsl.enable_autogain() tsl.set_time(0...
1.976563
2
spyder/utils/introspection/tests/test_plugin_client.py
aglotero/spyder
1
12785158
<filename>spyder/utils/introspection/tests/test_plugin_client.py # -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # """Tests for plugin_client.py.""" # Test library imports import pytest # Local imports from spyder.utils.introspection.plugin_client impo...
2.25
2
orders/admin.py
mnemchinov/joint-expenses
0
12785159
<filename>orders/admin.py from django.contrib import admin from .models import * class TabularOrderPartner(admin.TabularInline): extra = 0 show_change_link = True model = Order.partners.through @admin.register(Order) class OrderAdmin(admin.ModelAdmin): list_display = ('__str__', 'status', 'opening_b...
1.921875
2
src/encoder.py
Tyred/BigData
2
12785160
import keras from keras.layers import Activation from keras.models import load_model from keras import backend as K from keras.utils.generic_utils import get_custom_objects import tensorflow as tf import numpy as np import pandas as pd import timeit import sys import argparse # Constants #window_size = 1024 def ...
2.34375
2
component/parameter/file_params.py
ingdanielguerrero/SMFM_biota
0
12785161
<reponame>ingdanielguerrero/SMFM_biota<gh_stars>0 from pathlib import Path # Parameter file parameter_file = Path(__file__).parents[2]/'biota/cfg/McNicol2018.csv'
1.3125
1
dateflix_api/views/me.py
pythrick/dateflix-api
8
12785162
from rest_framework import mixins, response, viewsets from dateflix_api.models import User from dateflix_api.serializers import ProfileSerializer class MeViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): """ API endpoint that allows current profile to be viewed. """ serializer_class = Profile...
2.265625
2
d/driver/servo/servo.py
desireevl/astro-pointer
2
12785163
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) p = GPIO.PWM(18, 50) p.start(2.5) while True: p.ChangeDutyCycle(2.5) # 0 degree time.sleep(1) p.ChangeDutyCycle(6.75) time.sleep(1) p.ChangeDutyCycle(10.5) time.sleep(1)
3.015625
3
__scraping__/investing.com - request, BS/main.py
whitmans-max/python-examples
140
12785164
# date: 2020.09.11 # author: Bartłomiej "furas" Burek (https://blog.furas.pl) # https://stackoverflow.com/questions/63840415/how-to-scrape-website-tables-where-the-value-can-be-different-as-we-chose-but-th import requests from bs4 import BeautifulSoup import csv url = 'https://id.investing.com/instruments/Historical...
3.1875
3
src/skge/test.py
comjoueur/cesi
100
12785165
<reponame>comjoueur/cesi<filename>src/skge/test.py import sys import numpy as np from numpy import sqrt, squeeze, zeros_like from numpy.random import randn, uniform import pdb def init_unif(sz): bnd = 1 / sqrt(sz[0]) p = uniform(low=-bnd, high=bnd, size=sz) return squeeze(p) sz = [10,10,5] a = init_unif(sz) pdb.s...
2.375
2
test/test_missing_feature_extraction.py
cbrewitt/GRIT-OpenDrive
0
12785166
import numpy as np from igp2 import AgentState, plot_map from igp2.data import ScenarioConfig, InDScenario from igp2.opendrive.map import Map import matplotlib.pyplot as plt from shapely.ops import unary_union from grit.core.data_processing import get_episode_frames from grit.core.feature_extraction import FeatureExt...
2.328125
2
predictFromGPR.py
KarlRong/Eye-controlled-e-reader
1
12785167
import matlab.engine import time class GPR(object): def __init__(self): future = matlab.engine.start_matlab(async=True) self.eng = future.result() # self.eng = matlab.engine.start_matlab() def predictGPR(self, data): x = self.eng.predictFromGPR_X(data) y = self.eng.pre...
2.65625
3
setup.py
yanggangthu/FVS_cython
1
12785168
<reponame>yanggangthu/FVS_cython from distutils.core import setup from Cython.Build import cythonize setup( ext_modules = cythonize("FVS_localsearch_10_cython.pyx") ) ''' setup( ext_modules = cythonize("FVS_localsearch_8_cython.pyx", #sources=[""], #add additional source file language = "c++")) '''
1.367188
1
model/__init__.py
reacher1130/AIGCN
0
12785169
<reponame>reacher1130/AIGCN from . import util, AIGCN
1.039063
1
katja_thermo.py
KatjaT/Thermodynamics
0
12785170
<filename>katja_thermo.py # -*- coding: utf-8 -*- """ calculate thermodynamics for Katja """ from component_contribution.kegg_reaction import KeggReaction from component_contribution.kegg_model import KeggModel from component_contribution.component_contribution import ComponentContribution from component_contribution.t...
2.75
3
misc/python/materialize/checks/roles.py
guswynn/materialize
0
12785171
<reponame>guswynn/materialize # Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source...
2.203125
2
export/dataset_summary.py
AndreasMadsen/nlp-roar-interpretability
17
12785172
import glob import json import argparse import os import os.path as path from functools import partial from tqdm import tqdm import pandas as pd import numpy as np import scipy import plotnine as p9 from scipy.stats import bootstrap from nlproar.dataset import SNLIDataset, SSTDataset, IMDBDataset, BabiDataset, Mimic...
2.40625
2
nr.refreshable/src/nr/refreshable/__init__.py
NiklasRosenstein/nr-python
3
12785173
<reponame>NiklasRosenstein/nr-python import logging import typing as t import threading __author__ = '<NAME> <<EMAIL>>' __version__ = '0.0.2' T = t.TypeVar('T') R = t.TypeVar('R') logger = logging.getLogger(__name__) Subscriber = t.Callable[['Refreshable[T]'], None] class Refreshable(t.Generic[T]): def __init__...
2.875
3
Back/generalchatroom/urls.py
sadeghjafari5528/404-
0
12785174
from django.urls import path from . import views urlpatterns = [ path('generalchatroom/', views.index, name='index'), path('generalchatroom/<str:room_name>/', views.room, name='room'), path('show_Message/', views.show_Message, name='show_Message'), ]
1.757813
2
lte/gateway/python/integ_tests/s1aptests/test_send_error_ind_for_dl_nas_with_auth_req.py
Aitend/magma
849
12785175
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
1.742188
2
gerapy/pipelines/mongodb.py
hantmac/Gerapy
2,888
12785176
<filename>gerapy/pipelines/mongodb.py<gh_stars>1000+ import pymongo from twisted.internet.threads import deferToThread class MongoDBPipeline(object): def __init__(self, mongodb_uri, mongodb_database): self.mongodb_uri = mongodb_uri self.mongodb_database = mongodb_database @classmethod ...
2.40625
2
bookorbooks/account/models/parent_profile_model.py
talhakoylu/SummerInternshipBackend
1
12785177
from django.core.exceptions import ValidationError from constants.account_strings import AccountStrings from django.db import models from django.conf import settings from country.models import City from django.db.models.signals import post_delete from django.dispatch import receiver class ParentProfile(models.Model): ...
2.25
2
setup.py
dignitas123/algo_trader
4
12785178
import setuptools from os.path import dirname, join here = dirname(__file__) with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="algo-trader", version="2.0.4", author="<NAME>", author_email="<EMAIL>", description="Trade execution engine to process API data...
1.617188
2
test/schema/fields/test_types.py
mcptr/pjxxs
0
12785179
<filename>test/schema/fields/test_types.py from nose.tools import assert_equal from nose.tools import assert_not_equal from nose.tools import assert_raises from pjxxs import fields types = { fields.String : (str, ""), fields.Object : (dict, {}), fields.Array : (list, []), fields.Int : (int, 0), fields.Double : (...
2.5
2
tests/test_basic.py
aigarius/photoriver2
0
12785180
<gh_stars>0 """Basic test environment tests""" def test_math(): assert 40 + 2 == 42
1.304688
1
photonpy/__init__.py
qnano/photonpy
5
12785181
<gh_stars>1-10 from .cpp.context import * from .cpp.estimator import * from .cpp.gaussian import Gauss3D_Calibration, GaussianPSFMethods from .cpp.cspline import * from .cpp.postprocess import * from .smlm.dataset import Dataset from .cpp.spotdetect import *
0.972656
1
tests/test_config_parser.py
serend1p1ty/core-pytorch-utils
65
12785182
<reponame>serend1p1ty/core-pytorch-utils<filename>tests/test_config_parser.py import os import tempfile import yaml from cpu import ConfigArgumentParser def test_config_parser(): with tempfile.TemporaryDirectory() as dir: parser = ConfigArgumentParser() parser.add_argument("-x", "--arg-x", actio...
2.53125
3
examples/mp/bzn_mp2.py
seunghoonlee89/pyscf-ecCC-TCC
2
12785183
<gh_stars>1-10 #!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' A simple example to run MP2 calculation. ''' import pyscf from pyscf import gto, scf, lo, tools, symm mol = gto.M(atom = 'C 0.0000 1.396792 0.0000;\ C 0.0000 -1.396792 0.0000;\ C 1.209657 0.698396 0.0000;\ C -1....
2.625
3
examples/pybullet/examples/frictionCone.py
stolk/bullet3
158
12785184
import pybullet as p import time import math p.connect(p.GUI) useMaximalCoordinates = False p.setGravity(0, 0, -10) plane = p.loadURDF("plane.urdf", [0, 0, -1], useMaximalCoordinates=useMaximalCoordinates) p.setRealTimeSimulation(0) velocity = 1 num = 40 p.configureDebugVisualizer(p.COV_ENABLE_GUI, 0) p.configureDe...
2.515625
3
setup/remove_nexus5_bloat.py
hacker131/dotfiles
71
12785185
<gh_stars>10-100 # Run this script using Monkeyrunner. import commands import time from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice _PACKAGES_TO_BE_DISABLED = ( 'com.google.android.apps.magazines', 'com.google.android.apps.plus', 'com.google.android.keep', 'com.google.android.play.games', 'co...
2.53125
3
server/orchestrator/models/__init__.py
bsantaus/qiskit-dell-runtime
17
12785186
<gh_stars>10-100 from .db_service import DBService from .runtime_program_model import RuntimeProgram from .message_model import Message from .job_model import Job from .user_model import User
1.023438
1
happytransformer/cuda_detect.py
swcrazyfan/happy-transformer
0
12785187
import torch import torch_xla import torch_xla.core.xla_model as xm def detect_cuda_device_number(): return torch.cuda.current_device() if torch.cuda.is_available() else -1 def detect_tpu_device_number(): return xm.xla_device().index if xm.xla_device() else -1
2.3125
2
prometheus_client/mmap_dict.py
postmates/prometheus_client_python
1
12785188
<gh_stars>1-10 import json import mmap import os import struct _INITIAL_MMAP_SIZE = 1 << 20 _pack_integer_func = struct.Struct(b'i').pack _value_timestamp = struct.Struct(b'dd') _unpack_integer = struct.Struct(b'i').unpack_from # struct.pack_into has atomicity issues because it will temporarily write 0 into # the mm...
2.546875
3
fasta2OneHotEncoding.py
lincshunter/RNACellularLocalization
0
12785189
<reponame>lincshunter/RNACellularLocalization<filename>fasta2OneHotEncoding.py<gh_stars>0 import os import sys from numpy import array from numpy import argmax from keras.utils import to_categorical import numpy as np import string #import diShuffle def oneHot2Sequence(oneHot): #print(oneHot) seq=np.z...
2.359375
2
kedro/pipeline/modular_pipeline.py
alxxjohn/kedro
0
12785190
<gh_stars>0 # Copyright 2021 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVI...
1.570313
2
src/evaluation/evaluate_character_predictor.py
Zhenye-Na/crnn-pytorch
39
12785191
"""Run validation test for CharacterPredictor.""" import os from pathlib import Path from time import time import unittest from text_recognizer.datasets import EmnistDataset from text_recognizer.character_predictor import CharacterPredictor os.environ["CUDA_VISIBLE_DEVICES"] = "" SUPPORT_DIRNAME = Path(__file__).par...
2.6875
3
tools/third_party/pywebsocket3/example/cgi-bin/hi.py
meyerweb/wpt
2,479
12785192
<gh_stars>1000+ #!/usr/bin/env python print('Content-Type: text/plain') print('') print('Hi from hi.py')
1.46875
1
neatsociety/math_util.py
machinebrains/neat-society
2
12785193
<reponame>machinebrains/neat-society<filename>neatsociety/math_util.py '''Commonly used functions not available in the Python2 standard library.''' from math import sqrt def mean(values): return sum(map(float, values)) / len(values) def variance(values): m = mean(values) return sum((v - m) ** 2 for v in...
3.03125
3
server/services/slack_service.py
nithinkashyapn/ooo-slack-bot
0
12785194
from slack import WebClient import server.config as config slack_service = WebClient(token=config.SLACK_TOKEN)
1.539063
2
mergeMetadata/modules/utils/exceptions.py
isabella232/ALM-SF-DX-Python-Tools
5
12785195
<filename>mergeMetadata/modules/utils/exceptions.py<gh_stars>1-10 class NotCreatedDescribeLog( Exception ): '''Exception launched when describe.log didn´t exist on the specific folder''' ERROR_CODE = 117 def __init__( self, pathDescribe ): super().__init__( f'Describe log didnt exist, please place it on {pathDesc...
2.15625
2
notebooks/tracking/test_relational_unkown.py
jeffhernandez1995/jeffhernandez1995.github.io
0
12785196
<filename>notebooks/tracking/test_relational_unkown.py import os import matplotlib.pyplot as plt import numpy as np import torch import torch.nn as nn from torch.utils.data import TensorDataset, DataLoader from lapsolver import solve_dense from losses import AssociationLoss from models import InteractionNet def enco...
2.328125
2
rkqc/tools/viewer.py
ah744/ScaffCC_RKQC
1
12785197
#!/home/adam/Documents/revkit-1.3/python #!/usr/bin/python # RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
2.59375
3
src/jobs/admin.py
HitLuca/predict-python
12
12785198
from django.contrib import admin from src.jobs.models import Job admin.site.register(Job)
1.257813
1
mmf/datasets/builders/csi/dataset.py
alisonreboud/mmf
0
12785199
<filename>mmf/datasets/builders/csi/dataset.py import copy import json import os import numpy as np import omegaconf import torch from mmf.common.sample import Sample from mmf.datasets.mmf_dataset import MMFDataset from mmf.utils.general import get_mmf_root from mmf.utils.visualize import visualize_images from PIL im...
2.1875
2
tree.py
StanfordAI4HI/Automatic_Curriculum_ZPDES_Memory
0
12785200
import numpy as np import json from graphviz import Digraph import pickle import compare_functions def remove_item(item_list, item): if item in item_list: item_list.remove(item) return list(item_list) def create_ngrams(trace, n): #A function that returns a list of n-grams of a trace return [tr...
2.96875
3
causal_networkx/discovery/tests/test_fcialg.py
adam2392/causal-networkx
0
12785201
<reponame>adam2392/causal-networkx<filename>causal_networkx/discovery/tests/test_fcialg.py import networkx as nx import numpy as np import pandas as pd import pytest from causal_networkx.algorithms import d_separated, possibly_d_sep_sets from causal_networkx.cgm import ADMG, PAG from causal_networkx.ci import Oracle f...
2.296875
2
extensions/aria_extension_tosca/simple_v1_0/presentation/field_getters.py
enricorusso/incubator-ariatosca
1
12785202
<gh_stars>1-10 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); y...
1.992188
2
migrations/versions/2d549589ee65_initial_migration.py
Julia-Agasaro/Books
0
12785203
"""Initial Migration Revision ID: 2d549589ee65 Revises: Create Date: 2019-10-02 16:59:16.744510 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '2d<PASSWORD>9ee65' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands ...
1.9375
2
examples/MgO__buck__lammps_neb/lammps_neb/lmps_script_2_python_str.py
eragasa/pypospack
4
12785204
def convert_textfile_to_python_string(filename_in,filename_out): assert isinstance(filename_in,str) assert isinstance(filename_out,str) lines_in = None with open(filename_in,'r') as f: lines_in = f.readlines() lines_out = [line.strip() for line in lines_in] for i,line in enumerate(lin...
3.921875
4
server/rest_api/serializers.py
GOKUPIKA/ivanc
14
12785205
from rest_framework import serializers from rest_api.models import App, Repo, Article class AppSerializer(serializers.ModelSerializer): class Meta: model = App fields = ('id', 'title', 'url', 'store_url', 'start_date', 'end_date', 'image', 'color', 'platform',) read_only...
2.703125
3
packages/syft/src/syft/core/node/common/node_service/heritage_update/heritage_update_messages.py
callezenwaka/PySyft
1
12785206
# stdlib from typing import Optional # third party from google.protobuf.reflection import GeneratedProtocolMessageType # relative from ...... import serialize from ......proto.core.node.common.service.heritage_update_service_pb2 import ( HeritageUpdateMessage as HeritageUpdateMessage_PB, ) from .....common.messag...
1.664063
2
src/WriteConstantDirectoryFiles/WriteThermophysicalProperties.py
darrinl2t/OpenFOAMCaseGenerator
3
12785207
<gh_stars>1-10 class ThermophysicalProperties: def __init__(self, properties, file_manager): self.properties = properties self.file_manager = file_manager def write_input_file(self): mu = str(self.properties['flow_properties']['dimensional_properties']['mu']) file_id = self.file...
2.640625
3
envs/classification.py
simula-vias/tetraband
4
12785208
<reponame>simula-vias/tetraband<gh_stars>1-10 import numpy as np import torch from gym import spaces from torch.utils.data import TensorDataset, DataLoader from torchvision import datasets, transforms import networks from envs.base import BaseEnv class ImageClassificationEnv(BaseEnv): def __init__(self, scenario,...
2.390625
2
plotUSA_GDP_and_GNI_final.py
cjekel/USA_GDP_per_capita_inflation_adjust
0
12785209
import numpy as np import matplotlib.pyplot as plt # close all figures plt.close('all') years = np.array([1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,...
2.078125
2
glue/external/wcsaxes/settings.py
yuvallanger/glue
1
12785210
<gh_stars>1-10 # Licensed under a 3-clause BSD style license - see LICENSE.rst COORDINATE_RANGE_SAMPLES = 50 FRAME_BOUNDARY_SAMPLES = 1000 GRID_SAMPLES = 1000
0.863281
1
basqbot/cogs/snipe.py
fckvrbd/basqbot
0
12785211
import discord from discord.ext import commands class Snipe(commands.Cog): """Gets the last message sent.""" def __init__(self, bot): self.bot = bot self.cache = {} @commands.Cog.listener() async def on_raw_message_delete(self, payload): message = payload.cached_message ...
2.6875
3
esmvalcore/preprocessor/_derive/chlora.py
markelg/ESMValCore
26
12785212
"""Derivation of variable `chlora`.""" from iris import Constraint from ._baseclass import DerivedVariableBase class DerivedVariable(DerivedVariableBase): """Derivation of variable `chlora`.""" @staticmethod def required(project): """Declare the variables needed for derivation.""" requi...
3.3125
3
Lib/Category.py
StaymanHou/eBayCrawler
6
12785213
<filename>Lib/Category.py<gh_stars>1-10 import MySQLdb import Mydb class Category(object): def __init__(self): self.pk=None self.fields={} def __getitem__(self,field): if field == 'PK': return self.pk else: if field in self.fields: return...
2.609375
3
tofe_eeprom_crc.py
timvideos/HDMI2USB-TOFE-eeprom-tools
0
12785214
""" # Name Identifier-name, Poly Reverse Init-value XOR-out Check [ 'crc-8', 'Crc8', 0x107, NON_REVERSE, 0x00, 0x00, 0xF4, ], """ from io import StringIO from crcmod import Crc c8 = 0x107 code = StringIO() Crc(c8,...
2.140625
2
autoencoders/mnist_old/dataloaders.py
dyth/generative_models
1
12785215
<filename>autoencoders/mnist_old/dataloaders.py<gh_stars>1-10 #!/usr/bin/env python """ download mnist """ import torch.utils.data from torchvision import datasets, transforms def get_mnist(path, use_cuda, batch_size, test_batch_size): 'download into folder data if folder does not exist, then create dataloader' ...
2.640625
3
csdl/utils/slice_to_list.py
LSDOlab/csdl
0
12785216
from typing import List, Union import numpy as np def slice_to_list( start: Union[int, None], stop: Union[int, None], step: Union[int, None], size: int = None, ) -> List[int]: if start is None and stop is None: if size is None: raise ValueError("size required when start and sto...
3.5625
4
all_cnn_96/t7_to_hdf5.py
ganow/keras-information-dropout
16
12785217
import torchfile import h5py dataset_types = ('train', 'valid', 'test') dataset_path = 'data/cluttered_{}.t7' outpath = 'data/cluttered_mnist.h5' with h5py.File(outpath, 'w') as hf: for dataset_type in dataset_types: inpath = dataset_path.format(dataset_type) print('... load {}'.format(inpath)) o = tor...
2.609375
3
zdpapi_modbus/master.py
zhangdapeng520/zdpapi_modbus
1
12785218
<reponame>zhangdapeng520/zdpapi_modbus """ master角色 """ from typing import Tuple from .libs.modbus_tk import modbus_tcp from .libs.modbus_tk import defines as cst from .zstruct import trans_int_to_float import time class Master: def __init__(self, host: str = "127.0.0.1", port: i...
2.53125
3
ann_benchmarks/algorithms/lshf.py
PhilSk/ann-jaccard
0
12785219
from __future__ import absolute_import import sklearn.neighbors import sklearn.preprocessing from ann_benchmarks.algorithms.base import BaseANN from datasketch import MinHash class LSHF(BaseANN): def __init__(self, metric, n_estimators=10, n_candidates=50): self.name = 'LSHF(n_est=%d, n_cand=%d)' % (n_est...
2.28125
2
pattern-example-google.py
kemalcanbora/python-examples
1
12785220
# pattern library example querying Google using the context and terms option to get weights and comparisons # author: <NAME> # Date Created: 2015 05 18 # to install pattern, it is simple via pip: pip install pattern import sys # need this to pass arguments at the command line from termcolor import colored # awesome co...
3.1875
3
server/models.py
sjkdmpy/noBlindEyez
0
12785221
<gh_stars>0 from tortoise.models import Model from tortoise import fields from tortoise.validators import MinLengthValidator from tortoise.contrib.pydantic import pydantic_model_creator, pydantic_queryset_creator from enum import Enum from server.validators.custom import ( validate_longitude, validate_latitude ) cl...
2.40625
2
BackEnd/attendoBE/api/Calls/subject.py
PedroDuarteSH/attendance-management
0
12785222
<filename>BackEnd/attendoBE/api/Calls/subject.py<gh_stars>0 from django.shortcuts import render from django.http.response import JsonResponse from rest_framework.response import Response from rest_framework.decorators import api_view from django.db import connection, DatabaseError import json from .error import error ...
2.5
2
main_script.py
tahir1069/TrafficSignClassifier
0
12785223
# Load pickled data import cv2 import pickle import numpy as np import matplotlib.pyplot as plt from sklearn.utils import shuffle import tensorflow as tf import MyAlexNet import DataAugmentation as func import glob import csv # TODO: Fill this in based on where you saved the training and testing data ...
2.734375
3
apps/snake.py
LeLuxNet/GridPy
0
12785224
import datetime import random from config import * from lib import app, cords, button, led from utils import time class Direction: def __init__(self, x, y, left=None, right=None): self.x = x self.y = y self.left = left self.right = right SPEED = 1000 DIR_UP = Direction(0, -1) ...
2.984375
3
train_NaiveBayes_model.py
dlhuynh/flask-app
0
12785225
<reponame>dlhuynh/flask-app<filename>train_NaiveBayes_model.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 17 09:33:14 2021 @author: dhuynh """ import pandas as pd from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.featur...
2.6875
3
venv/lib/python2.7/site-packages/image/video_field.py
deandunbar/html2bwml
0
12785226
<reponame>deandunbar/html2bwml from django.db import models from django.db.models.fields.files import FieldFile # A video field is exactly a file field with a different signature class VideoFieldFile(FieldFile): pass class VideoField(models.FileField): attr_class = VideoFieldFile
2.171875
2
swhlab/__init__.py
swharden/SWHLab
15
12785227
<reponame>swharden/SWHLab """ SWHLab is a python module intended to provide easy access to high level ABF file opeartions to aid analysis of whole-cell patch-clamp electrophysiological recordings. Although graphs can be interactive, the default mode is to output PNGs and generate flat file HTML indexes to allow data br...
1.875
2
train_levels.py
TheCherry/test_ai_game
0
12785228
A = 0 ## AIR - Movable field, no actions P = 1 ## PLAYER - The Player W = 2 ## WALL - A Wall, player cant pass F = 3 ## FIRE - Kills the player if he havent a Fire protection P = 4 ## FPROTECT - Fire protection R = 5 ## ALLOW_DIRECTION...
2.375
2
physionet-django/console/admin.py
partizaans/physionet-build
0
12785229
from django.contrib import admin from physionet import models # Register your models here. admin.site.register(models.StaticPage) admin.site.register(models.Section)
1.375
1
app/blog/forms.py
chaos-soft/velvet
0
12785230
from datetime import datetime from common.forms import DocumentForm from common.functions import create_thumbnail, delete_thumbnail from django import forms from django.conf import settings from django.utils.dateformat import format from .models import Article class ArticleForm(DocumentForm): UPLOAD_TO = 'blog/...
2.265625
2
src/pumpwood_deploy/deploy.py
Murabei-OpenSource-Codes/pumpwood-deploy
0
12785231
"""Pumpwood Deploy.""" import os import stat import shutil from pumpwood_deploy.microservices.standard.standard import ( StandardMicroservices) from pumpwood_deploy.kubernets.kubernets import Kubernets class DeployPumpWood(): """Class to perform PumpWood Deploy.""" create_kube_cmd = ( 'SCRIPTPATH...
2.3125
2
src/view/gtkview/msgSupport.py
iivvoo-abandoned/most
0
12785232
""" generic routines for classes / widgets that support printing of irc messages """ # $Id: msgSupport.py,v 1.11 2002/02/24 23:08:24 ivo Exp $ from gtk import * from GDK import * from libglade import * red = GdkColor(-1, 0, 0) blue = GdkColor(0, 0, -1) class msgSupport: def __init__(self): pass ...
2.578125
3
src/losses.py
dxfg/2DVoxelmorph
2
12785233
# Third party inports import tensorflow as tf import numpy as np # batch_sizexheightxwidthxdepthxchan def diceLoss(y_true, y_pred): top = 2*tf.reduce_sum(y_true * y_pred, [1, 2, 3]) bottom = tf.maximum(tf.reduce_sum(y_true+y_pred, [1, 2, 3]), 1e-5) dice = tf.reduce_mean(top/bottom) return -dice de...
2
2
afqueue/messages/peer_messages.py
appfirst/distributed_queue_manager
1
12785234
from afqueue.common.encoding_utilities import cast_bytes from afqueue.messages.base_message import BaseMessage #@UnresolvedImport from afqueue.common.exception_formatter import ExceptionFormatter #@UnresolvedImport from afqueue.common.client_queue_lock import ClientQueueLock #@UnresolvedImport from afqueue.messages imp...
1.859375
2
googledocs/fix-googledocs-html.py
JoshuaFox/beautiful-jekyll
0
12785235
<filename>googledocs/fix-googledocs-html.py # coding utf-8 import os import re import urllib.parse from pathlib import Path from bs4 import BeautifulSoup def out_folder(): return os.path.abspath("./yiddish") def folder_in(): return os.path.abspath("./_yiddish_from_google_docs") def clean_missing_font_link(f...
3.03125
3
routes.py
Isaacgv/api_car_recom_blx
0
12785236
<filename>routes.py<gh_stars>0 import os from flask import Flask, request from flask_cors import CORS from speech import recive_audio from nlu import sentiment_nlu app=Flask(__name__) cors = CORS(app, resource={r"/*":{"origins": "*"}}) #{ # 'car': (string) # 'text': (string) # 'audio':(file) #} @app.route(...
2.78125
3
pymedphys/_dicom/rtplan/core.py
pymedphys/pymedphys-archive-2019
1
12785237
# Copyright (C) 2019 Cancer Care Associates # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to ...
2.078125
2
app/__init__.py
zjurelinac/FM-Radio
0
12785238
from flask import Flask from flask.ext.mail import Mail from peewee import * import os cwd = os.getcwd() frontend_dest = os.path.join( cwd, 'frontend/' ) app = Flask( __name__, static_url_path = '', static_folder = frontend_dest ) app.config.from_object( 'config' ) mail = Mail( app ) db = SqliteDatabase( app.config...
2.15625
2
webcam_handler.py
dain-kim/ASLingo
0
12785239
<reponame>dain-kim/ASLingo import os, sys import cv2 import numpy as np import pandas as pd import string import mediapipe as mp import pickle from zipfile import ZipFile from utils import StaticSignProcessor, mp_process_image, generate_dataframe, annotate_image, pred_class_to_letter # load the model with open('saved...
2.609375
3
index.py
Unknowncmbk/Pokemon-Go-Locator-Server
0
12785240
<reponame>Unknowncmbk/Pokemon-Go-Locator-Server<filename>index.py #!/usr/bin/python # local imports import pokemon import cell_data from user import transaction from user import loc # python modules import time import json import Geohash from flask import Flask from flask import request ''' Note: This module serves ...
2.609375
3
haptools/data/haplotypes.py
aryarm/admixtools
0
12785241
from __future__ import annotations import re from pathlib import Path from logging import getLogger, Logger from fileinput import hook_compressed from dataclasses import dataclass, field, fields from typing import Iterator, get_type_hints, Generator import numpy as np import numpy.typing as npt from pysam import Tabix...
2.53125
3
mindhome_alpha/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py
Mindhome/field_service
1
12785242
<filename>mindhome_alpha/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.py # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import calendar import frappe from ...
1.890625
2
hard-gists/a1178bf10729a27184b1/snippet.py
jjhenkel/dockerizeme
21
12785243
<filename>hard-gists/a1178bf10729a27184b1/snippet.py #!/usr/bin/env python # -*- coding: utf-8 # # murmurCollectd.py - "murmur stats (User/Bans/Uptime/Channels)" script for collectd # Copyright (c) 2015, Nils / <EMAIL> # # munin-murmur.py - "murmur stats (User/Bans/Uptime/Channels)" script for munin. # Copyright (c) 20...
1.210938
1
pyble/const/characteristic/date_time.py
bgromov/PyBLEWrapper
14
12785244
<reponame>bgromov/PyBLEWrapper NAME="Date Time" UUID=0x2A08
1.125
1
2016/day1-alt.py
bloy/adventofcode
0
12785245
#!/usr/bin/env python from __future__ import unicode_literals def solve1(instructions): def step(state, instruction): position = state[0] direction = state[1] turn = complex(0, 1) if instruction[0] == 'L' else complex(0, -1) direction = direction * turn position = position ...
3.5625
4
scripts/visualize/match.py
facebookresearch/banmo
201
12785246
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # TODO: pass ft_cse to use fine-tuned feature # TODO: pass fine_steps -1 to use fine samples from absl import flags, app import sys sys.path.insert(0,'') sys.path.insert(0,'third_party') import numpy as np from matplotlib import pyplot as plt impor...
1.421875
1
caption/models/__init__.py
Unbabel/caption
3
12785247
# -*- coding: utf-8 -*- import logging import pytorch_lightning as ptl import pandas as pd import os from .taggers import TransformerTagger from .language_models import MaskedLanguageModel str2model = { "TransformerTagger": TransformerTagger, "MaskedLanguageModel": MaskedLanguageModel, } def build_model(hp...
2.5625
3
extras/api/urls.py
maznu/peering-manager
127
12785248
from peering_manager.api import OrderedDefaultRouter from . import views router = OrderedDefaultRouter() router.APIRootView = views.ExtrasRootView router.register("ix-api", views.IXAPIViewSet) router.register("job-results", views.JobResultViewSet) router.register("webhooks", views.WebhookViewSet) app_name = "extras...
1.632813
2
HM0_tiFire/tiFire.py
PsycoTodd/TaichiJourney
0
12785249
<reponame>PsycoTodd/TaichiJourney import taichi as ti import math # ti.init(debug=True, arch=ti.cpu) ti.init(arch=ti.opengl) def vec(*xs): return ti.Vector(list(xs)) def mix(x, y, a): return x * (1.0 - a) + y * a GUI_TITLE = "Fire" w, h = wh = (640, 480) # GUI size pixels = ti.Vector(3, dt=ti.f32, shape=wh) i...
2.21875
2
hyaline/errors/MessageErrors.py
5elenay/hyaline
11
12785250
<reponame>5elenay/hyaline class EditMessageFailed(Exception): """Raises when editing the message is failed.""" pass class DeleteMessageFailed(Exception): """Raises when deleting the message is failed.""" pass class BulkDeleteMessageFailed(Exception): """Raises when bulk-delete the messages is ...
2.375
2