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 |
|---|---|---|---|---|---|---|
python-crypt-service/services/dbservice.py | Shirish-Singh/crypt-analysis | 0 | 20300 | from __future__ import print_function
from configurations import configuration
from pymongo import MongoClient
MONGO_HOST= configuration.MONGO_HOST
client = MongoClient(MONGO_HOST)
class DBConnection():
def getConnection(self):
return client.analyticsDB
| 2.140625 | 2 |
simple_amqp_rpc/data.py | rudineirk/py-simple-amqp-rpc | 0 | 20301 | from typing import Any, List
from dataclasses import dataclass, replace
from .consts import OK
class Data:
def replace(self, **kwargs):
return replace(self, **kwargs)
@dataclass(frozen=True)
class RpcCall(Data):
route: str
service: str
method: str
args: List[Any]
@dataclass(frozen=Tr... | 2.75 | 3 |
fileparse/python/main.py | mlavergn/benchmarks | 0 | 20302 | #!/usr/bin/python
import timeit
setup = '''
import os
def FileTest(path):
file = open(path, "r")
lines = file.readlines()
data = [None for i in range(len(lines))]
i = 0
for line in lines:
data[i] = line.split(',')
j = 0
for field in data[i]:
data[i][j] = field.strip('\\'\\n')
j += 1
i += 1
re... | 2.625 | 3 |
boris/classification.py | fragaria/BorIS | 1 | 20303 | # -*- coding: utf-8 -*-
'''
Created on 25.9.2011
@author: xaralis
'''
from model_utils import Choices
SEXES = Choices(
(1, 'FEMALE', u'žena'),
(2, 'MALE', u'muž')
)
NATIONALITIES = Choices(
(1, 'CZ', u'Česká republika'),
(2, 'EU', u'Jiné - EU'),
(3, 'NON_EU', u'Jiné - non-EU'),
(4, 'UNKNOWN', ... | 2.046875 | 2 |
extern/face_expression/face_expression/dataset.py | wangxihao/rgbd-kinect-pose | 1 | 20304 | <filename>extern/face_expression/face_expression/dataset.py<gh_stars>1-10
import os
import sys
import json
import pickle
import h5py
from tqdm import tqdm
import numpy as np
import torch
import cv2
import scipy.spatial
import hydra
from face_expression import utils
from face_expression.third_party.face_mesh_mediapip... | 2.0625 | 2 |
session7/OLED_Clock.py | rezafari/raspberry | 0 | 20305 | ######################################################################
# OLED_Clock.py
#
# This program display date and time on OLED module
######################################################################
import Adafruit_SSD1306
from datetime import datetime
import time
from PIL import Image
from PIL impo... | 2.640625 | 3 |
odim/router.py | belda/odim | 5 | 20306 | '''
Contains the extended FastAPI router, for simplified CRUD from a model
'''
from typing import Any, List, Optional, Sequence, Set, Type, Union
import fastapi
from fastapi import Depends, params
from pydantic import BaseModel, create_model
from odim import Odim, OkResponse, SearchResponse
from odim.dependencies imp... | 2.640625 | 3 |
scripts/item/consume_2432803.py | Snewmy/swordie | 0 | 20307 | # Princess No Damage Skin (30-Days)
success = sm.addDamageSkin(2432803)
if success:
sm.chat("The Princess No Damage Skin (30-Days) has been added to your account's damage skin collection.")
| 1.265625 | 1 |
tests/test_product.py | technicapital/stake-python | 0 | 20308 | <filename>tests/test_product.py
import asyncio
import aiohttp
import pytest
from .client import HttpClient
from .constant import Url
from .product import Product
@pytest.mark.asyncio
async def test_show_portfolio(tracing_client):
return await tracing_client.equities.list()
@pytest.mark.asyncio
async def test_... | 2.5625 | 3 |
data_utils.py | tar-bin/DeepAA | 1 | 20309 | <gh_stars>1-10
import numpy as np
from PIL import Image, ImageOps
class BaseImage(object):
"""
変換元画像
"""
def __init__(self, path):
"""
元画像を読み込む
:param path:
:param array: np.ndarray
:param line_height: int
:return:
"""
image = Image.open(... | 2.8125 | 3 |
ledfx/color.py | broccoliboy/LedFx | 524 | 20310 | from collections import namedtuple
RGB = namedtuple("RGB", "red, green, blue")
COLORS = {
"red": RGB(255, 0, 0),
"orange-deep": RGB(255, 40, 0),
"orange": RGB(255, 120, 0),
"yellow": RGB(255, 200, 0),
"yellow-acid": RGB(160, 255, 0),
"green": RGB(0, 255, 0),
"green-forest": RGB(34, 139, 34... | 3.25 | 3 |
src/test/nspawn_test/support/header_test.py | Andrei-Pozolotin/nspawn | 15 | 20311 |
from nspawn.support.header import *
def test_header():
print()
head_dict = {
'etag':'some-hash',
'last-modified':'some-time',
'content-length':'some-size',
'nspawn-digest':'some-text',
}
assert head_dict[Header.etag] == 'some-hash'
assert head_dict[Header.last_modi... | 2.46875 | 2 |
game1.py | akulakov/learnprogramming | 0 | 20312 | #!/usr/bin/env python
from helpers import sjoin, cjoin
from random import shuffle
card_types = [
("tax",1,1), # tax everyone 2 coins => bank
("soldier",2,1),
("sergeant",3,1),
("captain",4,2),
("emperor",1,5),
("prince",1,1), #... | 3.625 | 4 |
src/plotting/plot_permeability.py | pgniewko/Deep-Rock | 1 | 20313 | <gh_stars>1-10
#! /usr/bin/env python
#
# Usage:
# python
#
import sys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="darkgrid")
data = np.loadtxt(sys.argv[1])
kappa_LB, kappa_CNN = data.T
kappa_LB = 10.0 ** kappa_LB
kappa_CNN = 10.0 ** kappa_CNN
fig, ax = plt.subplots(1, 1... | 2.375 | 2 |
functions/python/todo-app.py | swiftycloud/swifty.todoapp | 5 | 20314 | import bson
import json
import swifty
#
# GET /tasks -- list tasks
# POST /tasks $BODY -- add new task
# GET /tasks/ID -- get info about task
# PUT /tasks/ID -- update task (except status)
# DELETE /tasks/ID -- remove task
# POST /tasks/ID/done -- mark task as done
#
def toTask(o... | 2.25 | 2 |
dmoj/Uncategorized/tss17a.py | UserBlackBox/competitive-programming | 0 | 20315 | # https://dmoj.ca/problem/tss17a
# https://dmoj.ca/submission/2226280
import sys
n = int(sys.stdin.readline()[:-1])
for i in range(n):
instruction = sys.stdin.readline()[:-1].split()
printed = False
for j in range(3):
if instruction.count(instruction[j]) >= 2:
print(instruction[j])
... | 3.359375 | 3 |
todo/views/users_detail.py | josalhor/WebModels | 0 | 20316 | from todo.templatetags.todo_tags import is_management
from django.contrib.auth.decorators import login_required, user_passes_test
from django.http import HttpResponse
from django.shortcuts import render
from todo.models import Designer, Management, Writer, Editor
@login_required
@user_passes_test(is_management)
def u... | 2.171875 | 2 |
src/librhc/cost/__init__.py | arnavthareja/mushr_pixelart_mpc | 5 | 20317 | # Copyright (c) 2019, The Personal Robotics Lab, The MuSHR Team, The Contributors of MuSHR
# License: BSD 3-Clause. See LICENSE.md file in root directory.
from .waypoints import Waypoints
__all__ = ["Waypoints"]
| 0.988281 | 1 |
759/Employee Free Time.py | cccccccccccccc/Myleetcode | 0 | 20318 | <filename>759/Employee Free Time.py<gh_stars>0
from typing import List
import heapq
# Definition for an Interval.
class Interval:
def __init__(self, start: int = None, end: int = None):
self.start = start
self.end = end
class Solution:
def employeeFreeTime(self, schedule: '[[Interval]]') -> '[... | 3.015625 | 3 |
Comms1_internal/Final.py | CoderStellaJ/CG4002 | 0 | 20319 | from bluepy import btle
import concurrent
from concurrent import futures
import threading
import multiprocessing
import time
from time_sync import *
import eval_client
import dashBoardClient
from joblib import dump, load
import numpy # to count labels and store in dict
import operator # to get most predicted label
im... | 2.140625 | 2 |
tests/test_relations.py | OneRaynyDay/treeno | 1 | 20320 | <gh_stars>1-10
import unittest
from treeno.base import PrintMode, PrintOptions
from treeno.expression import Array, Field, wrap_literal
from treeno.orderby import OrderTerm, OrderType
from treeno.relation import (
AliasedRelation,
Lateral,
SampleType,
Table,
TableQuery,
TableSample,
Unnest,... | 2.4375 | 2 |
tests/preprocess/test_har.py | henry1jin/alohamora | 5 | 20321 | <reponame>henry1jin/alohamora<gh_stars>1-10
import random
from blaze.chrome.har import har_from_json, Har, HarLog, HarEntry, Request, Response
from blaze.config.environment import ResourceType
from blaze.preprocess.har import get_har_entry_type, har_entries_to_resources
from blaze.util.seq import ordered_uniq
from te... | 2.171875 | 2 |
Loader.py | JaredDobry/Budgeting-Fool | 0 | 20322 | <reponame>JaredDobry/Budgeting-Fool
from Budget import Budget, Item
FILENAME = 'Budget.txt'
def scrape_off_char(s, c):
out = ''
for ch in s:
if ch != c:
out += ch
return out
def load_budget():
try:
fr = open(FILENAME, 'r')
lines = fr.readlines()
... | 3.015625 | 3 |
rush_hour/test_solution.py | ssebastianj/taip-2014 | 0 | 20323 | <filename>rush_hour/test_solution.py
# -*- coding: utf-8 -*-
import unittest
import pytest
from .solution import calc_minimum_travels
class CalcMininumTravelsTestCase(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_calc_minimum_travels(self):
assert ... | 2.8125 | 3 |
wordle.py | ccattuto/wordle-device | 7 | 20324 | <reponame>ccattuto/wordle-device
#!/usr/bin/env python
import sys
from serial.tools import list_ports
import serial
import tweepy
# locate ESP32-C3 USB device
port = None
for device in list_ports.comports():
if device.vid == 0x303a and device.pid == 0x1001:
break
if not device:
sys.exit(-1)
ser = ser... | 2.921875 | 3 |
DeepAlignmentNetwork/menpofit/lk/result.py | chiawei-liu/DeepAlignmentNetwork | 220 | 20325 | from menpofit.result import (ParametricIterativeResult,
MultiScaleParametricIterativeResult)
class LucasKanadeAlgorithmResult(ParametricIterativeResult):
r"""
Class for storing the iterative result of a Lucas-Kanade Image Alignment
optimization algorithm.
Parameters
-... | 2.90625 | 3 |
source/model.py | BecauseWeCanStudios/LEGOVNO | 0 | 20326 | import os
import keras
import skimage.io
import keras_contrib.applications
from metrics import *
from mrcnn import utils
from mrcnn import config
from imgaug import augmenters as iaa
from dataset import Dataset, PoseEstimationDataset
import numpy as np
import keras.backend as K
import mrcnn.model as modellib
class Con... | 2.21875 | 2 |
donations/urls.py | nanorepublica/django-donations | 9 | 20327 | from django.conf.urls import include, url
from donations.views import DonateAPI, VerifyAPI
app_name = 'donations'
api_urls = ([
url(r'^donate/$', DonateAPI.as_view(), name="donate"),
url(r'^verify/(?P<pk>[0-9]+)$', VerifyAPI.as_view(), name="verify"),
], "donations")
donations = ([
url(r'^api/', include... | 1.875 | 2 |
orc8r/tools/fab/vagrant.py | idoshveki/magma | 2 | 20328 | <filename>orc8r/tools/fab/vagrant.py
"""
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
import os.path
from fabric.api import local
from fabric.api import env
def _... | 1.921875 | 2 |
cp_multiply/examples/make_box_packing_cp.py | gkonjevod/multiply_CP | 0 | 20329 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 19 23:38:25 2022
@author: goran
"""
from ..general_cp import GeneralCP
from ..cp_utils import to_degrees, dihedral_angle, normal
from math import sqrt, pi, tan, atan2
box_packing_cell_nodes = {'A': (2, 0),
'B': (4, 0),
... | 2.53125 | 3 |
kq/queue.py | grofers/kq | 0 | 20330 | <gh_stars>0
from __future__ import absolute_import, print_function, unicode_literals
import functools
import logging
import time
import uuid
import dill
import kafka
from kafka.errors import KafkaError
from kq.job import Job
class Queue(object):
"""KQ queue.
A queue serializes incoming function calls and ... | 2.734375 | 3 |
python/accel_adxl345/accel_adxl345.py | iorodeo/accel_adxl345 | 0 | 20331 | <reponame>iorodeo/accel_adxl345<filename>python/accel_adxl345/accel_adxl345.py
"""
accel_adxl345.py
This modules defines the AccelADXL345 class for streaming data from the
ADXL345 accelerometers.
"""
import time
import serial
import sys
import numpy
import struct
BUF_EMPTY_NUM = 5
BUF_EMPTY_DT = 0.05
class AccelADX... | 2.703125 | 3 |
polling_stations/apps/data_collection/management/commands/import_tower_hamlets.py | mtravis/UK-Polling-Stations | 0 | 20332 | from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "E09000030"
addresses_name = "local.2018-05-03/Version 2/Democracy_Club__03May2018.tsv"
stations_name = "local.2018-05-03/Version 2/Democracy_Club__03May2018.t... | 2.46875 | 2 |
pynaja/common/struct.py | xiaoxiamiya/naja | 1 | 20333 | <reponame>xiaoxiamiya/naja<gh_stars>1-10
import struct
from collections import OrderedDict
from configparser import RawConfigParser
from pynaja.common.async_base import Utils
from pynaja.common.error import ConstError
class Result(dict):
"""返回结果类
"""
def __init__(self, code=0, data=None, msg=None, detai... | 2.4375 | 2 |
YOLO/Stronger-yolo-pytorch/port2tf/yolov3.py | ForrestPi/ObjectDetection | 12 | 20334 | <reponame>ForrestPi/ObjectDetection
# coding:utf-8
import numpy as np
import tensorflow as tf
from layers import *
from MobilenetV2 import MobilenetV2,MobilenetV2_dynamic
class YOLOV3(object):
def __init__(self, training,numcls=20):
self.__training = training
self.__num_classes = numcls
se... | 2.34375 | 2 |
saltlint/rules/CmdWaitRecommendRule.py | Poulpatine/salt-lint | 0 | 20335 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Warpnet B.V.
import re
from saltlint.linter.rule import DeprecationRule
from saltlint.utils import LANGUAGE_SLS
class CmdWaitRecommendRule(DeprecationRule):
id = '213'
shortdesc = 'SaltStack recommends using cmd.run together with onchanges, rather than... | 2.1875 | 2 |
sdks/python/apache_beam/ml/inference/pytorch_test.py | hengfengli/beam | 0 | 20336 | <filename>sdks/python/apache_beam/ml/inference/pytorch_test.py
#
# 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 th... | 2.140625 | 2 |
example/test/L20_snake.py | Michael8968/skulpt | 2 | 20337 | <reponame>Michael8968/skulpt
import pygame
import sys
import time
import random
from pygame.locals import *
# Pygame Init
pygame.init()
# Play Surface
size = width, height = 800, 800
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Snake Change")
# Colors
red = (255, 0, 0)
green = (0, 255, 0)
black... | 2.875 | 3 |
readgadget/readrockstar.py | danielmarostica/pygadgetreader | 6 | 20338 | from .modules.common import *
import numpy as np
import os
from .modules.rs_structs import getRSformat
class RockstarFile(object):
def __init__(self,binfile,data,galaxies,debug):
self.galaxies = galaxies
self.binfile = binfile
self.debug = debug
self.header()
self.... | 2.34375 | 2 |
src/backend/preprocess/preprocess_helper.py | scmc/vch-mri | 1 | 20339 | import boto3
from datetime import datetime, date
import re
import string
import pandas as pd
from spellchecker import SpellChecker
import uuid
import psycopg2
from psycopg2 import sql
import sys
sys.path.append('.')
from rule_processing import postgresql
def queryTable(conn, table):
cmd = """
SELECT * FROM ... | 2.65625 | 3 |
script_example.py | op8867555/BGmi | 0 | 20340 | import datetime
from bgmi.script import ScriptBase
from bgmi.utils import parse_episode
class Script(ScriptBase):
class Model(ScriptBase.Model):
bangumi_name = "TEST_BANGUMI"
cover = ""
update_time = "Mon"
due_date = datetime.datetime(2017, 9, 30)
def get_download_url(self):
... | 2.453125 | 2 |
3. Python Advanced (September 2021)/3.1 Python Advanced (September 2021)/10. Exercise - Functions Advanced/11_fill_the_box.py | kzborisov/SoftUni | 1 | 20341 | from collections import deque
def fill_the_box(*args):
box_size = args[0] * args[1] * args[2]
args = deque(args[3:])
while args:
curr_arg = args.popleft()
if curr_arg == "Finish":
break
box_size -= curr_arg
if box_size < 0:
args.remove("Finish")
... | 3.75 | 4 |
src/the_tale/the_tale/common/utils/views.py | al-arz/the-tale | 0 | 20342 | <filename>src/the_tale/the_tale/common/utils/views.py<gh_stars>0
import smart_imports
smart_imports.all()
# for external code
ViewError = utils_exceptions.ViewError
class Context(object):
def __setattr__(self, name, value):
if hasattr(self, name):
raise ViewError(code='internal.try_to_reas... | 2.03125 | 2 |
NeoAnalysis_Py2.7/NeoAnalysis/__init__.py | Research-lab-KUMS/NeoAnalysis | 23 | 20343 | <filename>NeoAnalysis_Py2.7/NeoAnalysis/__init__.py
__version__ = '0.10.0'
from NeoAnalysis.spikedetection import SpikeDetection
from NeoAnalysis.spikesorting import SpikeSorting
from NeoAnalysis.analogfilter import AnalogFilter
from NeoAnalysis.graphics import Graphics
from NeoAnalysis.popuanalysis import PopuAnalysis... | 1.15625 | 1 |
people.py | sabek/Guess-who | 0 | 20344 | <reponame>sabek/Guess-who<gh_stars>0
class HiddenPeople():
"""Class for holding information on people"""
def __init__(self):
self.people = {
'Paul': {'bald': False, 'beard': False, 'eyes': 'brown', 'gender': 'man', 'hair': 'white', 'hat': False,
'glasses': True,... | 3.1875 | 3 |
paperplane/backends/click/choice.py | abhilash1in/paperplane | 0 | 20345 | <filename>paperplane/backends/click/choice.py
import click
from typing import Any, Optional
from paperplane.backends.click import _prompt
def run(prompt: str, choices: list, default: Optional[Any] = None):
return _prompt(text=prompt, default=default, type=click.Choice(choices=choices))
| 2.15625 | 2 |
lib/python/treadmill/api/nodeinfo.py | bretttegart/treadmill | 2 | 20346 | """Implementation of allocation API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from treadmill import discovery
from treadmill import context
_LOGGER = logging.getLogger(__name__)
class AP... | 2.328125 | 2 |
new/views.py | Sravan996/django | 0 | 20347 | from django.shortcuts import render
from django.shortcuts import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('Hello World</en>')
| 1.671875 | 2 |
bob-ross/cluster-paintings.py | h4ckfu/data | 16,124 | 20348 | <reponame>h4ckfu/data<filename>bob-ross/cluster-paintings.py
"""
Clusters Bob Ross paintings by features.
By <NAME> <<EMAIL>>
See http://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/
"""
import numpy as np
from scipy.cluster.vq import vq, kmeans, whiten
import math
import csv
def main... | 2.796875 | 3 |
corvette/__init__.py | philipkiely/corvette | 0 | 20349 | <gh_stars>0
import os
import sys
import json
from corvette.autoindex import autoindex
def main():
if len(sys.argv) == 2:
conf_path = sys.argv[1]
else:
print("Usage: python -m corvette path/to/corvetteconf.json")
return
dirname = os.path.dirname(__file__)
# First load default... | 2.640625 | 3 |
main.py | theoboldt/pitemp | 0 | 20350 | <gh_stars>0
#!/usr/bin/python
import sensor
import lcd
import csv
import time
import os
import datetime
import sys
import re
import circular_buffer
lcd.init()
last_time = datetime.datetime.now()
last_minute = last_time.minute
probe_minute_01 = circular_buffer.CircularBuffer(size=30)
probe_minute_15 = circular_buffe... | 2.734375 | 3 |
package/github-endpoints.py | wahyu9kdl/wahyu9kdl.github.io | 2 | 20351 | #!/usr/bin/python3
# I don't believe in license.
# You can do whatever you want with this program.
import os
import sys
import re
import time
import requests
import random
import argparse
from urllib.parse import urlparse
from functools import partial
from colored import fg, bg, attr
from multiprocessing.dummy import... | 1.898438 | 2 |
information111/info/user/views.py | SNxiaobei/text | 0 | 20352 | <reponame>SNxiaobei/text
from flask import abort
from flask import current_app
from flask import g
from flask import request
from flask import session
from info import constants
from info import db
from info.models import Category, News, User
from info.utils.response_code import RET
from . import profile_blue
from fla... | 2.46875 | 2 |
code/magicsquares/mgsq/three_by_three.py | gerritjvv/blog | 0 | 20353 | """
Solves a 3x3 square programmatically.
It is not meant to be a full blown solution for magic squares, but rather a writeup
of my thoughts on how it can be solved.
"""
import statistics
def make_pairs(I, mid):
"""
We take pairs as [ [9, 1], [8, 2], [7, 3], [6, 4]]
:param I:
:param mid:
:return:... | 4.15625 | 4 |
utils/videoJob.py | dbpeng/aws-lambda-python-example-zencoder | 1 | 20354 | <filename>utils/videoJob.py
import os
import sys
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from datetime import datetime
import json
from base import Session, e... | 2.1875 | 2 |
alipay/aop/api/domain/MybankCreditSceneprodCommonQueryModel.py | antopen/alipay-sdk-python-all | 213 | 20355 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class MybankCreditSceneprodCommonQueryModel(object):
def __init__(self):
self._app_seq_no = None
self._ext_param = None
self._operation_type = None
self._org_code = None... | 1.953125 | 2 |
train_end2end.py | lyn1874/daml | 0 | 20356 | <gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 13 18:23:08 2019
This scrip is for training the experiement end2end
@author: li
"""
import tensorflow as tf
import models.AE as AE
import optimization.loss_tf as loss_tf
from data import read_frame_temporal as rft
import numpy as np
impor... | 2.546875 | 3 |
cellfinder_napari/detect.py | neuromusic/cellfinder-napari | 7 | 20357 | import napari
from pathlib import Path
from magicgui import magicgui
from typing import List
from cellfinder_napari.utils import brainglobe_logo
# TODO:
# how to store & fetch pre-trained models?
# TODO: params to add
NETWORK_VOXEL_SIZES = [5, 1, 1]
CUBE_WIDTH = 50
CUBE_HEIGHT = 20
CUBE_DEPTH = 20
# If using ROI, h... | 2.328125 | 2 |
setup.py | paxtonfitzpatrick/nltools | 65 | 20358 | from setuptools import setup, find_packages
version = {}
with open("nltools/version.py") as f:
exec(f.read(), version)
with open("requirements.txt") as f:
requirements = f.read().splitlines()
extra_setuptools_args = dict(tests_require=["pytest"])
setup(
name="nltools",
version=version["__version__"]... | 1.617188 | 2 |
{{ cookiecutter.repo_name }}/src/config/config.py | johanngerberding/cookiecutter-data-science | 0 | 20359 | <gh_stars>0
import os
import warnings
from dotenv import find_dotenv, load_dotenv
from yacs.config import CfgNode as ConfigurationNode
from pathlib import Path
# Please configure your own settings here #
# YACS overwrite these settings using YAML
__C = ConfigurationNode()
### EXAMPLE ###
"""
# data augmentation par... | 1.914063 | 2 |
section_7/ex 30.py | thiagofreitascarneiro/Python-avancado-Geek-University | 0 | 20360 | list1 = []
list2 = []
list3 = []
cont = 0
while cont < 10:
valor = int(input('Digite um numero na lista 1: '))
list1.append(valor)
valor2 = int(input('Digite um numero na lista 2: '))
list2.append(valor2)
cont = cont + 1
if cont == 10:
for i in list1:
if i in list2:
... | 3.90625 | 4 |
scripts/eval/eval.py | p0l0satik/PlaneDetector | 0 | 20361 | <filename>scripts/eval/eval.py<gh_stars>0
import os
from shutil import rmtree
import cv2
import docker
import numpy as np
import open3d as o3d
from pypcd import pypcd
from src.metrics import metrics
from src.metrics.metrics import multi_value, mean
from src.parser import loaders, create_parser
UNSEGMENTED_COLOR = np... | 1.953125 | 2 |
cosmogrb/utils/fits_file.py | wematthias/cosmogrb | 3 | 20362 | from responsum.utils.fits_file import FITSFile, FITSExtension as FE
import pkg_resources
class FITSExtension(FE):
# I use __new__ instead of __init__ because I need to use the classmethod .from_columns instead of the
# constructor of fits.BinTableHDU
def __init__(self, data_tuple, header_tuple):
... | 2.1875 | 2 |
mi/instrument/seabird/sbe26plus/driver.py | rhan1498/marine-integrations | 0 | 20363 | <gh_stars>0
"""
@package mi.instrument.seabird.sbe26plus.ooicore.driver
@file /Users/unwin/OOI/Workspace/code/marine-integrations/mi/instrument/seabird/sbe26plus/ooicore/driver.py
@author <NAME>
@brief Driver for the ooicore
Release notes:
None.
"""
__author__ = '<NAME>'
__license__ = 'Apache 2.0'
import re
import t... | 1.4375 | 1 |
Strings/count-index-find.py | tverma332/python3 | 3 | 20364 | # 1) count = To count how many time a particular word & char. is appearing
x = "Keep grinding keep hustling"
print(x.count("t"))
# 2) index = To get index of letter(gives the lowest index)
x="Keep grinding keep hustling"
print(x.index("t")) # will give the lowest index value of (t)
# 3) find = To get index of lett... | 3.953125 | 4 |
datasets/datasets.py | rioyokotalab/ecl-isvr | 0 | 20365 | #! -*- coding:utf-8
from typing import Callable, List, Optional
import numpy as np
import torch
import torchvision
__all__ = ["CIFAR10", "FashionMNIST"]
class CIFAR10(torch.utils.data.Dataset):
def __init__(self,
root: str,
train: bool = True,
tra... | 2.671875 | 3 |
API/Segmentation_API/detectron_seg.py | rogo96/Background-removal | 40 | 20366 | from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import MetadataCatalog
import torch
import numpy as np
import cv2
class Model:
def __init__(self,confidence_thresh=0.6):
... | 2.203125 | 2 |
examples/plugin_example/setup.py | linshoK/pysen | 423 | 20367 | from setuptools import setup
setup(
name="example-advanced-package", version="0.0.0", packages=[],
)
| 0.976563 | 1 |
setup.py | xpac1985/pyASA | 10 | 20368 | from distutils.core import setup
setup(
name='pyASA',
packages=['pyASA'],
version='0.1.0',
description='Wrapper for the Cisco ASA REST API',
author='xpac',
author_email='<EMAIL>',
url='https://github.com/xpac1985/pyASA',
download_url='https://github.com/xpac1985/pyASA/tarball/0.1.0',
... | 1.101563 | 1 |
Client.py | fimmartins/qpid_protobuf_python | 1 | 20369 | <reponame>fimmartins/qpid_protobuf_python
from Qpid import QpidConnection
from mxt1xx_pb2 import *
from commands_pb2 import *
from QpidTypes import *
from qpid.messaging import *
#doc http://qpid.apache.org/releases/qpid-0.14/apis/python/html/
#examples https://developers.google.com/protocol-buffers/docs/pythontutoria... | 2.484375 | 2 |
run_all.py | EinariTuukkanen/line-search-comparison | 0 | 20370 | import numpy as np
from example_functions import target_function_dict
from line_search_methods import line_search_dict
from main_methods import main_method_dict
from config import best_params
from helpers import generate_x0
def run_one(_theta, _main_method, _ls_method, params, ls_params):
theta = _theta()
x0... | 2.578125 | 3 |
bin/runner.py | ColorOfLight/ML-term-project | 0 | 20371 | <reponame>ColorOfLight/ML-term-project
# Load Packages
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import GridSearchCV, cross_val_score
from sklearn.metrics import classification_report
from plots import d... | 2.09375 | 2 |
api/app.py | t-kigi/nuxt-chalice-aws-app-template | 0 | 20372 | <filename>api/app.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
nuxt-chalice-api のテンプレート実装です。
主に、全体で利用するグローバルスコープのリソースを初期化します。
"""
import os
from chalice import (
Chalice, CognitoUserPoolAuthorizer,
CORSConfig
)
from chalicelib import aws
from chalicelib.env import store
stage = store.mutation(
'ch... | 2.125 | 2 |
examples/plotting/plot_with_matplotlib.py | crzdg/acconeer-python-exploration | 0 | 20373 | <gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
from acconeer.exptool import configs, utils
from acconeer.exptool.clients import SocketClient, SPIClient, UARTClient
def main():
args = utils.ExampleArgumentParser(num_sens=1).parse_args()
utils.config_logging(args)
if args.socket_addr:
... | 2.296875 | 2 |
kryptobot/bots/multi_bot.py | eristoddle/Kryptobot | 24 | 20374 | <reponame>eristoddle/Kryptobot<gh_stars>10-100
from .bot import Bot
class MultiBot(Bot):
strategies = []
def __init__(self, strategies, config=None):
super().__init__(strategy=None, config=config)
self.strategies = strategies
# override this to inherit
def __start(self):
for ... | 2.453125 | 2 |
setup.py | adrienbrunet/mixt | 27 | 20375 | <reponame>adrienbrunet/mixt
#!/usr/bin/env python
"""Setup file for the ``mixt`` module. Configuration is in ``setup.cfg``."""
from setuptools import setup
setup()
| 1.046875 | 1 |
venv/lib/python3.9/site-packages/py2app/recipes/PIL/prescript.py | dequeb/asmbattle | 193 | 20376 | def _recipes_pil_prescript(plugins):
try:
import Image
have_PIL = False
except ImportError:
from PIL import Image
have_PIL = True
import sys
def init():
if Image._initialized >= 2:
return
if have_PIL:
try:
impor... | 2.1875 | 2 |
app/accounts/views/user_type.py | phessabi/eshop | 1 | 20377 | from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
class GetTypeView(APIView):
permission_classes = [IsAuthenticated]
def get(self, request):
user = request.user
if hasattr(user, 'vendor'):
t... | 2.3125 | 2 |
Statistical Thinking in Python (Part 1)/Thinking_probabilistically--_Discrete_variables.py | shreejitverma/Data-Scientist | 2 | 20378 | <filename>Statistical Thinking in Python (Part 1)/Thinking_probabilistically--_Discrete_variables.py
# Thinking probabilistically-- Discrete variables!!
# Statistical inference rests upon probability. Because we can very rarely say anything meaningful with absolute certainty from data, we use probabilistic language to ... | 4.625 | 5 |
ml/data_engineering/ETL/extract.py | alexnakagawa/tools | 0 | 20379 | '''
This is an abstract example of Extracting in an ETL pipeline.
Inspired from the "Introduction to Data Engineering" course on Datacamp.com
Author: <NAME>
'''
import requests
# Fetch the Hackernews post
resp = requests.get("https://hacker-news.firebaseio.com/v0/item/16222426.json")
# Print the response parsed as ... | 3.453125 | 3 |
python/python-algorithm-intervew/11-hash-table/29-jewels-and-stones-3.py | bum12ark/algorithm | 1 | 20380 | """
* 보석과 돌
J는 보석이며, S는 갖고 있는 돌이다. S에는 보석이 몇 개나 있을까? 대소문자는 구분한다.
- Example 1
Input : J = "aA", S = "aAAbbbb"
Output : 3
- Example 2
Input : J = "z", S = "ZZ"
Output : 0
"""
import collections
class Solution:
# Counter로 계산 생략
def numJewelsInStones(self, J: str, S: str) -> int:
freqs = collections.Count... | 3.765625 | 4 |
migrations/versions/e1c435b9e9dc_.py | vipshae/todo-lister | 0 | 20381 | <reponame>vipshae/todo-lister
"""empty message
Revision ID: e1c435b9e9dc
Revises: <PASSWORD>
Create Date: 2020-06-11 14:22:00.453626
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e1c435b9e9dc'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = No... | 1.429688 | 1 |
test/test_quilted_contacts_list.py | cocoroutine/pyquilted | 1 | 20382 | <reponame>cocoroutine/pyquilted<filename>test/test_quilted_contacts_list.py<gh_stars>1-10
import unittest
from pyquilted.quilted.contact import *
from pyquilted.quilted.contacts_list import ContactsList
class TestContactsList(unittest.TestCase):
def test_contact_list(self):
contacts = ContactsList()
... | 2.703125 | 3 |
examples/python/macOS/hack_or_die.py | kitazaki/NORA_Badge | 0 | 20383 | from __future__ import print_function
import time
import uuid
import Adafruit_BluefruitLE
CHARACTERISTIC_SERVICE_UUID = uuid.UUID('0000fee0-0000-1000-8000-00805f9b34fb')
CHARACTERISTIC_DATA_UUID = uuid.UUID('0000fee1-0000-1000-8000-00805f9b34fb')
provider = Adafruit_BluefruitLE.get_provider()
def main():
provi... | 2.453125 | 2 |
turkish_morphology/validate_test.py | nogeeky/turkish-morphology | 157 | 20384 | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# 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 applicab... | 2.1875 | 2 |
rplint/__main__.py | lpozo/rplint | 7 | 20385 | <reponame>lpozo/rplint
#!/usr/bin/env python3
from .main import rplint
if __name__ == "__main__":
rplint.main(prog_name=__package__)
| 1.0625 | 1 |
physicspy/optics/jones.py | suyag/physicspy | 0 | 20386 | <filename>physicspy/optics/jones.py<gh_stars>0
#!/usr/bin/env python
from __future__ import division
from numpy import sqrt, cos, sin, arctan, exp, abs, pi, conj
from scipy import array, dot, sum
class JonesVector:
""" A Jones vector class to represent polarized EM waves """
def __init__(self,Jarray=array([1,0... | 2.9375 | 3 |
aiida/cmdline/params/options/config.py | louisponet/aiida-core | 1 | 20387 | <reponame>louisponet/aiida-core
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 2.078125 | 2 |
vaccine_feed_ingest/runners/ct/state/parse.py | jeremyschlatter/vaccine-feed-ingest | 27 | 20388 | <reponame>jeremyschlatter/vaccine-feed-ingest
#!/usr/bin/env python
import json
import pathlib
import sys
input_dir = pathlib.Path(sys.argv[2])
output_dir = pathlib.Path(sys.argv[1])
output_file = output_dir / "data.parsed.ndjson"
results = []
for input_file in input_dir.glob("data.raw.*.json"):
with input_file.... | 2.671875 | 3 |
python_learning/exception_redefinition.py | KonstantinKlepikov/all-python-ml-learning | 0 | 20389 | <filename>python_learning/exception_redefinition.py
# example of redefinition __repr__ and __str__ of exception
class MyBad(Exception):
def __str__(self):
return 'My mistake!'
class MyBad2(Exception):
def __repr__(self):
return 'Not calable' # because buid-in method has __str__
try:
r... | 4.15625 | 4 |
difPy/dif.py | ppizarror/Duplicate-Image-Finder | 0 | 20390 | import skimage.color
import matplotlib.pyplot as plt
import numpy as np
import cv2
import os
import imghdr
import time
"""
Duplicate Image Finder (DIF): function that searches a given directory for images and finds duplicate/similar images among them.
Outputs the number of found duplicate/similar image pairs with a l... | 3.234375 | 3 |
minmax.py | jeffmorais/estrutura-de-dados | 1 | 20391 | # A função min_max deverá rodar em O(n) e o código não pode usar nenhuma
# lib do Python (sort, min, max e etc)
# Não pode usar qualquer laço (while, for), a função deve ser recursiva
# Ou delegar a solução para uma função puramente recursiva
import unittest
def bora(cont, seq, min, max):
if cont < len(seq):
... | 3.890625 | 4 |
news-category-classifcation/build_vocab.py | lyeoni/pytorch-nlp-tutorial | 1,433 | 20392 | <filename>news-category-classifcation/build_vocab.py
import argparse
import pickle
from tokenization import Vocab, Tokenizer
TOKENIZER = ('treebank', 'mecab')
def argparser():
p = argparse.ArgumentParser()
# Required parameters
p.add_argument('--corpus', default=None, type=str, required=True)
p.add_a... | 3.015625 | 3 |
lambda-sfn-terraform/src/LambdaFunction.py | extremenelson/serverless-patterns | 1 | 20393 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import boto3
import os
from aws_lambda_powertools import Logger
logger = Logger()
client = boto3.client('stepfunctions')
sfnArn = os.environ['SFN_ARN']
def lambda_handler(event, context):
# TODO impl... | 2.0625 | 2 |
tests/encryption/aes_decrypter.py | dfjxs/dfvfs | 176 | 20394 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the AES decrypter object."""
import unittest
from dfvfs.encryption import aes_decrypter
from dfvfs.lib import definitions
from tests.encryption import test_lib
class AESDecrypterTestCase(test_lib.DecrypterTestCase):
"""Tests for the AES decrypter object.... | 2.84375 | 3 |
Crash Course on Python/WEEK 5/solutions.py | atharvpuranik/Google-IT-Automation-with-Python-Professional-Certificate | 42 | 20395 | <gh_stars>10-100
#Q2
# “If you have an apple and I have an apple and we exchange these apples then
# you and I will still each have one apple. But if you have an idea and I have
# an idea and we exchange these ideas, then each of us will have two ideas.”
# <NAME>
class Person:
apples = 0
ideas = 0
johanna = P... | 3.90625 | 4 |
python/test/is_prime.test.py | hotate29/kyopro_lib | 0 | 20396 | <gh_stars>0
# verification-helper: PROBLEM http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C
from python.lib.is_prime import isprime
print(sum(isprime(int(input())) for _ in range(int(input()))))
| 2.796875 | 3 |
utils/pad.py | Zenodia/nativePytorch_NMT | 60 | 20397 | import torch
import numpy as np
PAD_TOKEN_INDEX = 0
def pad_masking(x, target_len):
# x: (batch_size, seq_len)
batch_size, seq_len = x.size()
padded_positions = x == PAD_TOKEN_INDEX # (batch_size, seq_len)
pad_mask = padded_positions.unsqueeze(1).expand(batch_size, target_len, seq_len)
return pa... | 2.546875 | 3 |
jesse/modes/utils.py | julesGoullee/jesse | 4 | 20398 | <reponame>julesGoullee/jesse
from jesse.store import store
from jesse import helpers
from jesse.services import logger
def save_daily_portfolio_balance():
balances = []
# add exchange balances
for key, e in store.exchanges.storage.items():
balances.append(e.assets[helpers.app_currency()])
# ... | 2.359375 | 2 |
Modo/Kits/OD_ModoCopyPasteExternal/lxserv/cmd_copyToExternal.py | heimlich1024/OD_CopyPasteExternal | 278 | 20399 | <filename>Modo/Kits/OD_ModoCopyPasteExternal/lxserv/cmd_copyToExternal.py
################################################################################
#
# cmd_copyToExternal.py
#
# Author: <NAME> | <NAME>
#
# Description: Copies Geo/Weights/Morphs/UV's to External File
#
# Last Update:
#
#################... | 2.234375 | 2 |