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
flask_transalchemy/core.py
gerelorant/Flask-TransAlchemy
2
48900
from flask import Flask, current_app, request from flask_babelex import get_locale from flask_sqlalchemy import SQLAlchemy from flask_transalchemy.model import TranslationMixin class TransAlchemy(object): """Flask-TransAlchemy extension class. :param app: Flask application instance :param db: Flask-SQLA...
2.78125
3
crowdastro/experiment/experiment_pool_face.py
chengsoonong/crowdastro
13
48901
<reponame>chengsoonong/crowdastro """Pools a face image. <NAME> The Australian National University 2016 """ import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy import scipy.misc import skimage.measure face = scipy.misc.face(gray=True) max_pooled = skimage.measure.block_reduce(face, (20, 2...
2.53125
3
src/nig/utilities/generic.py
eaplatanios/nig
3
48902
# Copyright 2016, The NIG Authors. 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 required by applicable la...
2.046875
2
control/teleop/joystick.py
espetro/anafi_tools
2
48903
from __future__ import print_function, absolute_import from random import random from time import sleep import threading import pygame import sys try: from olympe.messages.ardrone3.GPSSettingsState import GPSFixStateChanged from olympe.messages.ardrone3.Piloting import TakeOff, Landing from olympe.messag...
2.71875
3
artellapipe/tools/playblastmanager/plugins/tracking.py
ArtellaPipe/artellapipe-tools-playblastmanager
2
48904
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains implementation for Tracking Plugin """ from __future__ import print_function, division, absolute_import __author__ = "<NAME>" __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import logging import traceback fro...
1.726563
2
char-gen.py
mshinners/rpg-char-gen
0
48905
<filename>char-gen.py """Create a Character Generator for Fallout 4.""" # print("You awake from 200 years in deep freeze. The wasteland awaits you.") # name = input("What's your name? ") # gender = input("What's your gender? ") # points = 21 # attributes = ("Strength", "Perception", "Endurance", "Charisma", "Intellige...
3.609375
4
Data Preprocessing/Manual Method.py
roupenminassian/UTS-DSI-x-Disability-Research-Network
0
48906
# These lines of code allow for manually chunking sentences or paragraphs of extracted information to a list # The string that is defined for 'A' will be manually updated each time the previous string has been added to GovList # This means that we are incrementaly adding sentences and paragraphs to this list # This par...
3.828125
4
scripts/downloader.py
docupajak/pyproc
1
48907
import argparse import csv import glob import json import os import re import time from math import ceil from shutil import copyfile, rmtree from urllib.parse import urlparse import requests from pyproc import Lpse, __version__ from pyproc.helpers import DetilDownloader from urllib3 import disable_warnings from urll...
2.25
2
src/util_labse.py
Opdoop/Parallel-Text-Extraction
3
48908
<reponame>Opdoop/Parallel-Text-Extraction<filename>src/util_labse.py import json import bert import h5py import numpy as np import tensorflow as tf import tensorflow_hub as hub from tqdm import tqdm from config import MODEL_PATH MODEL_URL = MODEL_PATH # set the local catch path of model max_seq_length = 64 ...
2.34375
2
tkcrud/views/client_view.py
williamcanin/tkcrud
0
48909
import tkinter as tk from tkinter import ttk, messagebox, font, StringVar from tkcalendar import DateEntry from tkcrud.controller.client_controller import ClientController,\ saving_updating, get_clients, window_popup class FormClientRegister(tk.Toplevel, ClientController): def __init__(self, master, tree): ...
2.734375
3
movescount/scraper.py
Kub-AT/suunto-movescount-exporter
1
48910
<reponame>Kub-AT/suunto-movescount-exporter<gh_stars>1-10 import datetime import json import os import arrow import requests from .models import MoveActivity class Movescount: AVAILABLE_FORMATS = ['gpx', 'kml', 'fit', 'tcx', 'xlsx'] USER_AGENT = ('Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 ...
2.078125
2
web/chains-202105/py/application.py
acorg/acmacs-whocc
0
48911
import sys, os, re, json, pprint, traceback from pathlib import Path from aiohttp import web routes = web.RouteTableDef() async def app(): from web_chains_202105 import directories app = web.Application(middlewares=[exception_middleware]) app.add_routes(routes) app.router.add_static("/js/", path="js",...
2.4375
2
insta_core/_today.py
brokeyourbike/insta_fuck
2
48912
"""Module used for showing today's ulikes users""" from ._time import sleep def open_lucky_one(browser, username): """Open user in new tab""" # Open new tab browser.execute_script("window.open('','_blank');") windows = browser.window_handles sleep(1) browser.switch_to_window(windows[-1]) # Open user browser...
2.71875
3
pipy/tests/test_utils.py
rhsmits91/pipy
0
48913
<filename>pipy/tests/test_utils.py import pandas as pd from pipy.pipeline.utils import combine_series def test_combine_series(): s1 = pd.Series(dict(zip("AB", (1, 2)))) s2 = pd.Series(dict(zip("BC", (20, 30)))) s3 = combine_series(s1, s2) pd.testing.assert_series_equal(s3, pd.Series({"A": 1, "B": 20,...
2.5
2
prinia/__init__.py
zamaudio/prinia
1
48914
<reponame>zamaudio/prinia __author__ = 'ahbbollen'
0.914063
1
Item33.py
aambrioso1/Effective_Python
0
48915
""" Item 33: Compose Multiple Generators with yield from This example compares using for/yield (manual nesting) and yield/from (composed nesting) for nesting generators. The yield/from expression improves readability and performance. """ # Example 1: We create a couple of generators def move(period, speed): for ...
3.875
4
aiodine/datatypes.py
Olegt0rr/aiodine
61
48916
from typing import Callable, Awaitable CoroutineFunction = Callable[..., Awaitable]
1.226563
1
tloc.py
kohyuk91/TLOC
10
48917
<filename>tloc.py # BSD 3-Clause License # # Copyright (c) 2020, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice...
1.585938
2
time_attack/cli.py
confuzeus/time-attack
0
48918
<reponame>confuzeus/time-attack<gh_stars>0 """Console script for time_attack.""" import argparse import sys from pathlib import Path from time_attack.conf import get_config, init_config def main(): """Console script for time_attack.""" parser = argparse.ArgumentParser(description="Track your time.") par...
2.859375
3
{{cookiecutter.project_slug}}/app/{{cookiecutter.app_slug_snakecase}}/tests/test_{{cookiecutter.app_slug_snakecase}}_services.py
jonatasoli/fastapi-template-cookiecutter
7
48919
import pytest from unittest import mock from {{cookiecutter.app_slug_snakecase}}.services.services_{{cookiecutter.app_slug_snakecase}} import add_{{cookiecutter.model_slug_snakecase}} from {{cookiecutter.app_slug_snakecase}}.schemas.schemas_{{cookiecutter.app_slug_snakecase}} import {{cookiecutter.model_name}}CreateRes...
2.21875
2
src/ashpy/metrics/gan.py
zurutech/ashpy
89
48920
# Copyright 2019 Zuru Tech HK Limited. 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 required by applicable la...
1.945313
2
cephlm/tests/cephmetrics/ceph/test_connectivity_status.py
ArdanaCLM/cephlm
0
48921
<filename>cephlm/tests/cephmetrics/ceph/test_connectivity_status.py # (c) Copyright 2016 Hewlett Packard Enterprise Development LP # (c) Copyright 2017 SUSE LLC # # 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 ...
2.0625
2
liebraryrest/database.py
gekorob/liebraryrest
6
48922
# -*- coding: utf-8 -*- """Database module, including the SQLAlchemy database object and DB-related utilities.""" import json from sqlalchemy.inspection import inspect from sqlalchemy.orm import relationship from .extensions import db # Alias common SQLAlchemy names Column = db.Column relationship = relationship c...
2.875
3
views/terminal_view.py
rbenamotz/LEMPA
83
48923
<filename>views/terminal_view.py from views import View HEADER_LEN = 70 class TerminalView(View): def __init__(self, app): super().__init__(app) def cleanup(self): print("Goodbye") def print(self, txt): if (txt): print("\033[92m{}\033[39m".format(txt)) def detail...
2.625
3
test_image_processing.py
juanlucruz/SportEventLocator
0
48924
from owslib.wms import WebMapService from owslib import crs from PIL import Image, ImageEnhance, ImageFilter import cv2 import numpy as np from pyspark import SparkContext from pyproj import Proj c = crs.Crs('EPSG:3857') wms = WebMapService('http://www.ign.es/wms-inspire/pnoa-ma', version='1.3.0') box = 1000 # m? x=...
2.65625
3
src/guestconfig/azext_guestconfig/vendored_sdks/guestconfig/models/_models_py3.py
Mannan2812/azure-cli-extensions
207
48925
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
1.96875
2
expression-atlas-wf/scripts/FBgn_to_muller.py
jfear/larval_gonad
1
48926
<reponame>jfear/larval_gonad """Create a temporary mapping of dmel FBgn to Muller. This script converts the YOgn to Muller element and D. melanogaster FBGn to Muller element. It uses the YOgn to D. mel FBgn mapping to update the YOgn to Muller element mapping. """ import os import pandas as pd from larval_gonad.io i...
2.515625
3
coin_conversion.py
anthonywww/intro-to-python
0
48927
# -*- coding: utf-8 -*- # Program Name: coin_conversion.py # <NAME> # 06/15/16 # Python Version 3.4 # Description: Convert amount into coins # Optional import for versions of python <= 2 from __future__ import print_function # Do this until valid input is given while True: try: # This takes in a integer coins ...
4.0625
4
tree_plotter/__init__.py
vivekfe/FX-Sims
0
48928
<filename>tree_plotter/__init__.py # -*- coding: utf-8 -*- """ Created on Sat Jun 12 17:12:03 2021 @author: ztche """ import matplotlib.pyplot as plt import pandas as pd def plot_stock_lattice(tree, style='ko-'): """ plots stock lattice on matplotlib from chronological binary tree """ vals1 = {} ...
3.109375
3
bioimageit_gui/core/web.py
bioimageit/bioimageit_gui
0
48929
"""Set of basic widgets for BioImageIT Classes ------- BiWebBrowser """ from qtpy.QtWebEngineWidgets import QWebEngineView from qtpy.QtWidgets import (QWidget, QPushButton, QHBoxLayout, QVBoxLayout) class BiWebBrowser(QWidget): def __init__(self, parent: QWidget): super(Bi...
2.78125
3
refinenet/__init__.py
Best-of-ACRV/pytorch-refinenet
3
48930
from .refinenet import RefineNet from .__main__ import main as run_from_args
1.0625
1
hello_world_cpp/launch/server.launch.py
fjnkt98/hello_world
0
48931
import launch import launch_ros def generate_launch_description(): server_node_container = launch_ros.actions.ComposableNodeContainer( node_name='server_node_container', node_namespace='', package='rclcpp_components', node_executable='component_container', ...
2.21875
2
todobackend/todobackend/settings.py
Grox-Ni/todoapp
0
48932
<gh_stars>0 import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = <KEY>' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', ...
1.554688
2
ERAI/pickle_stream_dict.py
coecms/CollectionsScripts
5
48933
# This script produced a python dictionary stream_dict that assign ifor each ERA Interim stream # the time, step, parameters and levels lists to pass as arguments to MARS requests. The dictionary is stored # in a pickle file ecmwf_stream_pickle used by the ERAI python download script: erai_download.py # author: <NAME> ...
2.6875
3
ETL/scripts/032_WordNet.py
kaalam/thetangle
1
48934
import os, re from lxml import etree from file_paths import etl_source, etl_dest from Section import Section class EchoTarget: def __init__(self, out_path = etl_dest): self.level = 0 self.ent_id = None self.form = None self.pos = None self.ss_id = None self.synset = None self.tx_pos = Section('Wor...
2.28125
2
simulator/thruster_plotter.py
ErikRowe/Bachelor-E2205
1
48935
<reponame>ErikRowe/Bachelor-E2205 from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt lengths = np.array([ [0.156, 0.111, 0.085], [0.156, -0.111, 0.085], [-0.156, 0.111, 0.085], [-0.156, -0.111, 0.085], [0.12,...
2.328125
2
tests/issues/issue_6.py
jparise/flake8_tuple
30
48936
# -*- coding: utf-8 -*- """ foo """ bah = 1
1.078125
1
src/mightypy/ml/_tree.py
NishantBaheti/mightypy
1
48937
from __future__ import annotations from typing import Union, Tuple, List import warnings import numpy as np class Question: """Question is a thershold/matching concept for splitting the node of the Decision Tree Args: column_index (int): Column index to be chosen from the array passed at the matching...
3.703125
4
src/pytools/data/_simulation.py
BCG-Gamma/pytools
17
48938
""" Utilities for creating simulated data sets. """ from typing import Optional, Sequence import numpy as np import pandas as pd from scipy.linalg import toeplitz from ..api import AllTracker __all__ = ["sim_data"] __tracker = AllTracker(globals()) def sim_data( n: int = 100, intercept: float = -5, t...
3.109375
3
misc/projections.py
DawyD/UNet-PS-4D
1
48939
<reponame>DawyD/UNet-PS-4D """ Projections To add a custom projection, create a method accepting (x, y, z) Cartesian coordinates and add an entry to the parse_projection method """ def parse_projection(name: str): if name == "standard": return standard_proj raise ValueError("Unknown projection") de...
2.5
2
tests/unitary/RewardStream/test_notify_reward_amount.py
AqualisDAO/curve-dao-contracts
217
48940
import math import brownie from brownie import chain def test_only_distributor_allowed(alice, stream): with brownie.reverts("dev: only distributor"): stream.notify_reward_amount(10 ** 18, {"from": alice}) def test_retrieves_reward_token(bob, stream, reward_token): stream.notify_reward_amount(10 ** ...
2.40625
2
example.py
zimengyang/wavefront-dispatch-python
0
48941
import wavefront_dispatch import random @wavefront_dispatch.wrapper def handle(ctx, payload): # Fibonacci f_2, f_1 = 0, 1 for n in range(random.randint(800, 900)): f = f_1 + f_2 f_2, f_1 = f_1, f # Customized metrics registry = wavefront_dispatch.get_registry() # Report Gauge...
2.0625
2
electrum_gui/common/provider/chains/btc/provider.py
BixinKey/electrum
12
48942
import itertools import logging from typing import Any, Dict, Set, Tuple from pycoin.coins.bitcoin import Tx as pycoin_tx from electrum_gui.common.basic.functional.require import require from electrum_gui.common.coin import data as coin_data from electrum_gui.common.conf import settings from electrum_gui.common.provi...
2.0625
2
trainer.py
MichaelArbel/KWNG
13
48943
from __future__ import print_function import torch import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import os, sys from tensorboardX import SummaryWriter import time import numpy as np import pprint import socket import pickle from resnet import * from kwng import * from gaussi...
2.125
2
dual_tape/dual_tape.py
cmcmarrow/dual_tape
1
48944
""" Copyright 2021 <NAME> """ # built-in import argparse from typing import List, Generator, Optional, Tuple, Union # dual_tape import dual_tape as dt from . import assembler from . import error from . import vm from .log import enable_log class DualTapeAPI(error.DualTapeError): @classmethod def hit_timeout...
2.703125
3
photo/qt/tagSelectDialog.py
RKrahl/photo-tools
0
48945
<reponame>RKrahl/photo-tools """A dialog window to set and remove tags. """ import math from PySide import QtCore, QtGui class TagSelectDialog(QtGui.QDialog): def __init__(self, taglist): super().__init__() self.checkLayout = QtGui.QGridLayout() self.settags(taglist) self.entry...
2.59375
3
rc4/__init__.py
DavidBuchanan314/rc4
14
48946
<reponame>DavidBuchanan314/rc4<filename>rc4/__init__.py from .rc4 import RC4
1.101563
1
Intelligence_System/8/20191128-MachineLearning1_Python/p53.py
yoshi-ki/BACHELOR
0
48947
<reponame>yoshi-ki/BACHELOR<filename>Intelligence_System/8/20191128-MachineLearning1_Python/p53.py from __future__ import division from __future__ import print_function import numpy as np import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt np.random.seed(0) # set the random seed for reproducib...
2.828125
3
python/qtLearn/windows/examples/exampleComboCompleter.py
david-cattermole/qt-learning
13
48948
""" https://stackoverflow.com/questions/4827207/how-do-i-filter-the-pyqt-qcombobox-items-based-on-the-text-input """ import sys from Qt import QtCore from Qt import QtWidgets class ExtendedCombo(QtWidgets.QComboBox): def __init__(self, parent=None): super(ExtendedCombo, self).__init__(parent) sel...
2.953125
3
Camera.py
zippybenjiman/PythonCraft
51
48949
<filename>Camera.py import numpy as np from OpenGL.GL import * from OpenGL.GLU import * from math import * from ZMath import * class Camera: def __init__(self): self.maxPitchRate = 5 self.maxYawRate = 5 self.maxRollRate = 5 self.pitchAngle = 0 self.yawAngle = 0 self.rollAngle = 0 self.maxVelocity = ...
2.984375
3
libs/cGeo/setup.py
nodebox/nodebox-pyobjc
47
48950
from distutils.core import setup, Extension cGeo = Extension("cGeo", sources = ["cGeo.c"]) setup (name = "cGeo", version = "0.1", author = "<NAME>", description = "Fast geometric functionality.", ext_modules = [cGeo])
1.046875
1
is_cuda_available.py
chumingqian/Model_Compression_For_YOLOV4
13
48951
<reponame>chumingqian/Model_Compression_For_YOLOV4 import os # os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "0" import torch flag = torch.cuda.is_available() print(flag) ngpu= 1 # Decide which device we want to run on device = torch.device("cuda:0" if (torch.cuda.is_available...
2.671875
3
src/literary/config.py
gitter-badger/literary
0
48952
<reponame>gitter-badger/literary<filename>src/literary/config.py import functools import pathlib from jupyter_core.paths import jupyter_config_path import traitlets.config CONFIG_FILE_NAME = "literary_config" PROJECT_ROOT_MARKERS = ( "pyproject.toml", "setup.py", "setup.cfg", ".literary-project", f...
2.203125
2
LeetCode/Python3/DFS&BFS/787. Cheapest Flights Within K Stops.py
WatsonWangZh/CodingPractice
11
48953
<reponame>WatsonWangZh/CodingPractice # There are n cities connected by m flights. # Each flight starts from city u and arrives at v with a price w. # Now given all the cities and flights, # together with starting city src and the destination dst, # your task is to find the cheapest price from src to dst with up to ...
3.9375
4
processing/VAC_dynamics_v2/calculate_orbits_gaiaedr3.py
svenbuder/GALAH_DR3
10
48954
<reponame>svenbuder/GALAH_DR3<gh_stars>1-10 #!/usr/bin/env python # coding: utf-8 # # Actions and Orbit caluclation with MC sampling for GALAH DR3 after Gaia eDR3 # # ## Author: <NAME> # # ### History: # 201204 SB Created # # # What information you need # # ra, dec, pmra, pmdec from Gaia eDR3 # # distance: ...
2.296875
2
codegen/codegen/host_codegen.py
spcl/fblas
68
48955
import json from codegen import json_definitions as jd from codegen import json_writer as jw from codegen import fblas_routine from codegen import fblas_types import codegen.generator_definitions as gd from codegen.fblas_helper import FBLASHelper import logging import os import jinja2 from typing import List class Ho...
2.375
2
test/test_vehicle.py
pchevallier/bimmer_connected
141
48956
<gh_stars>100-1000 """Tests for ConnectedDriveVehicle.""" import unittest from unittest import mock from test import load_response_json, BackendMock, TEST_USERNAME, TEST_PASSWORD, TEST_REGION, \ G31_VIN, F48_VIN, I01_VIN, I01_NOREX_VIN, F15_VIN, F45_VIN, F31_VIN, TEST_VEHICLE_DATA, \ ATTRIBUTE_MAPPING, MISSING_...
2.703125
3
examples/mnist/mnist.py
mentice/docker-jobber
0
48957
<filename>examples/mnist/mnist.py<gh_stars>0 import numpy as np import tensorflow as tf np.random.seed(0) tf.set_random_seed(0) (x_train, y_train),(x_test, y_test) = np.load('/data/mnist.npy') x_train, x_test = x_train / 255.0, x_test / 255.0 model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(), tf.kera...
2.890625
3
tests/files/while.py
docmarionum1/py65c
12
48958
<filename>tests/files/while.py i = 10 j = 0 while i > 2: i = i - 1 j = j + 8
2.0625
2
forking_paths_dataset/code/batch_plot_traj_carla.py
ziyan0302/Multiverse
190
48959
# coding=utf-8 """Batch convert the world traj in actev to carla traj.""" import argparse import os from glob import glob from tqdm import tqdm import sys if sys.version_info > (3, 0): import subprocess as commands else: import commands parser = argparse.ArgumentParser() parser.add_argument("traj_world_path") pa...
2.46875
2
neural-cryptograhy/neural_cryptography/model.py
DKuzn/information-security-basics
0
48960
<filename>neural-cryptograhy/neural_cryptography/model.py from tensorflow.keras.layers import Input, Embedding, Flatten, Reshape, Conv2D, Concatenate, TimeDistributed, Dense from tensorflow.keras.models import Model, Sequential from tensorflow.keras.metrics import mean_absolute_error, categorical_crossentropy, categori...
2.5
2
lpp_test/urls.py
wang0704/lpp_test
0
48961
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt...
1.476563
1
assemtools/core/setup.py
xmyeen/assemtools
0
48962
# -*- coding:utf-8 -*- #!/usr/bin/env python import os, typing, datetime, glob, warnings, pathlib, pkg_resources from setuptools import setup as setuptools_setup from .cmd import bdist_app,cleanup from ..utility.os import walk_relative_file from ..utility.pkg import cov_to_program_name, cov_program_name_to_module_name...
2.0625
2
rlax/_src/losses_test.py
chris-chris/rlax
0
48963
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. 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 # # ...
1.851563
2
pypy/tool/pytest/run-script/regrverbose.py
camillobruni/pygirl
12
48964
# refer to 2.4.1/test/regrtest.py's runtest() for comparison import sys from test import test_support test_support.verbose = int(sys.argv[1]) sys.argv[:] = sys.argv[2:] modname = sys.argv[0] impname = 'test.' + modname mod = __import__(impname, globals(), locals(), [modname]) indirect_test = getattr(mod, 'test_main'...
1.835938
2
face.py
justinham/rasp
0
48965
<reponame>justinham/rasp<filename>face.py import os import glob import numpy as np import cv2 import tensorflow as tf from fr_utils import * from inception_blocks_v2 import * from keras import backend as K from easyfacenet.simple import facenet def triplet_loss(y_true, y_pred, alpha = 0.3): anchor, positive, negati...
2.359375
2
setup.py
ox-it/oxford-term-dates
2
48966
#!/usr/bin/env python from distutils.core import setup setup(name='oxford_term_dates', version='1.3.0', description='A Python library for translating between real dates and Oxford term dates', author='IT Services, University of Oxford', author_email='<EMAIL>', url='https://github.com/ox-...
1.320313
1
keynote-export.py
jmckind/keynote-export
1
48967
<reponame>jmckind/keynote-export<filename>keynote-export.py #!/usr/bin/env python from AppKit import NSURL, NSMutableDictionary from ScriptingBridge import SBApplication import sys DEBUG = False BUNDLE = 'com.apple.iWork.Keynote' SAVING_OPTIONS = { 'yes': 0x79657320, # 'yes ' 'no': 0x6E6F2020, # 'no ' ...
2.375
2
pomade/assertions.py
saucelabs/pomade
0
48968
from pprint import pformat import json import time import traceback import sys from config import SPIN_TIMEOUT class FailTestException(Exception): pass def spinAssert(msg, test, timeout=None, args=[]): timeout = timeout or SPIN_TIMEOUT name = getattr(test, '__name__', 'unknown') last_e = None fo...
2.765625
3
EcomWebsite/ecom/blog/urls.py
ShibanandaJena/MyShop
1
48969
<gh_stars>1-10 from . import views from django.urls import path urlpatterns = [ path("",views.index ,name="blogpost"), path("blogpost/<int:id>",views.blogpost ,name="blogpost"), ]
1.679688
2
1436_Destination_City.py
Raclsc/LeetCode
0
48970
<reponame>Raclsc/LeetCode<filename>1436_Destination_City.py # LeetCode # Level: Easy # Date: 2021.11.17 class Solution: def destCity(self, paths: List[List[str]]) -> str: P = dict(paths) PA = P.keys() PB = P.values() DC = PB - PA for i in DC: ...
2.984375
3
src/mlregression/mlreg.py
muhlbach/ml-regression
1
48971
<gh_stars>1-10 #------------------------------------------------------------------------------ # Libraries #------------------------------------------------------------------------------ # Standard import numpy as np # User from .base.base_mlreg import BaseMLRegressor #------------------------------------------------...
2.09375
2
code_soup/common/vision/models/__init__.py
gchhablani/code-soup
18
48972
<reponame>gchhablani/code-soup<filename>code_soup/common/vision/models/__init__.py from torchvision.models import ( alexnet, densenet121, densenet161, densenet169, densenet201, googlenet, inception_v3, mnasnet0_5, mnasnet0_75, mnasnet1_0, mnasnet1_3, mobilenet_v2, mob...
1.492188
1
desktop/core/ext-py/django-celery-beat-1.4.0/django_celery_beat/migrations/0005_add_solarschedule_events_choices_squashed_0009_merge_20181012_1416.py
maulikjs/hue
5,079
48973
# Generated by Django 2.1.2 on 2018-10-12 14:18 from __future__ import absolute_import, unicode_literals from django.db import migrations, models import django_celery_beat.validators import timezone_field.fields class Migration(migrations.Migration): replaces = [ ('django_celery_beat', '0005_add_solarsch...
1.726563
2
timecalc.py
Hiromi-nee/bunchofscripts
0
48974
<reponame>Hiromi-nee/bunchofscripts from datetime import timedelta import sys import re def help(): print("Calculate TIME!") print("Usage: python " + sys.argv[0] + " Time_1 [+|-] Time_2") def main(): t_fp = re.compile('\d\d\:\d\d\:\d\d') try: if(t_fp.match(sys.argv[1]) and t_fp.match(sys.arg...
3.40625
3
python/cracking_codes_with_python/k_columnar_transposition_cipher_hack.py
MerrybyPractice/book-challanges-and-tutorials
0
48975
# Columnar Transposition Hack per Cracking Codes with Python # https://www.nostarch.com/crackingcodes/ (BSD Licensed) import pyperclip from j_detect_english import is_english from g_decrypt_columnar_transposition_cipher import decrypt_message as decrypt def hack_transposition(text): print('Press Ctrl-C to quit a...
3.671875
4
apis/covid-api-tester.py
Ristinoa/cs257
0
48976
<gh_stars>0 #!/usr/bin/env python3 ''' covid-api-tester.py <NAME>, 25 October 2021 This is a demo of how to use a public API from a Python program. It's not intended to be particularly user-friendly or extensible. It just shows the minimum code required to extract a little data from the API at ...
3.28125
3
tasks.py
larsbutler/celery-examples
19
48977
from celery.decorators import task @task def make_pi(num_calcs): """ Simple pi approximation based on the Leibniz formula for pi. http://en.wikipedia.org/wiki/Leibniz_formula_for_pi :param num_calcs: defines the length of the sequence :type num_calcs: positive int :returns: an approximation o...
3.3125
3
tests/test_datareactor.py
data-dev/DataReactor
1
48978
<reponame>data-dev/DataReactor<filename>tests/test_datareactor.py import tempfile import unittest from glob import glob from parameterized import parameterized from datareactor import DataReactor class TestDataReactor(unittest.TestCase): @parameterized.expand(glob("datasets/**/")) def test_datasets(self, p...
2.3125
2
mergechance/blacklist.py
GoodClover/merge-chance
25
48979
<reponame>GoodClover/merge-chance<filename>mergechance/blacklist.py blacklist = [ "userQED", "GGupzHH", "nodejs-ma", "linxz-coder", "teach-tian", "kevinlens", "Pabitra-26", "mangalan516", "IjtihadIslamEmon", "marcin-majewski-sonarsource", "LongTengDao", "JoinsG", "saf...
1.1875
1
progressmonitor/test/testfallback.py
jm-begon/progressmonitor
0
48980
# -*- coding: utf-8 -*- """ test queen """ __author__ = "<NAME> <<EMAIL>>" __copyright__ = "3-clause BSD License" __version__ = '1.0' __date__ = "15 January 2015" from nose.tools import assert_equal import dis from progressmonitor.formatter import (progressbar_formatter_factory, ...
2.109375
2
contig_lengths.py
djlduckett/Genome_Resources
0
48981
<filename>contig_lengths.py #!/usr/bin/env python ###Imports### import numpy as np import pandas as pd import re import sys import collections import csv ###Definitions### vcf_file = sys.argv[1] out_file = 'lengths.txt' ###Functions### def get_header_lines(vcf_file): lines = [] comment = True with o...
3.15625
3
cpdb/data/migrations/0114_attachmentfile_add_fields.py
invinst/CPDBv2_backend
25
48982
<gh_stars>10-100 # Generated by Django 2.1.3 on 2019-02-25 03:08 from django.db import migrations, models from django.db import migrations, models from django.conf import settings import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('data', '0113_attachmentfile_updat...
1.679688
2
pyboletox/Cnab/Retorno/Cnab400/detalhe.py
lucasbrahm/pyboletox
1
48983
<gh_stars>1-10 from datetime import datetime from pyboletox.Contracts.Cnab.Retorno.Cnab400.detalhe import Detalhe as DetalheContract from pyboletox.magicTrait import MagicTrait class Detalhe(MagicTrait, DetalheContract): def __init__(self) -> None: super().__init__() self._carteira = None ...
2.40625
2
packages/M2Crypto-0.21.1/demo/ssl/xmlrpc_cli.py
RaphaelPrevost/Back2Shops
0
48984
<reponame>RaphaelPrevost/Back2Shops #!/usr/bin/env python """Demonstration of M2Crypto.xmlrpclib2. Copyright (c) 1999-2004 <NAME>. All rights reserved.""" from M2Crypto import Rand from M2Crypto.m2xmlrpclib import Server, SSL_Transport def ZServerSSL(): # Server is Zope-2.6.4 on ZServerSSL/0.12. zs = Server...
2.28125
2
server/template/views.py
Zhe-Shen/CloudTides
3
48985
<reponame>Zhe-Shen/CloudTides from django.shortcuts import render import os from django.conf import settings from rest_framework.response import Response from rest_framework.views import APIView import json import datetime from .models import * from django.core.files.storage import default_storage from django.utils im...
1.921875
2
channel.py
zexihuang/raft-blockchain
1
48986
import socket import time import random import logging from _thread import start_new_thread from threading import Lock import utils class Channel: MAX_CONNECTION = 100 BUFFER_SIZE = 65536 CHANNEL_PORT = 10000 CLIENT_PORTS = { 0: 10001, 1: 10002, 2: 10003 } SERVER_PORTS...
2.796875
3
synology_api/__init__.py
migelbd/synology-api
0
48987
from . import exceptions from .downloadstation import DownloadStation from .filestation import FileStation from .audiostation import AudioStation from .sys_info import SysInfo from .virtualization import Virtualization from .backup import Backup
0.941406
1
cellpainter/main_gui.py
pharmbio/robot-remote-control
1
48988
<reponame>pharmbio/robot-remote-control<gh_stars>1-10 from __future__ import annotations from typing import * from .utils.viable import js from .utils.viable import serve, trim, button, pre from .utils.viable import Tag, div, span, label from .utils import viable as V from .utils.provenance import Var, Int, Str, Store...
1.867188
2
openmm_oemc/opoenmm_oemc/__init__.py
jht0664/Utility_python_gromacs
1
48989
#!/usr/local/bin/env python """ Python libraries for osmotic ensemble simulation which is an expanded ensemble for fixed (N_A, mu_B, P, T) in OpenMM. """ # define global version from openmm_oemc import version __version__ = version.version # import modules from openmm_oemc import cfc, integrator, opt_wl, constant
1.210938
1
python/Lib/site-packages/tectle/shipping.py
ksritharan/tectle
1
48990
<reponame>ksritharan/tectle<gh_stars>1-10 from .config import load_config, is_debug from .db import get_connection, get_data_dict from flask import render_template, session from datetime import datetime from time import sleep, process_time import requests import logging logger = logging.getLogger() def create_shippin...
2.21875
2
03-Use-classes/Turtle-Mini_project/drawing_a_flower.py
francisrod01/udacity_python_foundations
0
48991
#!~/envs/udacity-python-env import turtle def draw_flower(some_turtle): for i in range(1, 3): some_turtle.forward(100) some_turtle.right(60) some_turtle.forward(100) some_turtle.right(120) def draw_art(): window = turtle.Screen() window.bgcolor("grey") # Create the ...
4.25
4
InvenTree/stock/__init__.py
ArakniD/InvenTree
656
48992
<reponame>ArakniD/InvenTree """ The Stock module is responsible for Stock management. It includes models for: - StockLocation - StockItem - StockItemTracking """
0.980469
1
ansible/plugins/action/hashivault_write_from_file.py
ayav09/ansible-modules-hashivault
402
48993
######################################################################## # # Developed for AT&T by <NAME>, August 2017 # # Action plugin for hashivault_write_from_file module. # # Reads file from remote host using slurp module. (base64 encoded) # Stores file/secret to Vault using hashivault_read module on localhost. # ...
2.109375
2
mywork/dataDownload/plotFuturesIndexComponentsFromSina.py
linbian/tqsdk-python
0
48994
<gh_stars>0 from datetime import datetime, timedelta import time import requests import json from matplotlib.pylab import date2num from matplotlib import pyplot as plt import mpl_finance as mpf from pandas import DataFrame import talib as ta import numpy as np import sys sys.path.append('..') import DictCode as dc pl...
2.671875
3
code.py
aj02/olympic-hero
0
48995
<gh_stars>0 # -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file path #Code starts here data = pd.read_csv(path) data.rename(columns={'Total' : 'Total_Medals'}, inplace=True) print(data.head()) # -------------- #Code starts ...
3.265625
3
server.py
ToadyMcFrogFace/fullstack-assessment
0
48996
from tornado import httpserver from tornado import gen from tornado.ioloop import IOLoop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write('Hello, world') class Application(tornado.web.Application): def __init__(self): handlers = [ (r"/?", ...
2.640625
3
src/numkit/tests/test_fitting.py
Becksteinlab/numkit
2
48997
<filename>src/numkit/tests/test_fitting.py # -*- coding: utf-8 -*- # numkit.integration test cases # Part of GromacsWrapper # Copyright (c) <NAME> <<EMAIL>> # Published under the Modified BSD Licence. """ =================================== Test cases for numkit.fitting ==================================== """ impor...
2.578125
3
run-wlnn-mnist.py
jrieke/evolution-learning
5
48998
#!/usr/bin/env python3 """ Evolve network architecture on a classification dataset, while at the same time training the weights with one of several learning algorithms. """ import joblib import time import torch.utils.data import logging import numpy as np import copy import os import pickle from networks import Weigh...
2.515625
3
Utilities/CPUmining.py
C3ald/Token-Project
1
48999
import time as t import hashlib class Calibrate: """ Calibration class for CPU mining """ def __init__(self): pass def calibrate(self): """ Calibrates the cpu power """ time_started = t.time() for x in range(10000000): hashlib.sha512('hash'.encode()) hashlib.blake2b('hash'.encode()) time_finished ...
3.453125
3