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
steps/app/migrations/0006_auto_20180330_1816.py
VishalCR7/steps
0
28500
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-30 12:46 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0005_auto_20180330_1813'), ] operations = [ ...
1.65625
2
users.py
mavi0/onos-reroute-api
0
28501
<filename>users.py<gh_stars>0 import json, base64 import logging, coloredlogs import hashlib, copy from flask_table import Table, Col logger = logging.getLogger(__name__) coloredlogs.install(level='INFO') class Users: def __init__(self): self.__users = self.__load_users("json/users.json") self....
2.609375
3
tests/test_win_app.py
koyoki/Airtest
6,140
28502
# encoding=utf-8 from airtest.core.win import Windows import unittest import numpy import time from testconf import try_remove SNAPSHOT = "win_snapshot.png" class TestWin(unittest.TestCase): @classmethod def setUpClass(cls): w = Windows() w.start_app("calc") time.sleep(1) cl...
2.265625
2
testing_app.py
michal090497/python-fruits-recognition
1
28503
# Import required libraries import cv2 from os.path import os, dirname import tensorflow as tf import numpy as np from tqdm import tqdm import random # List of categories (directories names) CATEGORIES = ["bad_apple", "bad_grape", "bad_pear", "cherry", "good_apple", "good_avocado", "good_grape", "good_pear", "ripe_avo...
2.6875
3
scylla/datadog_checks/scylla/metrics.py
tzach/integrations-core
0
28504
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) # metrics namespaced under 'scylla' SCYLLA_ALIEN = { 'scylla_alien_receive_batch_queue_length': 'alien.receive_batch_queue_length', 'scylla_alien_total_received_messages': 'alien.total_received_me...
1.328125
1
simple_rest_client/resource.py
Manre/python-simple-rest-client
1
28505
<gh_stars>1-10 import logging from types import MethodType from urllib.parse import urljoin import aiohttp import requests from json_encoder import json from .exceptions import ActionNotFound, ActionURLMatchError from .models import Request from .request import make_request, make_async_request logger = logging.getLo...
2.125
2
pyrsa/io/meadows.py
PeerHerholz/pyrsa
4
28506
"""Covers import of data downloaded from the `Meadows online behavior platform <https://meadows-research.com/>`_. For information on available file types see the meadows `documentation on downloads <https://meadows-research.com/documentation\ /researcher/downloads/>`_. """ from os.path import basename import numpy fr...
2.59375
3
wqxlib-python/wqxlib/wqx_v3_0/AttachedBinaryObject.py
FlippingBinary/wqxlib
0
28507
<filename>wqxlib-python/wqxlib/wqx_v3_0/AttachedBinaryObject.py from ..common import WQXException from .SimpleContent import ( BinaryObjectFileName, BinaryObjectFileTypeCode ) from yattag import Doc class AttachedBinaryObject: """Reference document, image, photo, GIS data layer, laboratory material or other elec...
2.15625
2
instrument.py
silvergl/spyder
0
28508
<reponame>silvergl/spyder import os import importlib import pathlib from tools.Aspect import ModuleAspectizer path = os.getcwd() dir_list = os.listdir(path) print(dir_list) aspect = ModuleAspectizer() print('new') exceptions = ['pyplot.py', 'setup.py', 'bootstrap.py', 'instrument.py', 'windows.py','pybl...
2.046875
2
tests/test_puls_util.py
xiaohan2012/capitalization-restoration-train
1
28509
<gh_stars>1-10 import json import os import codecs from capitalization_train.puls_util import (separate_title_from_body, extract_and_capitalize_headlines_from_corpus, get_input_example, ge...
2.546875
3
python/app.py
ncolesummers/microservices-calculator
0
28510
<filename>python/app.py<gh_stars>0 import flask from flask import request, jsonify from flask_cors import CORS import math from wasmer import engine, Store, Module, Instance app = flask.Flask(__name__) CORS(app) @app.route('/add', methods=['POST']) def add(): store = Store() # Let's compile the module to be ab...
2.875
3
src/tools/nuscenes-devkit/prediction/tests/test_backbone.py
jie311/TraDeS
475
28511
import unittest import torch from torchvision.models.resnet import BasicBlock, Bottleneck from nuscenes.prediction.models.backbone import ResNetBackbone, MobileNetBackbone class TestBackBones(unittest.TestCase): def count_layers(self, model): if isinstance(model[4][0], BasicBlock): n_convs ...
2.421875
2
py_code/Qrbar_test.py
xiaofu98/cv_projects
0
28512
#!/usr/bin/python3 # -*- coding: utf-8 -*- # @File : Qrbar_test.py import cv2 import numpy as np from pyzbar.pyzbar import decode img = cv2.imread('qrcode.png') for barcode in decode(img): print(barcode.data.decode('utf-8')) print(barcode.data) pts = np.array([barcode.polygon], np.int32) pts = pts....
2.875
3
jupyterlab-mlops/jupyter_server_config.py
ddebowczyk92/jupyter-images
0
28513
<filename>jupyterlab-mlops/jupyter_server_config.py import os import requests import time c = get_config() # noqa: F821 c.ServerApp.ip = "0.0.0.0" c.ServerApp.port = 8888 c.ServerApp.open_browser = False def get_gooogle_instance_attribute(attribute_name): try: response = requests.get( f'h...
2.09375
2
src/loss/mixup.py
jiangtaoo2333/StaticGestureRecognition
0
28514
<reponame>jiangtaoo2333/StaticGestureRecognition ''' @Author: Jiangtao @Date: 2020-02-25 16:13:42 @LastEditors: Jiangtao @LastEditTime: 2020-07-06 14:01:11 @Description: ''' import numpy as np np.set_printoptions(threshold=np.inf) import torch import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.pat...
2.09375
2
task2.py
gor-dimm/prog_lr5
0
28515
<reponame>gor-dimm/prog_lr5 #Среднее гармоническое #!/usr/bin/env python3 # -*- coding: utf-8 -*- def harmid(*args): if args and 0 not in args: a = 0 for item in args: a += 1 / item return len(args) / a else: return None if __name__ == "__main__": prin...
2.90625
3
login.py
josip8/EwilTwin-attack
0
28516
<reponame>josip8/EwilTwin-attack import argparse import sys import datetime import json import logging import re import random import requests import shutil from pyquery import PyQuery as pq def main(username, password): logging.basicConfig(filename='logging.log', level=logging.DEBUG) session = requests.ses...
2.640625
3
piptegrator/piptegrator.py
MartinFalatic/piptegrator
1
28517
#!/usr/bin/env python """ """ from __future__ import print_function import argparse import sys from . import common from . import helper from . import vcs_tool PARAMS = {} PARAMS['this_script'] = common.get_script_name_from_filename(__file__) def setup_and_dispatch(): parser = argparse.ArgumentParser( ...
2.25
2
seller/models.py
apt-developer/SoloMall
0
28518
from django.db import models # from themall.models import Customer # Create your models here. class Seller(models.Model): email = models.OneToOneField('themall.Customer', on_delete=models.CASCADE, to_field='email') store_name = models.CharField(max_length=100) slug = models.SlugField(max_length=100) descrip...
2.359375
2
test/pytest/service-bluetooth/test_pairing_hmi_perspective.py
bitigchi/MuditaOS
369
28519
# Copyright (c) 2017-2021, <NAME>. All rights reserved. # For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md import time import pytest from harness import log from harness.dom_parser_utils import * from harness.interface.defs import key_codes from bt_fixtures import * @pytest.mark.rt1051 @pytest.mark.us...
1.835938
2
server/src/utils/mailer.py
ocskier/TutorDashboard
1
28520
import smtplib, ssl, os from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from .html_template import emailHtml from .text_template import emailText port = 465 context = ssl.create_default_context() def sendEmail(emailData): adminUser = os.getenv("ADMIN_USERNAME") password =...
2.75
3
otcextensions/sdk/dis/v2/records.py
zsoltn/python-otcextensions
0
28521
<reponame>zsoltn/python-otcextensions # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
1.820313
2
ad-insertion/frontend/main.py
dahanhan/Ad-Insertion-Sample
82
28522
<reponame>dahanhan/Ad-Insertion-Sample #!/usr/bin/python3 from tornado import ioloop, web from tornado.options import define, options, parse_command_line from manifest import ManifestHandler from segment import SegmentHandler app = web.Application([ (r'/segment/.*',SegmentHandler), (r'/manifest/.*',ManifestHa...
2.015625
2
cofile/output-filename.py
yikeke/python-side-projects
3
28523
<gh_stars>1-10 import os for root, dirs, files in os.walk("/Users/coco/Documents/GitHub/pingcap-upstream/docs-cn", topdown=True): #for root, dirs, files in os.walk("/Users/coco/Documents/GitHub/python-side-projects/cofile", topdown=True): for name in files: if '.md' in name: # Check all markdown files ...
2.671875
3
dbml_from_api.py
ioatzim/getbigschema
0
28524
import requests import os import json import datetime ''' Pulls a dbml file from the API. User must manually add the file id, found in the 'response_ids.json' file generated from dbml_post_to_api.py ''' url='http://ec2-54-167-67-34.compute-1.amazonaws.com/api/dbmls' #url of the API id = '6192b1f31c2a512293f...
3.15625
3
fabfile.py
undertherain/dagen
2
28525
<filename>fabfile.py import os from fabric.api import local, lcd def clean(): with lcd(os.path.dirname(__file__)): local("python3.6 setup.py clean --all") local("find . | grep -E \"(__pycache__|\.pyc$)\" | xargs rm -rf") def make(): local("python3.6 setup.py bdist_wheel") def deploy(): ...
1.820313
2
Package1/Util.py
mgi2792/WebTest
0
28526
from openpyxl import load_workbook def getRowCount(file): wb = load_workbook(file) sheet = wb.active return sheet.max_row def getColumnCount(file): wb = load_workbook(file) sheet = wb.active return sheet.max_column def getCellData(file, cell): wb = load_workbook(file) sheet = wb.acti...
2.96875
3
clancy_database/__init__.py
arthurian/visualizing_russian_tools
2
28527
# List of tables that should be routed to this app. # Note that this is not intended to be a complete list of the available tables. TABLE_NAMES = ( 'lemma', 'inflection', 'aspect_pair', )
1.25
1
differential/plugins/gazelle.py
funqc/Differential
52
28528
import argparse from differential.plugins.base import Base class Gazelle(Base): @classmethod def get_aliases(cls): return "gz", @classmethod def get_help(cls): return "Gazelle插件,适用于未经过大规模结构改动的Gazelle站点" @classmethod def add_parser(cls, parser: argparse.ArgumentParser) -> arg...
2.3125
2
tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[tr_TR-2014] 1.py
gour/holidata
32
28529
<reponame>gour/holidata [ { 'date': '2014-01-01', 'description': 'Yılbaşı', 'locale': 'tr-TR', 'notes': '', 'region': '', 'type': 'NF' }, { 'date': '2014-04-23', 'description': 'Ulusal Egemenlik ve Çocuk Bayramı', 'locale': 'tr-TR', ...
1.273438
1
pommerman/agents/TensorFlowAgent/pit.py
IshchenkoRoman/pommerman
0
28530
# pommerman/cli/run_battle.py # pommerman/agents/TensorFlowAgent/pit.py import atexit from datetime import datetime import os import random import sys import time import argparse import numpy as np from pommerman import helpers, make from TensorFlowAgent import TensorFlowAgent from pommerman import utility import ...
2.171875
2
test/test_mean_average_precision.py
JuanchoWang/xcenternet
171
28531
import numpy as np import tensorflow as tf import unittest from xcenternet.model.evaluation.overlap import compute_overlap from xcenternet.model.evaluation.mean_average_precision import MAP class TestMeanAveragePrecision(unittest.TestCase): def setUp(self): self.map_bboxes = np.array( [ ...
2.125
2
sonnet/examples/rmc_learn_to_execute_test.py
ankitshah009/sonnet
3
28532
# Copyright 2017 The Sonnet 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 l...
1.984375
2
reflex/src/reflex/reflex_polling.py
EnricoSartori/reflex_ros_pkg
0
28533
<filename>reflex/src/reflex/reflex_polling.py<gh_stars>0 #!/usr/bin/env python import rospy from reflex_msgs.msg import HandCommand from time import sleep from reflex_base_services import * class ReFlex_Polling(ReFlex): def __init__(self): super(ReFlex_Polling, self).__init__() def cal...
2.484375
2
kf_d3m_primitives/natural_language_processing/sent2vec/sent2vec.py
cdbethune/d3m-primitives
0
28534
import os.path from typing import Sequence, Optional, Dict import numpy as np import pandas as pd from nk_sent2vec import Sent2Vec as _Sent2Vec from d3m import container, utils from d3m.primitive_interfaces.transformer import TransformerPrimitiveBase from d3m.primitive_interfaces.base import CallResult from d3m.contai...
2.359375
2
tests/integration/test_user_defined_object_persistence/test.py
pdv-ru/ClickHouse
15,577
28535
<filename>tests/integration/test_user_defined_object_persistence/test.py import pytest from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) instance = cluster.add_instance('instance', stay_alive=True) @pytest.fixture(scope="module", autouse=True) def started_cluster(): try: ...
2.484375
2
python/brainvisa/maker/brainvisa_clients.py
brainvisa/brainvisa-cmake
0
28536
<filename>python/brainvisa/maker/brainvisa_clients.py # -*- coding: utf-8 -*- # This software and supporting documentation are distributed by # Institut Federatif de Recherche 49 # CEA/NeuroSpin, Batiment 145, # 91191 Gif-sur-Yvette cedex # France # # This software is governed by the CeCILL-B lice...
1.640625
2
test/test_del_contact.py
rokimaru/python_training
0
28537
<filename>test/test_del_contact.py import random import pytest from model.contact import Contact def test_delete_some_contact(app, db, check_ui): if len(db.get_group_list()) == 0: app.contact.create(Contact(firstname="del_test")) with pytest.allure.step('Get contact list'): old_contacts = db...
2.421875
2
slate/integrations/backtesting_py.py
EmersonDove/slate-python
1
28538
<reponame>EmersonDove/slate-python from operator import itemgetter import pandas as pd import slate from slate.integrations.common import b_id, DUMMY_METRICS, DUMMY_INDICATORS try: import backtesting except ImportError: pass class BacktestingPy: slate: 'slate.Slate' api: 'slate.api.API' def __...
2.4375
2
python exercicios/Listas/lista6.py
gabrielqoliveiraa/bomdia
0
28539
nome = [] temp = [] pesoMaior = pesoMenor = 0 count = 1 while True: temp.append(str(input('Nome: '))) temp.append(float(input('Peso: '))) if count == 1: pesoMaior = pesoMenor = temp[1] else: if temp[1] >= pesoMaior: pesoMaior = temp[1] elif temp[1] <= pesoMenor: ...
3.8125
4
beetles/scripts/inference_runner.py
ESA-PhiLab/hypernet
34
28540
<reponame>ESA-PhiLab/hypernet """ Run inference N times on the provided model given set of hyperparameters. Has the option to inject noise into the test set. """ import os import shutil import re import clize import mlflow import tensorflow as tf from clize.parameters import multi from ml_intuition.data.io import lo...
2.375
2
statutes_pipeline_steps/de_authority_edgelist.py
QuantLaw/legal-data-preprocessing
5
28541
<filename>statutes_pipeline_steps/de_authority_edgelist.py import json import os import numpy import pandas as pd from quantlaw.utils.beautiful_soup import create_soup from quantlaw.utils.files import ensure_exists from quantlaw.utils.pipeline import PipelineStep from statics import ( DE_REFERENCE_PARSED_PATH, ...
2.28125
2
test-crates/hello-world/check_installed/check_installed.py
pattonw/pyo3-pack
0
28542
<gh_stars>0 from subprocess import check_output def main(): output = check_output(["hello-world"]).decode("utf-8").strip() if not output == "Hello, world!": raise Exception(output) print("SUCCESS") if __name__ == '__main__': main()
2.9375
3
opp/baseline_lrrf_upper.py
heeryoncho/sensors2018cnnhar
10
28543
<gh_stars>1-10 from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier import select_data as sd ''' See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s18041055 "Divide a...
2.828125
3
core/validators/admin.py
M-Spencer-94/configNOW
3
28544
# ============================================================================ # # Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd, # All Rights Reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL...
1.992188
2
doc/plots/stats/moments_expw.py
breisfeld/pandas
10
28545
<reponame>breisfeld/pandas from moment_plots import * np.random.seed(1) ts = test_series(500) * 10 # ts[::100] = 20 s = ts.cumsum() fig, axes = plt.subplots(3, 1, figsize=(8, 10), sharex=True) ax0, ax1, ax2 = axes ax0.plot(s.index, s.values) ax0.set_title('time series') ax1.plot(s.index, m.ewma(s, span=50, min_...
2.359375
2
RunMatch.py
fredboe/monte-carlo-tree-search
1
28546
import sys # import the GameState of the game from Game.GameStateConnect4 import GameState # import all agents from Agents.MCTS import MCTSTree from Agents.Random import RandomAgent from Agents.AlphaBeta import AlphaBetaAgent # creates the board string for connect4 (full of zeros) start_board_list = ["000000 ...
3.109375
3
elizabot.py
batisteo/elizabot
0
28547
<reponame>batisteo/elizabot import os from time import sleep import aiohttp from aiotg import Bot CLEVERBOT = "https://www.cleverbot.com/getreply?key={key}&input={q}" APERTIUM = 'http://batisteo.eu:2737/translate?markUnknown=no&q={q}&langpair={pair}' CLEVERBOT_TOKEN = os.environ['CLEVERBOT_TOKEN'] bot = Bot(api_toke...
2.734375
3
resilient-circuits/resilient_circuits/__init__.py
COLDTURNIP/resilient-python-api
28
28548
<gh_stars>10-100 # (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved. import pkg_resources try: __version__ = pkg_resources.get_distribution(__name__).version except pkg_resources.DistributionNotFound: __version__ = None from .actions_component import ResilientComponent from .action_message import Actio...
1.421875
1
pastas/transform.py
pgraafstra/pastas
0
28549
<filename>pastas/transform.py """The transforms module contains all the transforms that can be added to the simulation of a model. These transforms are applied after the simulation, to incorporate nonlinear effects. """ import numpy as np from pandas import DataFrame class ThresholdTransform: """ThresholdTrans...
3.796875
4
pymockdata/datasets/default.py
vladcalin/py-mock-data-generator
2
28550
import string from ..datasets import Dataset uppercase_ascii_letters = Dataset("uppercase_letter", None, string.ascii_uppercase) lowercase_ascii_letters = Dataset("lowercase_letter", None, string.ascii_lowercase) ascii_letters = Dataset("letter", None, string.ascii_letters) digits = Dataset("digit", None, string.dig...
2.859375
3
Day 23/ViralAdvertising.py
sandeep-krishna/100DaysOfCode
0
28551
''' HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly people on social media. On the first day, half of those people (i.e., ) like the advertisement and each shares it with of their friends. At the beginning of the second day, people re...
4.21875
4
python2.7libs/hammer_tools/material_library/image.py
anvdev/Hammer-Tools
19
28552
import os import subprocess import tempfile try: from PyQt5.QtCore import QBuffer, QIODevice, Qt from PyQt5.QtGui import QImage except ImportError: from PySide2.QtCore import QBuffer, QIODevice, Qt from PySide2.QtGui import QImage from .texture_format import TextureFormat def imageToBytes(image): ...
2.453125
2
pypipe/apps/utils/fill_treectrl.py
AGrigis/pypipe
0
28553
########################################################################## # PyPipe - Copyright (C) AGrigis, 2017 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for details. ####...
2.65625
3
lib/crossmatching.py
leejjoon/pystilts
4
28554
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 02/06/17 at 2:24 PM @author: neil Program description here Version 0.0.0 """ from . import constants from . import utils from astropy import units as u # ============================================================================= # Def...
2.5
2
gather/glasgowpicarro/__init__.py
openghg/gather
0
28555
from ._process import process_pipeline __all__ = ["process_pipeline"]
1.046875
1
underworld/conditions/_conditions.py
longgangfan/underworld2
116
28556
<filename>underworld/conditions/_conditions.py ##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## ## ## ## This file forms part of the Underworld geophysics modelling application. ## ## ...
2.328125
2
tests/integration/cli/test_test.py
Ninjagod1251/ape
0
28557
from .utils import skip_projects_except @skip_projects_except(["test"]) def test_test(ape_cli, runner): # test cases implicitly test built-in isolation result = runner.invoke(ape_cli, ["test"]) assert result.exit_code == 0, result.output @skip_projects_except(["test"]) def test_test_isolation_disabled(a...
2.125
2
binary-list-generator.py
rj011/Hacktoberfest2021-4
41
28558
<reponame>rj011/Hacktoberfest2021-4<filename>binary-list-generator.py # Necro(ネクロ) # <EMAIL> def binaryGenerator(n): pad = [0]*n res = [] for _ in range(2**n): num = list(map(int, bin(_)[2:])) num = pad[:n-len(num)]+num res.append(num) return res if __name__ == '__main__': p...
3.609375
4
inferlo/testing/experiment_runner_test.py
InferLO/inferlo
1
28559
<reponame>InferLO/inferlo<gh_stars>1-10 # Copyright (c) The InferLO authors. All rights reserved. # Licensed under the Apache License, Version 2.0 - see LICENSE. from inferlo.testing import ExperimentRunner def test_run_experiment(): def my_experiment(x=0): return {"square": x * x, "cube": x * x * x} ...
2.53125
3
py2sqlite/py2sql.py
ehorTL/py2sqlite
0
28560
""" Module implements simple ORM for SQLite. Module excludes using many-to-many and one-to-many relationships. Trying to save the same object (update) with another aggregated object will rewrite old object! """ import os import sqlite3 from array import array from inspect import * import builtins import sys import lo...
3.109375
3
azure-iot-device/azure/iot/device/provisioning/security/sk_security_client.py
olivakar/azure-iot-sdk-python
35
28561
<gh_stars>10-100 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
2.328125
2
scripts/geodata/phrases/extraction.py
Fillr/libpostal
3,489
28562
<reponame>Fillr/libpostal<gh_stars>1000+ import csv import six from collections import defaultdict, Counter from itertools import izip, islice from geodata.text.tokenize import tokenize, token_types from geodata.encoding import safe_encode class FrequentPhraseExtractor(object): ''' Extract common multi-word...
2.84375
3
mestopy/mestopy.py
pyfar-seminar/mestopy
0
28563
<filename>mestopy/mestopy.py from scipy.signal import oaconvolve from pyfar import Signal # Class to generate ref-Objects, that can bei part of the MeasurementChain class Device(object): """Class for device in MeasurementChain. This class holds methods and properties of a device in the 'MeasurementChain'...
2.984375
3
setup.py
Chichilele/algorithms
0
28564
from setuptools import setup, find_packages with open("README.md", "r") as fh: long_description = fh.read() setup( name="algorithms", version="0.1", description="Implements a few optimisation algorithms", long_description=long_description, long_description_content_type="text/markdown", ur...
1.476563
1
bifurcation.py
lisah298/PathReducer
0
28565
import pandas as pd import dimensionality_reduction_functions as dim_red from plotting_functions import colored_line_plot, colored_line_and_scatter_plot, colored_line_plot_projected_data # Number of PCA components ndim = 3 ####################################### EXAMPLE 4: CYCLOPROPYLIDENE BIFURCATION ###############...
2.734375
3
test/hummingbot/connector/exchange/bitfinex/test_bitfinex_api_order_book_data_source.py
BGTCapital/hummingbot
3,027
28566
<filename>test/hummingbot/connector/exchange/bitfinex/test_bitfinex_api_order_book_data_source.py import asyncio import json from unittest import TestCase from aioresponses import aioresponses import hummingbot.connector.exchange.bitfinex.bitfinex_utils as utils from hummingbot.connector.exchange.bitfinex import BITF...
2.046875
2
pandas_loc_iloc.py
tseth92/pandas_experiments
0
28567
''' This code compares the loc and iloc in pandas dataframe ''' __author__ = "<NAME>" __email__ = "<EMAIL>" import pandas as pd import timeit df_test = pd.DataFrame() tlist = [] tlist2 = [] ################ this code creates a dataframe df_test ################## ###############with two columns and 5000000 entrie...
3.71875
4
lesson_6/task_2.py
ok-git/py_training
0
28568
<reponame>ok-git/py_training """ Реализовать класс Road (дорога), в котором определить атрибуты: length (длина), width (ширина). Значения данных атрибутов должны передаваться при создании экземпляра класса. Атрибуты сделать защищенными. Определить метод расчета массы асфальта, необходимого для покрытия всего дорожного ...
2.9375
3
cmsc_210/examples/lecture_07/war.py
mazelife/cmsc-210
0
28569
from functools import total_ordering from random import shuffle class Player: def __init__(self, name): self.name = name self.hand = [] def __str__(self): return self.name def play(self): return self.hand.pop() def receive(self, cards): for card in cards: ...
3.640625
4
paper/curve_context_acc.py
INK-USC/procedural-extraction
5
28570
import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator cz2 = (0.7, 0.7, 0.7) cz = (0.3, 0.3, 0.3) cy = (0.7, 0.4, 0.12) ci = (0.1, 0.3, 0.5) ct = (0.7, 0.2, 0.1) ax = plt.figure(figsize=(5,4)).gca() ax.xaxis.set_major_locator(MaxNLocator(integer=True)) ax.yaxis.grid(True) ax.set_...
2.34375
2
Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/ATI/pn_triangles.py
MontyThibault/centre-of-mass-awareness
0
28571
<gh_stars>0 '''OpenGL extension ATI.pn_triangles Overview (from the spec) ATI_pn_triangles provides a path for enabling the GL to internally tessellate input geometry into curved patches. The extension allows the user to tune the amount of tessellation to be performed on each triangle as a global state value...
1.992188
2
setup.py
Wi11iamDing/toad
1
28572
<filename>setup.py import os import numpy as np from setuptools import setup, find_packages, Extension NAME = 'toad' CURRENT_PATH = os.path.abspath(os.path.dirname(__file__)) VERSION_FILE = os.path.join(CURRENT_PATH, NAME, 'version.py') def get_version(): ns = {} with open(VERSION_FILE) as f: exec(...
1.9375
2
tvm_benchmark/test_resnet_inference.py
adwwsd/HAWQ
0
28573
<gh_stars>0 import torch import tvm from tvm import autotvm from tvm import relay from tvm.contrib import download from tvm.contrib.debugger import debug_runtime from PIL import Image import matplotlib.pyplot as plt import numpy as np import argparse import os from os.path import join, isfile import sys import json, ...
1.867188
2
felapps/apps/dataworkshop/dataworkshop.py
archman/felapps
2
28574
#!/usr/bin/env python # -*- coding: utf-8 -*- """ DataWorkshop: application to handle data, e.g. generated from imageviewer Author: <NAME> Created: Sep. 23rd, 2015 """ from ...utils import datautils from ...utils import miscutils from ...utils import funutils from ...utils import resutils import wx import wx.lib.mix...
2.03125
2
bayesian/auth.py
ameenfarooqi/fabric8-analytics-server
0
28575
"""Authorization token handling.""" import logging from functools import wraps from flask import g, request from requests import get from pydantic.error_wrappers import ValidationError from bayesian.utility.user_utils import get_user, UserException, UserNotFoundException from bayesian.utility.v2.sa_models import Header...
2.578125
3
FLOW007.py
ankitpipalia/codechef-solutions
1
28576
tcase = int(input()) while(tcase): str= input() [::-1] print(int(str)) tcase -= 1
3.390625
3
setup.py
ysatapathy23/TomoEncoders
0
28577
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: atekawade """ from setuptools import setup, find_packages setup( # Needed to silence warnings (and to be a worthwhile package) name='tomo_encoders', url='https://github.com/aniketkt/TomoEncoders', author='<NAME>', author_email='<EMAIL>', ...
1.296875
1
reports/executive_fullfilment_requests/entrypoint.py
ireneperezddc/connect-reports
7
28578
<filename>reports/executive_fullfilment_requests/entrypoint.py # -*- coding: utf-8 -*- # # Copyright (c) 2021, CloudBlue # All rights reserved. # import pathlib from datetime import date from tempfile import NamedTemporaryFile from collections import namedtuple import math import copy from connect.client import R from...
2.265625
2
ROS/src/spiderplan_proxy/src/spiderplan_proxy.py
uwe-koeckemann/SpiderPlan
0
28579
<reponame>uwe-koeckemann/SpiderPlan<filename>ROS/src/spiderplan_proxy/src/spiderplan_proxy.py #!/usr/bin/env python # -*- coding: utf-8 -*- #Copyright (c) 2015 <NAME> <<EMAIL>> #Permission is hereby granted, free of charge, to any person obtaining #a copy of this software and associated documentation files (the #"Sof...
1.726563
2
components/gpio_control/GPIODevices/simple_button.py
steffakasid/RPi-Jukebox-RFID
1,010
28580
import time from signal import pause import logging import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) logger = logging.getLogger(__name__) map_edge_parse = {'falling':GPIO.FALLING, 'rising':GPIO.RISING, 'both':GPIO.BOTH} map_pull_parse = {'pull_up':GPIO.PUD_UP, 'pull_down':GPIO.PUD_DOWN, 'pull_off':GPIO.PUD_OFF} map_edg...
2.75
3
pyatdllib/ui/immaculater.py
lisagorewitdecker/immaculater
0
28581
<reponame>lisagorewitdecker/immaculater<filename>pyatdllib/ui/immaculater.py #!/usr/bin/python """A command-line interface to pyatdl, yet another to-do list. The most important command is 'help'. The key notions are Action, Context, Folder, and Project. The commands use the filesystem idiom. Actions and Contexts are...
2.203125
2
setup.py
raghavsub/gtkpass
1
28582
from setuptools import setup setup(name='gtkpass', version='0.2.7', description='A GTK+ 3 program for the standard unix password manager', url='http://github.com/raghavsub/gtkpass', author='<NAME>', author_email='<EMAIL>', license='MIT', packages=['gtkpass'], entry_point...
1.15625
1
restApi/resources/rides.py
Kitingu/restplus
0
28583
<reponame>Kitingu/restplus from flask_restplus import Resource, fields, Namespace from restApi.models.rides import Rides from restApi.helpers.ride_helpers import RideParser from .auth import token_required Ride_object = Rides() ride_api = Namespace("rides", description="this are routes that allow users to create get ...
2.765625
3
services/ui_backend_service/tests/integration_tests/tasks_test.py
runsascoded/metaflow-service
103
28584
import pytest import time from .utils import ( init_app, init_db, clean_db, add_flow, add_run, add_step, add_task, add_artifact, _test_list_resources, _test_single_resource, add_metadata, get_heartbeat_ts ) pytestmark = [pytest.mark.integration_tests] # Fixtures begin @pytest.fixture def cli(loop, aiohtt...
1.953125
2
apps/my_app/handlers.py
opaniagu/fastapi_mongodb
0
28585
<filename>apps/my_app/handlers.py import datetime import fastapi import pymongo import pymongo.errors import pymongo.results from apps.common.enums import CodeAudiences from apps.common.handlers import PasswordsHandler, TokensHandler from fastapi_mongodb.exceptions import HandlerException, RepositoryExcept...
2.171875
2
trainer.py
icrdr/3D-UNet-Renal-Anatomy-Extraction
0
28586
import torch from torch.optim import lr_scheduler from tqdm import tqdm from torchsummary import summary from torch.utils.tensorboard import SummaryWriter from apex import amp from loss import dice from pathlib import Path from data import CaseDataset, load_case, save_pred, \ orient_crop_case, regions_crop_case, re...
1.679688
2
workers/standard_methods.py
mahmoudthabit/augur
0
28587
<filename>workers/standard_methods.py """ Helper methods constant across all workers """ import requests, datetime, time import sqlalchemy as s import pandas as pd def connect_to_broker(self, logging): connected = False for i in range(5): try: logging.info("attempt {}".format(i)) ...
2.21875
2
study/python-brasil/exercises/sequential-structure/sequential-structure - 006.py
gustavomarquezinho/python
0
28588
<reponame>gustavomarquezinho/python<filename>study/python-brasil/exercises/sequential-structure/sequential-structure - 006.py<gh_stars>0 # 006 - Faça um programa que peça o raio de um círculo, calcule e mostre sua área. print(f'Área: {3.14 * pow(float(input("Raio círculo: ")), 2)}')
4.03125
4
Createmodele_V13_1.1.py
pad-awan/domotiquesante
0
28589
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 09 22:25:07 2019 @author: arnaudhub """ #import pandas as pd from sqlalchemy import create_engine from sqlalchemy.sql import text import configparser,os from urllib import parse #import sql.connector config = configparser.ConfigParser() config.re...
2.515625
3
multiml/agent/pytorch/pytorch_asngnas.py
UTokyo-ICEPP/multiml
7
28590
from multiml import logger from multiml.task.pytorch import PytorchASNGNASTask from multiml.task.pytorch import PytorchASNGNASBlockTask from . import PytorchConnectionRandomSearchAgent from multiml.task.pytorch.datasets import StoreGateDataset, NumpyDataset import numpy as np class PytorchASNGNASAgent(PytorchConnect...
2.328125
2
tests/integration/controller/fixtures.py
jlamoso/petisco
0
28591
import os import pytest from petisco import FlaskApplication SWAGGER_DIR = os.path.dirname(os.path.abspath(__file__)) + "/application/" app = FlaskApplication(application_name="petisco", swagger_dir=SWAGGER_DIR).get_app() @pytest.fixture def client(): with app.app.test_client() as c: yield c @pytest...
2.109375
2
authors/apps/authentication/tests/test_register.py
andela/ah-code-titans
0
28592
<gh_stars>0 from rest_framework import status from django.urls import reverse from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode from ..models import User from ..token import account_activation_token # local import from authors.base_test_config import TestConfiguration ...
2.328125
2
web_app/routes/stats_routes.py
jae-finger/twitoff
0
28593
from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression from flask import Blueprint, jsonify, request, flash, redirect, render_template from web_app.models import User from web_app.statsmodels import load_model from web_app.services.basilica_service import connection as basilica_con...
2.8125
3
tests/unit/test_parameters/test_geometric_parameters.py
manjunathnilugal/PyBaMM
330
28594
<reponame>manjunathnilugal/PyBaMM # # Tests for the standard parameters # import pybamm import unittest class TestGeometricParameters(unittest.TestCase): def test_macroscale_parameters(self): geo = pybamm.geometric_parameters L_n = geo.L_n L_s = geo.L_s L_p = geo.L_p L_x =...
2.296875
2
src/preprocessing1/convert_ctrees_to_dtrees_rstdt.py
norikinishida/discourse-parsing
2
28595
import argparse import os import pyprind import utils import treetk import treetk.rstdt def main(args): """ We use n-ary ctrees (ie., *.labeled.nary.ctree) to generate dtrees. Morey et al. (2018) demonstrate that scores evaluated on these dtrees are superficially lower than those on right-heavy binarize...
2.515625
3
vinyl.py
jsonmorberg/Vinyl-Bot
1
28596
<reponame>jsonmorberg/Vinyl-Bot # vinyl.py import os import discord from discord import voice_client from audio_source import AudioSource from audio_controller import AudioController import yt_dlp from dotenv import load_dotenv from discord.ext import commands load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') # Suppre...
2.71875
3
tests/test_components/test_lenses/test_AchromLens.py
spacesys-finch/payload-designer
2
28597
<filename>tests/test_components/test_lenses/test_AchromLens.py """Tests for AchromLens component.""" # stdlib import logging # external import pytest # project from payload_designer.components import lenses LOG = logging.getLogger(__name__) def test_focal_length_1(): """Test AchromLens.focal_length_1()""" ...
2.5625
3
python/demos/mcEstimatePi.py
qyxiao/pmt
0
28598
<gh_stars>0 #!/usr/bin/env python import matplotlib.pyplot as pl import numpy as np p = np.random.rand(5000, 2) * 4 - 2 inner = np.sum(p ** 2, axis=1) <= 4 pl.figure(figsize=(10, 10)) pl.plot(p[inner, 0], p[inner, 1], 'bo') pl.plot(p[~inner, 0], p[~inner, 1], 'rD') pi_estimate = np.sum(inner) / 5000 * 4 print('the e...
2.65625
3
src/utils/hdf5_helper/h5_util.py
SteffenMauceri/OWLS-Autonomy
0
28599
from contextlib import closing import h5py import numpy as np def save_h5(outfile, dictionary): """ Saves passed dictionary to an h5 file Parameters ---------- outfile : string Name of output h5 file dictionary : dictionary Dictionary that will be saved """ def save_layer(...
2.78125
3