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
minotaur/_mask.py
trel/minotaur
0
31000
<reponame>trel/minotaur from enum import IntFlag as _IntFlag from . import _inotify __all__ = ('Mask',) class Mask(_IntFlag): show_help: bool def __new__(cls, value, doc=None, show_help=True): # int.__new__ needs a stub in the typeshed # https://github.com/python/typeshed/issues/2686 ...
2.3125
2
24_immune_system_simulator.py
KanegaeGabriel/advent-of-code-2018
0
31001
<reponame>KanegaeGabriel/advent-of-code-2018 ################################################ # --- Day 24: Immune System Simulator 20XX --- # ################################################ import AOCUtils def getTargets(atkArmy, defArmy): targeted = set() for atkGroup in atkArmy: if len(targeted) <...
2.5
2
tasks.py
Egor4ik325/experiment-bot
0
31002
<gh_stars>0 from io import BytesIO import requests from celery import Celery from api import send_message, send_photo from imdb2_api import get_movie_by_imdb_id from imdb_api import IMDBAPIClient # celery -A tasks worker --log-level INFO app = Celery( "tasks", backend="redis://localhost:6379/0", broker="redis://...
2.59375
3
Imap_append.py
satheesheppalapelli/imap
0
31003
import imaplib import email from email import message import time username = 'gmail_id' password = '<PASSWORD>' new_message = email.message.Message() new_message.set_unixfrom('satheesh') new_message['Subject'] = 'Sample Message' # from gmail id new_message['From'] = '<EMAIL>' # to gmail id new_message['To'] = '<EMAI...
3.171875
3
autoflow/workflow/components/classification/lda.py
auto-flow/autoflow
49
31004
<filename>autoflow/workflow/components/classification/lda.py from copy import deepcopy from typing import Dict from autoflow.workflow.components.classification_base import AutoFlowClassificationAlgorithm __all__=["LinearDiscriminantAnalysis"] class LinearDiscriminantAnalysis(AutoFlowClassificationAlgorithm): cla...
1.382813
1
wradlib/georef/misc.py
ElmerJeanpierreLopez/wradlib
0
31005
<reponame>ElmerJeanpierreLopez/wradlib #!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2011-2019, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. """ Miscellaneous ^^^^^^^^^^^^^ .. autosummary:: :nosignatures: :toctree: generated/ bin_altitude bin_dis...
3.28125
3
notebooks/models/dnn.py
AFAgarap/dnn-trust
4
31006
<reponame>AFAgarap/dnn-trust # Copyright 2019-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 required by applicable ...
2.453125
2
2D CNN/eval2dcnn.py
sarosijbose/A-Fusion-architecture-for-Human-Activity-Recognition
0
31007
import numpy as np import tensorflow as tf from tensorflow import keras from keras.applications.xception import Xception import h5py import json import cv2 import math import logging from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.xception import preprocess_input, decode_pr...
2.328125
2
tests/test_redis.py
arrrlo/python-transfer
0
31008
<filename>tests/test_redis.py import os import pytest import fakeredis from db_transfer.adapter_redis import Redis from db_transfer.transfer import Transfer, sent_env @pytest.fixture() def fake_redis(monkeypatch): fake_redis = lambda *args, **kwargs: fakeredis.FakeStrictRedis(decode_responses=True) monkeypat...
2.15625
2
tests/python-reference/bool/bool-isinstance.py
jpolitz/lambda-py-paper
25
31009
<gh_stars>10-100 ___assertIs(isinstance(True, bool), True) ___assertIs(isinstance(False, bool), True) ___assertIs(isinstance(True, int), True) ___assertIs(isinstance(False, int), True) ___assertIs(isinstance(1, bool), False) ___assertIs(isinstance(0, bool), False)
1.492188
1
sql_controller/crud.py
hp5441/chatbottest
0
31010
<reponame>hp5441/chatbottest from pydantic.types import Json import json from sqlalchemy.orm import Session from sqlalchemy import desc from . import models, schemas def get_questions(db: Session, skip: int = 0, limit: int = 100): return db.query(models.Question).offset(skip).all() def get_top_questions(db: Ses...
2.578125
3
consult/api.py
project-sabai/Sabai-Backend
0
31011
from django.contrib.auth.models import User from django.core import serializers from django.core.exceptions import ObjectDoesNotExist from django.db import DataError from django.http import JsonResponse, HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view fr...
1.960938
2
tgficbot/main.py
ufoptg/telegram-find-in-channel-bot
1
31012
<reponame>ufoptg/telegram-find-in-channel-bot<filename>tgficbot/main.py from telethon import TelegramClient from telethon.events import NewMessage, CallbackQuery, MessageEdited from telethon.events import StopPropagation from telethon.tl import types, functions from telethon.tl.custom import Button from telethon.errors...
2.234375
2
onadata/apps/fsforms/rceivers.py
awemulya/fieldsight-kobocat
38
31013
# from django.db.models.signals import post_save # from django.dispatch import receiver # from onadata.apps.logger.models import XForm # # from onadata.apps.fsforms.models import FieldSightXF # # # @receiver(post_save, sender=XForm) # def save_to_fieldsight_form(sender, instance, **kwargs): # FieldSightXF.objects.c...
1.765625
2
highlander/api/controllers/resource.py
StephenTao/stephen
1
31014
# -*- coding: utf-8 -*- # # Copyright 2013 - Mirantis, 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 requir...
2.140625
2
LoadContracts.py
DZahar0v/DeployCheck
1
31015
import json import requests import os import subprocess import platform HTTP = requests.session() class ClientException(Exception): message = 'unhandled error' def __init__(self, message=None): if message is not None: self.message = message def getURL(address): url = "https://api.e...
2.796875
3
oci/config.py
bennyz/oci
0
31016
<gh_stars>0 from collections import namedtuple import os from six.moves import configparser DEFAULT_CONFIG = { ('jenkins', 'host', 'jenkins.ovirt.org'), ('gerrit', 'host', 'gerrit.ovirt.org')} Jenkins = namedtuple('jenkins', 'host, user_id, api_token') Gerrit = namedtuple('gerrit', 'host') Config = namedtuple...
2.265625
2
config/site_setting.py
tiantaozhang/site-basics
1
31017
<gh_stars>1-10 import os from datetime import timedelta UPLOAD_FOLDER = '' ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) MAX_CONTENT_LENGTH = 16 * 1024 * 1024 class Config: ROOT_PATH = os.path.abspath('.') LOG_PATH = ROOT_PATH + '/logs' APP_LOG_FILE = ROOT_PATH + '/logs/admin.l...
1.9375
2
atlas/aws_utils/src/test/test_aws_bucket.py
DeepLearnI/atlas
296
31018
<filename>atlas/aws_utils/src/test/test_aws_bucket.py import unittest from mock import Mock from foundations_spec import * from foundations_aws.aws_bucket import AWSBucket class TestAWSBucket(Spec): class MockListing(object): def __init__(self, bucket, files): self._bucket = bucket ...
2.65625
3
psychrochartmaker/remote.py
azogue/psychrocam
4
31019
<reponame>azogue/psychrocam<gh_stars>1-10 """ Support for an interface to work with a remote instance of Home Assistant. If a connection error occurs while communicating with the API a HomeAssistantError will be raised. For more details about the Python API, please refer to the documentation at https://home-assistant...
2.046875
2
CIM14/ENTSOE/Dynamics/IEC61970/Dynamics/PowerSystemStabilizers/PowerSystemStabilizersPssIEEE2B.py
MaximeBaudette/PyCIM
58
31020
# Copyright (C) 2010-2011 <NAME> # # 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, distrib...
1.476563
1
molecular_computation/procedures/gel_electrophoresis.py
shakedmanes/molecular-computation
0
31021
from molecules.dna_molecule import DNAMolecule from molecules.dna_sequence import DNASequence class GelElectrophoresis: """ Produce the Gel Electrophoresis procedure to sort DNA molecules by their size. """ @staticmethod def run_gel(dna_molecules): """ Runs the Gel Electrophoresis...
3.5
4
stocks/__init__.py
jianyex/stocks
0
31022
<filename>stocks/__init__.py # -*- coding: utf-8 -*- """Top-level package for stocks.""" __author__ = """<NAME>""" __email__ = '<EMAIL>' __version__ = '0.1.0'
1.085938
1
2021/11/__init__.py
cascandaliato/Advent-of-Code
0
31023
<gh_stars>0 from itertools import product from pyutils import * def parse(lines): return [ints(line) for line in lines] def neighbors(r, c, d): return ((r+dr, c+dc) for dr in [-1, 0, 1] for dc in [-1, 0, 1] if (dc != 0 or dr != 0) and 0 <= r+dr < d and 0 <= c+dc < d) def update_and_store(gri...
3.03125
3
test/test_02_expressions.py
jmeppley/py-metagenomics
7
31024
from edl.expressions import * def test_accession_re(): with open('test/data/sample.1.blastx.b50.m8') as F: try: for line in F: acc = accessionRE.search(line).group(1) except AttributeError: # There should have been a match in every line of this file ...
2.4375
2
.leetcode/230.kth-smallest-element-in-a-bst.py
KuiyuanFu/PythonLeetCode
0
31025
<gh_stars>0 # @lc app=leetcode id=230 lang=python3 # # [230] Kth Smallest Element in a BST # # https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ # # algorithms # Medium (63.45%) # Likes: 4133 # Dislikes: 90 # Total Accepted: 558.7K # Total Submissions: 876.8K # Testcase Example: '[3,1,4,nu...
3.6875
4
python/solutions/kyu6_replace_with_alphabet_position.py
StefanAvra/codewars-katas
0
31026
""" Replace With Alphabet Position Welcome. In this kata you are required to, given a string, replace every letter with its position in the alphabet. If anything in the text isn't a letter, ignore it and don't return it. "a" = 1, "b" = 2, etc. Example alphabet_position("The sunset sets at twelve o' clock.") Should...
4.25
4
pykafka/test/utils.py
Instamojo/pykafka
1,174
31027
import time import os from pykafka.test.kafka_instance import KafkaInstance, KafkaConnection def get_cluster(): """Gets a Kafka cluster for testing, using one already running is possible. An already-running cluster is determined by environment variables: BROKERS, ZOOKEEPER, KAFKA_BIN. This is used prim...
2.96875
3
vca_cli/print_utils.py
KohliRocks/vca-cli-iot
0
31028
<gh_stars>0 # Copyright (c) 2015 VMware. All rights reserved import prettytable import six import sys from oslo_utils import encodeutils def _print(pt, order): if sys.version_info >= (3, 0): print(pt.get_string(sortby=order)) else: print(encodeutils.safe_encode(pt.get_string(sortby=order))) ...
2.5625
3
references/web/test.py
flystarhe/cvtk
1
31029
<gh_stars>1-10 # python test.py 500 /workspace/images/test.png 7000 import sys import time import requests args = sys.argv[1:] command = " ".join(args) times = int(args[0]) data = {"image": [args[1]] * 2} url = f"http://localhost:{args[2]}/predict" headers = {"content-type": "application/x-www-form-urlencoded"} o...
2.640625
3
api/app/core/config.py
logan-connolly/aita
4
31030
<filename>api/app/core/config.py from typing import List from pydantic import BaseSettings class ApiConfig(BaseSettings): title: str = "AITA" version: str = "/api/v1" openapi: str = "/api/v1/openapi.json" class PostgresConfig(BaseSettings): user: str password: str host: str db: str ...
2.484375
2
src/sniffmypacketsv2/transforms/common/protocols/sip.py
SneakersInc/sniffmypacketsv2
11
31031
import base64 from scapy.layers.inet import * from scapy.layers.dns import * import dissector class SIPStartField(StrField): """ field class for handling sip start field @attention: it inherets StrField from Scapy library """ holds_packets = 1 name = "SIPStartField" def getfield(self, pk...
2.78125
3
starfish/image/_segmentation/__init__.py
ttung/starfish
0
31032
<gh_stars>0 from starfish.pipeline import import_all_submodules from ._base import Segmentation import_all_submodules(__file__, __package__)
1.046875
1
scanpy/tools/paga.py
LuckyMD/scanpy
0
31033
from collections import namedtuple import numpy as np import scipy as sp from scipy.sparse.csgraph import minimum_spanning_tree from .. import logging as logg from ..neighbors import Neighbors from .. import utils from .. import settings def paga( adata, groups='louvain', use_rna_velocity=Fals...
2.40625
2
sporting_webapp/nfl_package/migrations/0002_auto_20190807_1445.py
plopez9/chipy_sports_app_2.0
0
31034
<reponame>plopez9/chipy_sports_app_2.0<filename>sporting_webapp/nfl_package/migrations/0002_auto_20190807_1445.py<gh_stars>0 # Generated by Django 2.1.7 on 2019-08-07 19:45 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('nfl_package', '0001_initial'), ] ...
1.695313
2
tests/test_player_PlayerList.py
basbloemsaat/dartsense
0
31035
#!/usr/bin/env python3 import os import pytest import sys sys.path.append(os.path.join(os.path.dirname(__file__), "../lib")) import dartsense.player player_list = None def test_player_list_init(setup_db): player_list = dartsense.player.PlayerList() assert isinstance(player_list, dartsense.player.Player...
2.296875
2
tests/test_edit_first_contact.py
ksemish/KseniyaRepository
0
31036
from models.contact import Contacts import random def test_edit_some_contact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contacts.create_contact(Contacts(lastname="LastNameUser", firstname="<NAME>")) old_contacts = db.get_contact_list() randomcontact = random.choice(old_contacts) ...
2.609375
3
examples/pcd8544_pillow_demo.py
sommersoft/Adafruit_CircuitPython_PCD8544
0
31037
""" This demo will fill the screen with white, draw a black box on top and then print Hello World! in the center of the display This example is for use on (Linux) computers that are using CPython with Adafruit Blinka to support CircuitPython libraries. CircuitPython does not support PIL/pillow (python imaging library)...
4.03125
4
dummypy/packageA/__init__.py
brett-hosking/dummypy
0
31038
# Nested package modules from . import Atest __packageAname__ = 'packageA'
1.203125
1
src/waldur_core/media/tests/test_utils.py
geant-multicloud/MCMS-mastermind
26
31039
<gh_stars>10-100 from freezegun import freeze_time from rest_framework import test from rest_framework.exceptions import ValidationError from waldur_core.core.tests.helpers import override_waldur_core_settings from waldur_core.media.utils import decode_attachment_token, encode_attachment_token from waldur_core.structu...
2.125
2
main.py
Salonee-Jain/Eden
9
31040
from pygame import mixer import speech_recognition as sr import pyttsx3 import pyjokes import boto3 import pyglet import winsound import datetime import pywhatkit import datetime import time import os from PIL import Image import random import wikipedia import smtplib, ssl from mutagen.mp3 import MP3 import requests, ...
2.703125
3
tests/test_renderers/test_fixtures_docutils.py
ExecutableBookProject/myst_parser
9
31041
"""Test fixture files, using the ``DocutilsRenderer``. Note, the output AST is before any transforms are applied. """ import shlex from io import StringIO from pathlib import Path import pytest from docutils.core import Publisher, publish_doctree from myst_parser.parsers.docutils_ import Parser FIXTURE_PATH = Path(...
2.03125
2
readthedocs/settings/environment.py
optimizely/readthedocs.org
0
31042
import os import json from .base import CommunityBaseSettings class EnvironmentSettings(CommunityBaseSettings): """Settings for local development""" DEBUG = os.environ.get('DEBUG') == 'true' ALLOW_PRIVATE_REPOS = os.environ['ALLOW_PRIVATE_REPOS'] == 'true' PRODUCTION_DOMAIN = os.environ['PROD_HOST'...
1.867188
2
jobs/tests.py
dukedbgroup/BayesianTuner
13
31043
<gh_stars>10-100 from unittest import TestCase from logger import get_logger from config import get_config from .runner import JobsRunner logger = get_logger(__name__, log_level=("TEST", "LOGLEVEL")) config = get_config() def test_run(self, config, job_config, date): print("Running test job") class JobRunnerTes...
2.53125
3
wekaScript.py
sebas1208/sentiment-analizer-bi
0
31044
import weka.core.jvm as jvm jvm.start() from weka.core.converters import Loader, Saver loader = Loader(classname="weka.core.converters.ArffLoader") data = loader.load_file("./Listas/train.arff") print data jvm.stop()
2.34375
2
underscore/declaration.py
doboy/Underscore
7
31045
<gh_stars>1-10 # Copyright (c) 2013 <NAME>, http://huan.do class Declaration(object): def __init__(self, name): self.name = name self.delete = False self._conditional = None @property def conditional(self): assert self._conditional is not None return self.delete or ...
3.203125
3
mlcomp/contrib/model/video/resnext3d/r2plus1_util.py
megachester/mlcomp
166
31046
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import torch.nn as nn def r2plus1_unit( dim_in, dim_out, t...
2.609375
3
camara_con_kivy.py
Rocha117/Laboratorio_07
0
31047
<reponame>Rocha117/Laboratorio_07<filename>camara_con_kivy.py<gh_stars>0 from kivy.app import App from kivy.uix.boxlayout import BoxLayout class CamaraWindow(BoxLayout): def __init__(self, **kwargs): super().__init__(**kwargs) class CamaraApp(App): def build(self): return CamaraWind...
2.1875
2
test/test_record_count_use_case_interactor.py
takeoverjp/tsdraw
0
31048
import unittest from datetime import datetime, timezone from src.entity.count_entity import CountEntity from src.interface_adapter.in_memory_count_repository import \ InMemoryCountRepository from src.use_case.record_count_input_data import RecordCountInputData from src.use_case.record_count_use_case_interactor imp...
2.546875
3
net/gan/loss/__init__.py
bacTlink/caffe_tmpname
2
31049
all = ['GeneratorLoss', 'ClassfierLoss'] from generator import GeneratorLoss from classfier import ClassfierLoss
1.195313
1
Curso-em-video-Python3-mundo2/ex070.py
bernardombraga/Solucoes-exercicios-cursos-gratuitos
0
31050
line = '-' * 30 print(line) print('{:^30}'.format('LOJA SUPER BARATÃO')) print(line) total = more1000 = 0 productMaisBarato = '' priceMaisBarato = 0 primeiraVez = True while True: name = str(input('Nome do produto: ')) price = float(input('Preço: R$')) moreProducts = ' ' while moreProducts not in 'SN': ...
3.59375
4
dockernd/python/ND/NostalgiaDrive/setup.py
mchellmer/DockerMongoFceuxPython
0
31051
from setuptools import setup setup( name='nd', py_modules=['nd'], version='1.0.0', description='user friendly emulation game selection', license="MIT", author='<NAME>', author_email='<EMAIL>', install_requires=['tkinter', 'nltk', 'pymongo'], scripts=[] )
1.148438
1
migrations/versions/f83defd9c5ed_add_class_of_delete.py
Nyirabazungu/blog-app
0
31052
"""add class of delete Revision ID: <PASSWORD> Revises: <PASSWORD> Create Date: 2019-03-04 17:50:54.573744 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def upgrade(): # ##...
1.0625
1
BioSTEAM 2.x.x/biorefineries/oilcane/_uncertainty_plots.py
yoelcortes/Bioindustrial-Complex
2
31053
# -*- coding: utf-8 -*- """ Created on Fri Nov 5 01:34:00 2021 @author: yrc2 """ import biosteam as bst import biorefineries.oilcane as oc from biosteam.utils import CABBI_colors, colors from thermosteam.utils import set_figure_size, set_font, roundsigfigs from thermosteam.units_of_measure import format_units from co...
1.570313
2
custom_components/yoosee/const.py
shaonianzhentan/ha_yoosee_camera
0
31054
DOMAIN = "yoosee" PLATFORMS = ["camera"] DEFAULT_NAME = "Yoosee摄像头" VERSION = "1.1" SERVICE_PTZ = 'ptz'
1.125
1
generate_data.py
StanfordASL/Adaptive-Control-Oriented-Meta-Learning
24
31055
""" TODO description. Author: <NAME> Autonomous Systems Lab (ASL), Stanford (GitHub: spenrich) """ if __name__ == "__main__": import pickle import jax import jax.numpy as jnp from jax.experimental.ode import odeint from utils import spline, random_ragged_spline from dynamics im...
2.15625
2
backend/model/views.py
princesinghtomar/BTP
0
31056
<filename>backend/model/views.py from django.shortcuts import render from django.views.decorators.csrf import csrf_exempt from rest_framework.parsers import JSONParser from django.http.response import JsonResponse import base64 from numpy import random # Create your views here. @csrf_exempt def algo(req): if req.m...
2.21875
2
scvi/data/anndata/_constants.py
Semih-Kurt/scvi-tools
0
31057
from typing import NamedTuple # scVI Manager Store Constants # ---------------------------- # Keys for UUIDs used for referencing model class manager stores. _SCVI_UUID_KEY = "_scvi_uuid" _SOURCE_SCVI_UUID_KEY = "_source_scvi_uuid" # scVI Registry Constants # ----------------------- # Keys used in the scVI registry....
2.03125
2
hummingbot/connector/derivative/dydx_perpetual/dydx_perpetual_utils.py
coreydemarse/hummingbot
11
31058
<reponame>coreydemarse/hummingbot from hummingbot.client.config.config_var import ConfigVar from hummingbot.client.config.config_methods import using_exchange CENTRALIZED = True EXAMPLE_PAIR = "BTC-USD" DEFAULT_FEES = [0.05, 0.2] KEYS = { "dydx_perpetual_api_key": ConfigVar(key="dydx_perpetual_api_k...
2.1875
2
sodp/reports/migrations/0017_auto_20210728_2110.py
ElHombreMorado8/sodp
0
31059
# Generated by Django 3.1.12 on 2021-07-28 21:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('reports', '0016_auto_20210727_2156'), ] operations = [ migrations.AddIndex( model_name='report', index=models.Index...
1.601563
2
mfsapiapp/apps.py
lupamo3/django-points
0
31060
from django.apps import AppConfig class MfsapiappConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'mfsapiapp'
1.117188
1
pkg/msgapi/mqtt/models/mqmsg.py
ToraNova/rapidflask
0
31061
#-------------------------------------------------- # mqtt_control.py # MQTT_Control is a database model to control subscriptions # and publications # introduced in u8 # ToraNova #-------------------------------------------------- from pkg.resrc import res_import as r from pkg.system.database import dbms Base = dbms.m...
2.25
2
Raspberry_Pi_Animated_Gif_Player/code.py
albinger/Adafruit_Learning_System_Guides
0
31062
# SPDX-FileCopyrightText: 2021 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT import usb_cdc import rotaryio import board import digitalio serial = usb_cdc.data encoder = rotaryio.IncrementalEncoder(board.ROTA, board.ROTB) button = digitalio.DigitalInOut(board.SWITCH) button.switch_to_input(pull=digi...
2.828125
3
test.py
bing1100/DeepLabV3Plus-Pytorch
0
31063
<gh_stars>0 import fiona import rasterio import rasterio.plot import matplotlib as mpl import matplotlib.pyplot from descartes import PolygonPatch from shapely.geometry import LineString import numpy as np import sys from multiprocessing import Pool np.set_printoptions(threshold=np.inf) import matplotlib.pyplot as plt ...
2.09375
2
alveus/models/LayeredModel.py
levifussell/Alveus
2
31064
import numpy as np from ..layers.Layer import LayerTrainable class LayeredModel(object): def __init__(self, layers): """ layers : a list of layers. Treated as a feed-forward model """ assert len(layers) > 0, "Model layers must be non-empty" # check that the output of ...
3.1875
3
sandbox/02_v4l2_common_feed_pipes.py
Zalewa/voyandz
0
31065
#!/usr/bin/env python3 from flask import Flask, send_file, make_response, Response, g, request, stream_with_context from io import BytesIO import atexit import errno import os import subprocess import threading INPUT = '/dev/video0' FFMPEG = "/home/test/ffmpeg-nvenc/ffmpeg" app = Flask(__name__) @app.route('/pic') ...
2.390625
2
code-ch02/test_ne.py
kcalvinalvin/editedProgrammingBitcoin
0
31066
from unittest import TestCase from eccCh02 import Point class PointTest(TestCase): def test_ne(self): a = Point(x=3, y=-7, a=5, b=7) b = Point(x=18, y=77, a=5, b=7) self.assertTrue(a != b) self.assertFalse(a != a)
3.5
4
test/regression/features/imports/fromImport.py
ppelleti/berp
90
31067
<filename>test/regression/features/imports/fromImport.py<gh_stars>10-100 from DefinesX import x print(x)
1.070313
1
src/dht11.py
Brumawen/temperature
0
31068
<filename>src/dht11.py import Adafruit_DHT humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 17) if humidity is not None and temperature is not None: print(str(temperature) + "," + str(humidity)) else: print('-1,-1')
2.921875
3
utils/losses/hybird.py
wufanyou/WRL-Agriculture-Vision
5
31069
<reponame>wufanyou/WRL-Agriculture-Vision import torch.nn as nn from torch import Tensor from typing import Optional from .lovasz_loss import CustomizeLovaszLoss, LovaszLoss from .binary_cross_entropy import ( MaskBinaryCrossEntropyIgnoreIndex, MaskBinaryCrossEntropy, ) from .dice_loss import CustomizeDiceLoss ...
2
2
apollo/embeds/__init__.py
rpetti/apollo
0
31070
from .about_embed import AboutEmbed from .event_embed import EventEmbed from .help_embed import HelpEmbed from .select_channel_embed import SelectChannelEmbed from .start_time_embed import StartTimeEmbed from .time_zone_embed import TimeZoneEmbed
1.164063
1
sapai/foods.py
clsandoval/sapai
0
31071
#%% import numpy as np from sapai.data import data from sapai.rand import MockRandomState #%% class Food(): def __init__(self, name="food-none", shop=None, team=[], seed_state = None): """ Food class definition the types of ...
2.984375
3
git_lint_branch/single/__init__.py
juped/git-lint-branch
2
31072
<reponame>juped/git-lint-branch<filename>git_lint_branch/single/__init__.py from pygit2 import Commit from git_lint_branch.linter_output import * from git_lint_branch.single.example_linter import * from git_lint_branch.single.regex_linter import * from git_lint_branch.single.diff_size_linter import diff_size_linter fro...
1.570313
2
src/pyNonin/pynonin/__init__.py
Hammit/wais-pop
1
31073
""" pyNonin package initalization file (c) <NAME> 2013 <EMAIL> Permission granted for experimental and personal use; license for commercial sale available from the author. """ #Import main Device base class from pynonin.packet import Packet
1.414063
1
ltcl/modules/birnn.py
anonymous-authors-iclr2022-481/ltcl
8
31074
<reponame>anonymous-authors-iclr2022-481/ltcl<gh_stars>1-10 # Require: input_dim, z_dim, hidden_dim, lag # Input: {f_i}_i=1^T: [BS, len=T, dim=8] # Output: {z_i}_i=1^T: [BS, len=T, dim=8] # Bidirectional GRU/LSTM (1 layer) # Sequential sampling & reparameterization import pyro import torch import ipdb as pdb import nu...
2.125
2
examples/kalman/gnss_kf.py
karlamnordstrom/laika3
3
31075
<filename>examples/kalman/gnss_kf.py #!/usr/bin/env python import numpy as np from kalman_helpers import ObservationKind from ekf_sym import EKF_sym from laika.raw_gnss import GNSSMeasurement def parse_prr(m): sat_pos_vel_i = np.concatenate((m[GNSSMeasurement.SAT_POS], m[GNSSMeasur...
2.625
3
lib/googlecloudsdk/api_lib/dataproc/poller/batch_poller.py
google-cloud-sdk-unofficial/google-cloud-sdk
2
31076
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
1.8125
2
3.1 Prim Minimum Spanning Tree using Brute Force.py
INOS-soft/MOmmentum-SECList
0
31077
<filename>3.1 Prim Minimum Spanning Tree using Brute Force.py<gh_stars>0 """ 3.Question 3 In this programming problem you'll code up Prim's minimum spanning tree algorithm. This file (edges.txt) describes an undirected graph with integer edge costs. It has the format [number_of_nodes] [number_of_edges] [one_...
3.875
4
base/vulcan_management/vulcan_agent.py
PeterStuck/teacher-app
0
31078
<reponame>PeterStuck/teacher-app from time import sleep from selenium.common.exceptions import NoSuchElementException from .vulcan_webdriver import VulcanWebdriver class VulcanAgent: """ Class to perform actions on Vulcan Uonet page """ def __init__(self, credentials: dict, vulcan_data = None): sel...
2.8125
3
shmeppytools/imageconverter/progress_bar.py
essarrjay/ShmeppyImagetoJSON
4
31079
<gh_stars>1-10 import sys def progress_bar(it, prefix="", suffix="", width=60, file=sys.stdout): """An iterable-like obj for command line progress_bar Usage: for i in progress_bar(range(15), "Processing: ", "Part ", 40): <some long running calculation> Processing: [#########################...
3.234375
3
squarespiral.py
lstoomet/peeterscript
0
31080
#!/usr/bin/env python3 import turtle t = turtle.Pen() for x in range(400): t.forward(x) t.left(90) input("press enter to exit")
3.828125
4
gitlab/tests/common.py
tanner-bruce/integrations-core
0
31081
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os from datadog_checks.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) # Networking HOST = get_docker_hostname() GITLAB_TEST_PASSWORD = "<PASSWORD>" GI...
1.875
2
src/hyde/algorithm/analysis/satellite/hsaf/lib_ascat_analysis.py
c-hydro/hyde
0
31082
<gh_stars>0 # ------------------------------------------------------------------------------------- # Library import tempfile import rasterio import numpy as np from os import remove from os.path import join, exists from scipy.interpolate import griddata from src.hyde.algorithm.utils.satellite.hsaf.lib_ascat_generic ...
2.375
2
Dataset/Leetcode/valid/6/243.py
kkcookies99/UAST
0
31083
<filename>Dataset/Leetcode/valid/6/243.py class Solution(object): def XXX(self, s, numRows): if numRows==1: return s res = ['' for _ in range(numRows)] # 周期 T = numRows + numRows -2 for i in range(len(s)): t_num = i%T temp = t_num if t_num...
3.046875
3
projects/golem_e2e/tests/test_builder/add_action_to_teardown.py
kangchenwei/keyautotest2
0
31084
description = 'Verify the user can add an action to the teardown' pages = ['common', 'index', 'tests', 'test_builder'] def setup(data): common.access_golem(data.env.url, data.env.admin) index.create_access_project('test') common.navigate_menu('Tests') tests.create_access_ra...
1.820313
2
src/previous/scaterplot.py
miaoli-psy/Psychophysics_exps
0
31085
<reponame>miaoli-psy/Psychophysics_exps # -*- coding: utf-8 -*- """ Created on Fri Aug 23 19:43:56 2019 @author: MiaoLi """ #%% import sys, os import pandas as pd # import seaborn as sns # from shapely.geometry import Polygon, Point sys.path.append('C:\\Users\\MiaoLi\\Desktop\\SCALab\\Programming\\crowdingnumerosityg...
2.09375
2
gumtree_spider.py
JemLukeBingham/used_car_scraper
1
31086
<reponame>JemLukeBingham/used_car_scraper import scrapy from urllib.parse import urljoin from text_formatting import format_mileage, format_year, format_price class GumtreeSpider(scrapy.Spider): name = 'gumtree' base_url = 'https://www.gumtree.co.za/' start_urls = [ urljoin(base_url, 's-cars-bakkie...
2.921875
3
ehr_ml/extract.py
som-shahlab/ehr_ml
4
31087
from __future__ import annotations import argparse import bisect import os from .extension.extract import extract_omop def extract_omop_program() -> None: parser = argparse.ArgumentParser( description="An extraction tool for OMOP v5 sources" ) parser.add_argument( "omop_source", type=st...
2.34375
2
src/chains/migrations/0027_chain_description.py
tharsis/safe-config-service
8
31088
# Generated by Django 3.2.7 on 2021-09-16 12:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("chains", "0026_chain_l2"), ] operations = [ migrations.AddField( model_name="chain", name="description", ...
1.5
2
leases/services/invoice/berth.py
City-of-Helsinki/berth-reservations
3
31089
<reponame>City-of-Helsinki/berth-reservations from datetime import date from django.db.models import QuerySet from payments.enums import OrderStatus from payments.models import BerthProduct, Order from ...models import BerthLease from ...utils import calculate_season_end_date, calculate_season_start_date from .base ...
2.0625
2
scripts/addons/animation_nodes/nodes/boolean/compare.py
Tilapiatsu/blender-custom_conf
2
31090
import bpy from bpy.props import * from ... base_types import AnimationNode, DataTypeSelectorSocket compare_types = ["A = B", "A != B", "A < B", "A <= B", "A > B", "A >= B", "A is B","A is None"] compare_types_items = [(t, t, "") for t in compare_types] numericLabelTypes = ["Integer", "Float"] class CompareNode(bpy....
2.609375
3
main.py
bqia0/CycleGAN
0
31091
<gh_stars>0 import os import options import networks import utils from argparse import ArgumentParser def main(): args = options.get_args() cycleGAN = networks.CycleGAN(args) if args.train == args.test: print("What are we even doing here?") elif args.train: print("Training") ...
2.546875
3
memecrypt/utilities.py
Sh3llcod3/memecrypt
1
31092
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- try: import base64 import binascii import codecs import random except ImportError as import_fail: print(f"Import error: {import_fail}") print("Please install this module.") raise SystemExit(1) class utils(object): def enc...
2.40625
2
challenges/CNMP/poller/for-testing/machine.py
pingjuiliao/cb-multios
473
31093
<gh_stars>100-1000 #!/usr/bin/env python # # Copyright (C) 2014 Narf Industries <<EMAIL>> # # 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 #...
2.296875
2
S1/TP4/ex2.py
HerbeMalveillante/ecole
0
31094
<reponame>HerbeMalveillante/ecole import random def saisieSomme(): entree = None while entree not in range(2, 13): entree = int(input("Entrez un nombre entre 2 et 12 inclus : ")) return entree def sommeDeuxDes(): de1 = random.randint(1, 6) de2 = random.randint(1, 6) print("valeur d...
3.90625
4
Day4/rock.py
viditvarshney/100DaysOfCode
0
31095
import random import time print("\n\nWelcome..\n") time.sleep(2) print(''' _______ ---' ____) (_____) (_____) (____) ---.__(___) ''') print(''' _______ ---' ____)____ ______) _______) _______) ---.__________) ''') print(''' _______ ---' ____)____ ...
4.0625
4
django_request_context/middleware.py
schecterdamien/django-request-context
13
31096
# -*- coding: utf-8 -*- from .globals import request_context try: from django.utils.deprecation import MiddlewareMixin except ImportError: # Django < 1.10 MiddlewareMixin = object class RequestContextMiddleware(MiddlewareMixin): def process_request(self, request): request_context.init_by_reques...
1.9375
2
venv/Lib/site-packages/zmq/tests/test_win32_shim.py
ajayiagbebaku/NFL-Model
603
31097
<filename>venv/Lib/site-packages/zmq/tests/test_win32_shim.py<gh_stars>100-1000 from __future__ import print_function import os import time import sys from functools import wraps from pytest import mark from zmq.tests import BaseZMQTestCase from zmq.utils.win32 import allow_interrupt def count_calls(f): @wraps...
1.945313
2
examples/docs_snippets/docs_snippets_tests/concepts_tests/partitions_schedules_sensors_tests/test_schedules.py
Andrew-Crosby/dagster
0
31098
<reponame>Andrew-Crosby/dagster import pytest from dagster import ModeDefinition, build_schedule_context, pipeline, solid, validate_run_config from docs_snippets.concepts.partitions_schedules_sensors.schedules.schedule_examples import ( my_daily_schedule, my_hourly_schedule, my_modified_preset_schedule, ...
2.09375
2
apps/documents/api/v1/views.py
LopsanAMO/Despacho
0
31099
# -*- coding: utf-8 -*- import json from rest_framework import generics from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.parsers import MultiPartParser, FormParser from rest_framework_jwt.authentication import JSONWebTokenAuthentication from rest_framework.decora...
1.929688
2