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
service_matcher_app/service_matcher/models.py
City-of-Turku/PaohServiceMatchEngine
0
14000
<reponame>City-of-Turku/PaohServiceMatchEngine from datetime import datetime from pydantic import BaseModel from typing import Optional, List from fastapi import Query class Service(BaseModel): """ A class for single service """ id: str ptvId: Optional[str] = None type: Optional[str] = None ...
2.59375
3
src/test/testcases/testPSUReadSbeMem.py
open-power/sbe
9
14001
# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: src/test/testcases/testPSUReadSbeMem.py $ # # OpenPOWER sbe Project # # Contributors Listed Below - COPYRIGHT 2017,2019 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you...
1.726563
2
biobb_ml/clustering/clustering_predict.py
bioexcel/biobb_ml
0
14002
#!/usr/bin/env python3 """Module containing the ClusteringPredict class and the command line interface.""" import argparse import pandas as pd import joblib from biobb_common.generic.biobb_object import BiobbObject from sklearn.preprocessing import StandardScaler from biobb_common.configuration import settings from b...
2.515625
3
treeviz_test.py
larsga/sprake
1
14003
<gh_stars>1-10 from sprake import treeviz # we don't actually have any meaningful tests that we can do, but at least # we can do this
1.554688
2
build/scripts/gen_mx_table.py
r1nadeg/04_catboost
0
14004
<gh_stars>0 import sys tmpl = """ #include "yabs_mx_calc_table.h" #include <kernel/matrixnet/mn_sse.h> #include <library/archive/yarchive.h> #include <util/memory/blob.h> #include <util/generic/hash.h> #include <util/generic/ptr.h> #include <util/generic/singleton.h> using namespace NMatrixnet; extern "C" { e...
1.703125
2
Src/StdLib/Lib/test/xmltests.py
cwensley/ironpython2
2,293
14005
# Convenience test module to run all of the XML-related tests in the # standard library. import sys import test.test_support test.test_support.verbose = 0 def runtest(name): __import__(name) module = sys.modules[name] if hasattr(module, "test_main"): module.test_main() runtest("test.test_minidom...
1.96875
2
memcnn/experiment/tests/test_factory.py
classner/memcnn
224
14006
import pytest import os import memcnn.experiment.factory from memcnn.config import Config def test_get_attr_from_module(): a = memcnn.experiment.factory.get_attr_from_module('memcnn.experiment.factory.get_attr_from_module') assert a is memcnn.experiment.factory.get_attr_from_module def test_load_experiment_...
1.992188
2
source/bluetooth/test_search_serial_port.py
Takahiro55555/CameraSystem
1
14007
""" @file: test_search_serial_port.py @author: <NAME> @brief: search_serial_port.pyのをテストするプログラム """ from search_serial_port import search_com_ports, search_enabled_com_port def test_search_com_ports(): search_com_ports() def test_search_enabled_com_port(): search_enabled_com_port()
1.585938
2
Aula 01/ConversaoMedidas.py
eduardojpsena/EstruturaDeDados-Python-IESP
0
14008
print("---CONVERSÃO DE MEDIDAS---") valor_metros = float(input("Informe o valor em metros à ser convertido: ")) valor_centimetros = valor_metros * 100 print("{} metros equivale a {} centimetros.".format(valor_metros, valor_centimetros))
4.09375
4
src/easymql/__init__.py
vivek-shrikhande/easy-mql
0
14009
<filename>src/easymql/__init__.py from pyparsing import ParseException from easymql.exc import EasyMQLSyntaxError from easymql.pipeline import Pipeline, encode class EasyMQL: def parse(self, query_string): try: return encode(Pipeline.parse(query_string, explode=False)) except ParseExc...
2.25
2
src/guildapi.py
nsde/discord-guildapi
0
14010
import requests import json def getguild(guild_id): guild_id = str(guild_id) http_response = requests.get(f'https://discord.com/api/guilds/{guild_id}/widget.json') response_data = http_response.json() data = json.dumps(response_data) return data
2.546875
3
smarthome/smarthomeproj/server/migrations/0011_auto_20210122_0256.py
nunocaseiro/smarthome-server-django
0
14011
<gh_stars>0 # Generated by Django 3.1.3 on 2021-01-22 02:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('server', '0010_auto_20210122_0054'), ] operations = [ migrations.AlterField( model_name='sensorvalue', n...
1.40625
1
p2/core/tasks.py
BeryJu/p2
0
14012
"""p2 core tasks""" from p2.core.celery import CELERY_APP from p2.lib.reflection import path_to_class @CELERY_APP.task(bind=True) def signal_marshall(self, signal, args=None, kwargs=None): """Run signal in task worker""" if not args: args = [] if not kwargs: kwargs = {} # Lookup PK to ...
2.328125
2
tests/keras_contrib/layers/test_convolutional.py
rgreenblatt/keras-contrib
7
14013
import pytest import numpy as np import itertools from numpy.testing import assert_allclose from keras_contrib.utils.test_utils import layer_test, keras_test from keras.utils.conv_utils import conv_input_length from keras import backend as K from keras_contrib import backend as KC from keras_contrib.layers import conv...
2.296875
2
superpyrate/task_countfiles.py
willu47/superpyrate
0
14014
<reponame>willu47/superpyrate """Holds the luigi tasks which count the number of rows in the files Records the number of clean and dirty rows in the AIS data, writing these stats to the database and finally producing a report of the statistics 1. Count the number of rows in the raw csv files (in ``files/unzipped/<arc...
3.015625
3
pyquil/api/__init__.py
stjordanis/pyquil
677
14015
<filename>pyquil/api/__init__.py ############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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 ...
1.367188
1
nodes/makeblock_ros_one.py
to4dy/makeblock-ros
7
14016
<filename>nodes/makeblock_ros_one.py<gh_stars>1-10 #!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import Float32 from megapi import * from makeblock_ros.srv import * bot = None def onRead(v): print("and here!") rospy.loginfo(v) pub.publish(v) def handle_makeblock_mot...
2.15625
2
bets-templates.py
longnow/longview
82
14017
# Copyright (c) 2004, The Long Now Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list o...
1.203125
1
ansible/roles/kraken.config/filter_plugins/expand_config.py
yenicapotediaz/k2
85
14018
import copy, os from ansible import errors def expand_config(config_data): try: all_data = copy.deepcopy(expand_envs(config_data)) return all_data except Exception, e: raise errors.AnsibleFilterError( 'expand_config plugin error: {0}, config_data={1}'.format( str(e), ...
2.328125
2
jaxopt/_src/loop.py
ianwilliamson/jaxopt
2
14019
# Copyright 2021 Google 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 of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.25
2
official/recommendation/model_runner.py
decster/models
3
14020
# Copyright 2018 The TensorFlow 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 applica...
2.25
2
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/amberPrmTop.py
J-E-J-S/aaRS-Pipeline
8
14021
<filename>resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/amberPrmTop.py ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by ############################################################################ # # Author: <NAME>, <NAME> # # Copyright: <NAME> TSRI 2001 # ##################################...
1.726563
2
main_model/example.py
benmaier/DigCT
0
14022
<gh_stars>0 import numpy as np from simulation import simulation_code from tqdm import tqdm def make_length(arr,maxlen): dL = maxlen - len(arr) if dL > 0: newa = np.concatenate((arr, np.ones(dL)*arr[-1])) else: newa = arr return newa def make_equal_length(arr_list): maxlen = max(...
2.15625
2
app/migrations/0002_appointment_doctor_patient_person_receptionist.py
sairamBikkina/sdp1
5
14023
<gh_stars>1-10 # Generated by Django 3.0.5 on 2020-05-24 10:19 import datetime import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0001_initial'), ] operations = [ mi...
1.851563
2
notebook/datetime_fromisoformat.py
vhn0912/python-snippets
174
14024
<gh_stars>100-1000 import datetime s = '2018-12-31' d = datetime.date.fromisoformat(s) print(d) # 2018-12-31 print(type(d)) # <class 'datetime.date'> # print(datetime.date.fromisoformat('2018-12')) # ValueError: Invalid isoformat string: '2018-12' print(datetime.date.fromisoformat('2018-01-01')) # 2018-01-01 # p...
2.75
3
app/main/models/hello_db.py
ZenithClown/flask-docker-template
0
14025
<filename>app/main/models/hello_db.py<gh_stars>0 # -*- encoding: utf-8 -*- from .. import db from ._base_model import ModelSchema class HelloDB(db.Model, ModelSchema): """Use the Model to Establish a Connection to DB""" __tablename__ = "HelloDB" id = db.Column(db.Integer, primary_key = True, autoincr...
2.921875
3
affineTransform.py
LuBru90/Facemorphing
0
14026
import numpy as np import matplotlib.pyplot as plt import cv2 import time def getTransformMatrix(origin, destination): x = np.zeros(origin.shape[0] + 1) # insert [0]-element for better indexing -> x[1] = first element x[1:] = origin[:,0] y = np.copy(x) y[1:] = origin[:,1] x_ = np.copy(x) x_[1...
3
3
demo_count.py
addtt/multi-object-datasets
4
14027
import argparse import os import torch import torch.nn.functional as F from torch import nn from torch.optim.adamax import Adamax from multiobject.pytorch import MultiObjectDataLoader, MultiObjectDataset epochs = 100 batch_size = 64 lr = 3e-4 dataset_filename = os.path.join( 'dsprites', 'multi_dsprites_color...
2.40625
2
run_main_script.py
korombus/blender_battleVR_py
0
14028
import bpy import random import math ## 固定値設定 ############################################################# # 実行ファイルパス一覧 FILE_ROOT_PATH = 'D:/blender_battleVR_py/' setrendr_file_name = FILE_ROOT_PATH + "setting_render.py" magicobj_file_name = FILE_ROOT_PATH + "magic_model.py" fieldins_file_name = FILE_ROOT_PATH + "fie...
1.789063
2
apps/genres/tests/__init__.py
GiannisClipper/payments
0
14029
<reponame>GiannisClipper/payments<filename>apps/genres/tests/__init__.py from django.test import TestCase import copy from django.contrib.auth import get_user_model from funds.models import Fund from genres.models import Genre from users.tests import UserCreateMethods from funds.tests import FundCreateMethods from...
2.265625
2
rltorch/papers/DQN/hyperparams.py
Jjschwartz/rltorch
0
14030
<filename>rltorch/papers/DQN/hyperparams.py """Hyperparameters from paper """ import numpy as np import torch.optim as optim from .model import DQN, DuelingDQN class AtariHyperparams: ALGO = "DQN" SEED = 2 LOG_DISPLAY_FREQ = 10 # Image sizing WIDTH = 84 HEIGHT = 84 # Number of most rec...
2.453125
2
scripts/problem0002.py
Joel301/Project_Euler
0
14031
<reponame>Joel301/Project_Euler #! python3 # -*- coding: utf-8 -*- """ Euler description from https://projecteuler.net/ Problem 0002 Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By c...
3.65625
4
pandas/main.py
monishshah18/python-cp-cheatsheet
140
14032
<gh_stars>100-1000 """ Summarize a column total cases column and total deaths column Country by country data in columns, sum up and match global totals """ import csv import pandas pandas.set_option("display.max_rows", None, "display.max_columns", None) col_list = ["Total Cases", "Country/ Other", "Total Deaths", "#...
3.46875
3
conradomateu/day08/day08.py
CloudCoders/AdventOfCode2017
8
14033
import operator def parse(op): dict[op[0]] = ops[op[1]](dict[op[0]], int(op[2])) maxs.append(max(dict.values())) def parser(exp): return ops[exp[1]](dict[exp[0]], int(exp[2])) def execute(op, exp): if parser(exp): parse(op) def initDictVars(arr): vars = set([x.split(' ')[0] for x in ...
2.828125
3
app/db/events.py
ilya-goldin/kanban-board-app
0
14034
<filename>app/db/events.py import asyncpg from fastapi import FastAPI from loguru import logger from app.core.settings.app import AppSettings async def connect_to_db(app: FastAPI, settings: AppSettings) -> None: logger.info('Connecting to PostgreSQL') app.state.pool = await asyncpg.create_pool( str(...
2.03125
2
Problem009/Python/solution_1.py
drocha87/ProjectEuler
167
14035
<reponame>drocha87/ProjectEuler #!/usr/bin/env python # coding=utf-8 # Python Script # # Copyleft © <NAME> # # from __future__ import print_function """ Special Pythagorean triplet Problem 9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c² For example, 3² + 4² = 9 + 16 ...
4.09375
4
contrib/automation_tests/orbit_load_presets.py
vwbaker/orbit
2
14036
<gh_stars>1-10 """ Copyright (c) 2020 The Orbit Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. """ from absl import app from core.orbit_e2e import E2ETestSuite from test_cases.connection_window import FilterAndSelectFirstProcess, Connect...
2.046875
2
interrogatio/shortcuts/__init__.py
ffaraone/interrogatio
5
14037
from interrogatio.shortcuts.dialogs import * # noqa
0.957031
1
skit_pipelines/components/extract_tgz.py
skit-ai/skit-pipelines
0
14038
from typing import Union import kfp from kfp.components import InputPath, OutputPath from skit_pipelines import constants as pipeline_constants def extract_tgz_archive( tgz_path: InputPath(str), output_path: OutputPath(str), ): import tarfile from loguru import logger logger.debug(f"Extracting...
2.21875
2
python_modules/dagster/dagster_tests/core_tests/definitions_tests/test_input_defaults.py
bitdotioinc/dagster
1
14039
import pytest from dagster import ( DagsterInvalidDefinitionError, InputDefinition, Nothing, Optional, composite_solid, execute_pipeline, execute_solid, lambda_solid, pipeline, ) def test_none(): @lambda_solid(input_defs=[InputDefinition("x", Optional[int], default_value=None)...
2.234375
2
vivid/__init__.py
blacktanktop/vivid
39
14040
<reponame>blacktanktop/vivid from .core import BaseBlock from .runner import Runner, create_runner
1.101563
1
rsa.py
overrkill/security
1
14041
<reponame>overrkill/security<filename>rsa.py import math as m p=int(input("enter a prime integer p ")) q=int(input("enter a prime integer q ")) num=int(input("enter a number to encrypt ")) n=p*q z=(p-1)*(q-1) for e in range(2,z): if m.gcd(e,z)==1: break for i in range(1,10): x=1+i*z if x%e==0: d=int(x/e) bre...
3.78125
4
python_2_script/komand_python_2_script/actions/run/action.py
GreyNoise-Intelligence/insightconnect-plugins
0
14042
<gh_stars>0 import komand from .schema import RunInput, RunOutput # Custom imports below class Run(komand.Action): def __init__(self): super(self.__class__, self).__init__( name="run", description="Run command", input=RunInput(), output=RunOutput() ) def construct(self, func): ...
2.296875
2
config/configSample.py
snipeso/sample_psychopy
0
14043
from config.updateConfig import UpdateConfig sampleCONF = { "task": { "name": "sample", }, "instructions": { "text": "Give instructions", "startPrompt": "Press any key to continue. Press q to quit.", "alarm": "horn.wav", "questionnaireReminder": "answerQuestionnaire....
2.109375
2
oneflow/python/test/onnx/util.py
basicv8vc/oneflow
1
14044
""" Copyright 2020 The OneFlow 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 law or agr...
1.953125
2
pymodule1/Hello1.py
debjava/pymodule1
0
14045
''' Created on Mar 30, 2019 @author: PIKU ''' def justSayHello(): print("Hello ...") def getHello(): return "Hello guys" if __name__ == '__main__': justSayHello() x = getHello() print(x)
3.046875
3
scripts/Evaluation_Metrics/mean_average.py
Mr-TalhaIlyas/CED-Net-Crops-and-Weeds-Segmentation-for-Smart-Farming-Using
0
14046
<reponame>Mr-TalhaIlyas/CED-Net-Crops-and-Weeds-Segmentation-for-Smart-Farming-Using<filename>scripts/Evaluation_Metrics/mean_average.py<gh_stars>0 from Evaluation_Metrics.Average_Precision import ElevenPointInterpolatedAP from Evaluation_Metrics.New_Metric import TP_FP def mean_AP(GT,PRED,TH): Rice_GT=GT[:,:,:,1]...
2.0625
2
src/peter_sslers/lib/errors.py
jvanasco/pyramid_letsencrypt_admin
35
14047
def formstash_to_querystring(formStash): err = [] for (k, v) in formStash.errors.items(): err.append(("%s--%s" % (k, v)).replace("\n", "+").replace(" ", "+")) err = sorted(err) err = "---".join(err) return err class _UrlSafeException(Exception): @property def as_querystring(self): ...
2.546875
3
tips-lib/tools/ordo/cc.py
cosmoss-jigu/tips
13
14048
#!/usr/bin/env python3 import sys offset_table = [] def get_freq(a): v = {} for i in a: if i in v: v[i] += 1 else: v.update({i: 1}) return v def process_file(filename): freq = {} a = [] median = 0 with open(filename, "r") as f: a = f.read...
3.25
3
cognitive_services/__main__.py
cleveranjos/Rapid-ML-Gateway
3
14049
<filename>cognitive_services/__main__.py #! /usr/bin/env python3 import os import sys PARENT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(os.path.join(PARENT_DIR, 'generated')) sys.path.append(os.path.join(PARENT_DIR, 'helper_functions')) import argparse import json import logging ...
2.015625
2
spirecomm/spire/card.py
ysjin94/Slaying_the_Spire_AI
0
14050
from enum import Enum class CardType(Enum): ATTACK = 1 SKILL = 2 POWER = 3 STATUS = 4 CURSE = 5 class CardRarity(Enum): BASIC = 1 COMMON = 2 UNCOMMON = 3 RARE = 4 SPECIAL = 5 CURSE = 6 class Card: def __init__(self, card_id, name, card_type, rarity, upgrades=0, has_...
3.40625
3
src/typeDefs/lineFlowSumm.py
nagasudhirpulla/wrldc_scada_mumbai_dashboard
0
14051
<filename>src/typeDefs/lineFlowSumm.py from typing import TypedDict class ILineFlowSumm(TypedDict): inst: dict maxFlow: dict maxTime: dict
1.460938
1
eval/user.py
hscspring/chatbot
0
14052
<filename>eval/user.py import os import random import numpy as np import torch from chatbot_agent.nlu import BERTNLU from chatbot_agent.policy.rule import RulePolicy from chatbot_agent.nlg import TemplateNLG from chatbot_agent.agent import PipelineAgent from chatbot_agent.analyzer import Analyzer def set_seed(r_seed...
2.21875
2
insights/parsers/tests/test_zipl_conf.py
lhuett/insights-core
121
14053
<filename>insights/parsers/tests/test_zipl_conf.py from insights.parsers.zipl_conf import ZiplConf from insights.tests import context_wrap from insights.parsers import ParseException import pytest ZIPL_CONF = """ [defaultboot] defaultauto prompt=1 timeout=5 default=linux target=/boot [linux] image=/boot/vmlinuz-3....
1.882813
2
tests/services/http_service.py
the-gw/tomodachi
0
14054
import asyncio import os import signal import tomodachi from typing import Any, Dict, Tuple, Callable, Union # noqa from aiohttp import web from tomodachi.transport.http import http, http_error, http_static, websocket, Response, RequestHandler from tomodachi.discovery.dummy_registry import DummyRegistry async def mi...
2.15625
2
mantrid/loadbalancer.py
epio/mantrid
30
14055
<reponame>epio/mantrid import eventlet import errno import logging import traceback import mimetools import resource import json import os import sys import argparse from eventlet import wsgi from eventlet.green import socket from .actions import Unknown, Proxy, Empty, Static, Redirect, NoHosts, Spin from .config impor...
1.984375
2
pyhelp/managers.py
FHuchet/pyhelp
1
14056
# -*- coding: utf-8 -*- # Copyright © 2018 PyHelp Project Contributors # https://github.com/jnsebgosselin/pyhelp # # This file is part of PyHelp. # Licensed under the terms of the GNU General Public License. # ---- Standard Library Imports import os import os.path as osp # ---- Third Party imports import numpy as ...
2.265625
2
tests/unit/test_types.py
OvalMoney/momapper
0
14057
from decimal import Decimal import pytest from bson import Decimal128 from momapper import MappedClass, Field from momapper.mongodb.collection import MappedCollection from momapper.types import ( DecimalType, ValidationError, IntType, FloatType, StringType, ByteType, BoolType, ListType...
2.390625
2
deepleaps/workspace/src/ipc/CustomCommand.py
Longseabear/deep-leaps-pytorch
1
14058
<reponame>Longseabear/deep-leaps-pytorch<filename>deepleaps/workspace/src/ipc/CustomCommand.py import deepleaps.ipc.RunningCommand
1.070313
1
sharpy/solvers/dynamiccoupled.py
ostodieck/sharpy
1
14059
import ctypes as ct import time import copy import numpy as np import sharpy.aero.utils.mapping as mapping import sharpy.utils.cout_utils as cout import sharpy.utils.solver_interface as solver_interface import sharpy.utils.controller_interface as controller_interface from sharpy.utils.solver_interface import solver, ...
2.109375
2
pony/orm/tests/test_generator_db_session.py
ProgHaj/pony
2,628
14060
from __future__ import absolute_import, print_function, division import unittest from pony.orm.core import * from pony.orm.core import local from pony.orm.tests.testutils import * from pony.orm.tests import setup_database, teardown_database class TestGeneratorDbSession(unittest.TestCase): def setUp(self): ...
2.09375
2
private_sharing/migrations/0008_featuredproject.py
danamlewis/open-humans
57
14061
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2018-01-05 01:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('private_sharing', '0007_auto_20171220_2038'), ] operations = [ migrations.CreateMod...
1.75
2
Tests/Validation/Optimization/test_zdt3.py
magnetron/pyleecan
1
14062
# coding: utf-8 """ Test Pyleecan optimization module using Zitzler–Deb–Thiele's function N. 3 """ import pytest from ....definitions import PACKAGE_NAME from ....Tests.Validation.Machine.SCIM_001 import SCIM_001 from ....Classes.InputCurrent import InputCurrent from ....Classes.MagFEMM import MagFEMM from ....Classes...
1.90625
2
comm_lib/import_lib.py
GUTLY/machine_learning_in_action
0
14063
<reponame>GUTLY/machine_learning_in_action """ @Time : 12/4/2020 13:57 @Author : <NAME> @File : import_lib @Project : machine_learning_in_action """ import collections import math import os import random import sys import tarfile import time import zipfile import operator from IPython import display from matplo...
1.53125
2
example/example.py
fmilthaler/HTMLParser
0
14064
<filename>example/example.py<gh_stars>0 from htmlparser import HTMLParser import pandas # Here we scrap a page from Wikipedia, parse it for tables, and convert the first table found into a `pandas.DataFrame`. url = "https://en.wikipedia.org/wiki/List_of_S%26P_500_companies" hp = HTMLParser(url) # scrapping the webpage...
3.46875
3
project_name/common/models.py
brevetech/breve_drf_template
0
14065
from django.db import models # https://stackoverflow.com/questions/1737017/django-auto-now-and-auto-now-add/1737078#1737078 from {{project_name}}.common.enums import PersonSexEnum class TimeStampedModel(models.Model): """ Defines a timestamped model with create_date (auto_now_add) and update_date (auto_now) ...
2.6875
3
PikaBus/tools/PikaTools.py
alexbodn/PikaBus
7
14066
from typing import Union, List import pika import pika.exceptions import time import logging def CreateDurableQueue(channel: pika.adapters.blocking_connection.BlockingChannel, queue: str, settings: dict = None): if settings is None: settings = {} channel.queue_declare(queue, ...
2.15625
2
roundup/backends/blobfiles.py
Noschvie/roundup
1
14067
<reponame>Noschvie/roundup<filename>roundup/backends/blobfiles.py # # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) # This module is free software, and you may redistribute it and/or modify # under the same terms as Python, so long as this copyright message and # disclaimer are retained i...
2.359375
2
LeetCode/E2 - Add Two Numbers/solution.py
ltdangkhoa/Computer-Science-Fundamental
0
14068
"""solution.py""" # Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode: """ T: O(?) S: O(?) """ l3 = ListNode(0) ...
3.578125
4
networking_mlnx/dhcp/mlnx_dhcp.py
stackhpc/networking-mlnx
0
14069
# Copyright 2015 Mellanox Technologies, Ltd # # 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 t...
1.820313
2
solution/practice/algorithms/warmup/plus-minus/solution.py
benevolentPreta/HackerRank_Py3
0
14070
#!/bin/python3 import math import os import random import re import sys # Complete the plusMinus function below. def plusMinus(arr): ''' There is probably a better solution than this but this would be the trivial solution, and it is successful. ''' pos, neg, zero = 0, 0, 0 size = len(arr)...
3.71875
4
youtube_dl/extractor/gorillavid.py
builder07/ytdl
0
14071
<filename>youtube_dl/extractor/gorillavid.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, encode_dict, int_or_none, ) class Go...
2.3125
2
Tests/test_GenBank_unittest.py
cbrueffer/biopython
0
14072
# Copyright 2013 by <NAME>. # Revisions copyright 2015 by <NAME>. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. import unittest import warnings from os import path from Bio import BiopythonParserW...
2.375
2
segtrain/trainer/trainer.py
parthi-bharathi/semantic-image-segmentation
2
14073
<reponame>parthi-bharathi/semantic-image-segmentation import os import tensorflow.keras.backend as K from dataflow import ( BatchData, RepeatedData, MultiProcessRunnerZMQ) from tensorflow.keras.callbacks import Callback, ReduceLROnPlateau, ModelCheckpoint, TensorBoard from tensorflow.keras.callbacks import Learnin...
2.15625
2
turtle/pyramid.py
luscra0/Turtle-Experiments
0
14074
import turtle import math from time import sleep def calculate_points(pos, r1, r2, angles): points = [] for a in angles: x = pos[0] + (r1 * math.cos(math.radians(a))) y = pos[1] + (r2 * math.sin(math.radians(a))) points.append((x, y)) return points def draw_pyramid(tur, draw=False)...
3.5625
4
docker_leash/config.py
docker-leash/docker-leash
1
14075
# vim:set ts=4 sw=4 et: ''' Config ====== ''' import re from .action_mapper import Action from .checks_list import Checks from .exceptions import ConfigurationException class Config(object): """The :class:`Config` class is responsible for storing application groups and policies read from the datastore. ...
2.78125
3
printapp/migrations/0002_auto_20180217_1917.py
sumanlearning/potpapa2018
0
14076
# Generated by Django 2.0.2 on 2018-02-17 12:17 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('printapp', '0001_initial'), ] operations = [ migrations.AlterField( model_name='historybayar', name=...
1.734375
2
waller.py
fredrikwahlberg/harvesters
1
14077
<filename>waller.py # -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> """ import requests import json import os.path import re class Waller(): def __init__(self, datapath, verbose=False): super(Waller, self).__init__() self.reprname = "Waller" assert os.path.exists(datapath), "Path no...
3.046875
3
helper_functions_class.py
lucaschatham/lambdata
0
14078
<reponame>lucaschatham/lambdata<filename>helper_functions_class.py """ Here are two different functions used for common data cleaning tasks. You can use these functions to load data into a pandas Dataframe. """ import numpy as np import pandas as pd from sklearn.utils import shuffle class CleanData: ...
3.375
3
services/web/apps/crm/supplierprofile/views.py
prorevizor/noc
84
14079
# --------------------------------------------------------------------- # crm.supplierprofile application # --------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- #...
1.9375
2
all-python-codes/bagels/main.py
abdussalam02/py-projects
0
14080
from random import shuffle NUM_DIGIT = 3 MAX_GUESSES = 10 def main(): # main game print( f""" Bagels, a detective logic game. By <NAME> I am thinking of a number {NUM_DIGIT} number with no repeted digits. Try to guess what it is. Here re some clues: When i say: ...
4.25
4
NetEmbs/DataProcessing/unique_signatures.py
AlexWorldD/NetEmbs
1
14081
<reponame>AlexWorldD/NetEmbs # encoding: utf-8 __author__ = '<NAME>' """ unique_signatures.py Created by lex at 2019-03-28. """ import pandas as pd from NetEmbs.CONFIG import N_DIGITS def get_signature(df: pd.DataFrame) -> pd.Series: """ Aggregation function over GroupBy object: to extract unique signature fo...
3.03125
3
books/api/RecurringInvoicesApi.py
harshal-choudhari/books-python-wrappers
1
14082
<reponame>harshal-choudhari/books-python-wrappers<gh_stars>1-10 #$Id$# from books.util.ZohoHttpClient import ZohoHttpClient from books.parser.RecurringInvoiceParser import RecurringInvoiceParser from .Api import Api from json import dumps base_url = Api().base_url + 'recurringinvoices/' parser = RecurringInvoicePars...
2.9375
3
api/settings/local.py
hartliddell/api
0
14083
"""Define the django settings for a local setup.""" from .base import * # noqa # SECURITY WARNING: don't run with debug turned on in production! # See: https://docs.djangoproject.com/en/dev/ref/settings/#debug DEBUG = True TEMPLATES[0]['OPTIONS']['debug'] = DEBUG # SECURITY WARNING: keep the secret key used in produ...
1.273438
1
scripts/010_smultixcan/utils/ukb_gtex_variants_intersection/compute_intersection_ukb_gtex_variants.py
miltondp/phenomexcan
3
14084
#!/usr/bin/env python import os import argparse import sqlite3 from glob import glob import pandas as pd parser = argparse.ArgumentParser() parser.add_argument('--gtex-models-dir', type=str, required=True) parser.add_argument('--variants-file-with-gtex-id', type=str, required=True) parser.add_argument('--output-file...
2.453125
2
h/security/predicates.py
hypothesis/h
2,103
14085
""" Define authorization predicates. These are functions which accept an `Identity` object and a context object and return a truthy value. These represent building blocks of our permission map which define when people do, or don't have permissions. For example a predicate might define "group_created_by_user" which is...
3.28125
3
gdm/planing_tool/models/empresas.py
Deonstudios/GDM
0
14086
<filename>gdm/planing_tool/models/empresas.py # coding=utf-8 from planing_tool.models.plazas import State, Country, City from django.contrib.gis.db.models import PointField from datetime import datetime, timedelta from libs.currency_utils import CurrencyUtils from django.contrib.gis.db.models.manager import GeoManager ...
1.984375
2
network.py
tonyhu20116543/Playing-20-Question-Game-with-Policy-Based-Reinforcement-Learning
12
14087
import os import tensorflow as tf from util import masked_softmax class PolicyNetwork(object): """ Policy Function approximator. """ def __init__(self, input_size, output_size, learning_rate=0.001, summaries_dir=None, scope="policy_estimator"): with tf.variable_scope(scope): # Writes Tens...
2.421875
2
tests/test_reusable_executor.py
hoodmane/loky
153
14088
<gh_stars>100-1000 import os import sys import gc import ctypes import psutil import pytest import warnings import threading from time import sleep from multiprocessing import util, current_process from pickle import PicklingError, UnpicklingError from distutils.version import LooseVersion import loky from loky import...
1.914063
2
modules/common/parsers/timetable_parser.py
hgyoseo/hdmeal
2
14089
<reponame>hgyoseo/hdmeal # ██╗ ██╗██████╗ ███╗ ███╗███████╗ █████╗ ██╗ # ██║ ██║██╔══██╗████╗ ████║██╔════╝██╔══██╗██║ # ███████║██║ ██║██╔████╔██║█████╗ ███████║██║ # ██╔══██║██║ ██║██║╚██╔╝██║██╔══╝ ██╔══██║██║ # ██║ ██║██████╔╝██║ ╚═╝ ██║███████╗██║ ██║███████╗ # ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝...
2.515625
3
gittle/gittle.py
justecorruptio/gittle
1
14090
# From the future from __future__ import absolute_import # Python imports import os import copy import logging from hashlib import sha1 from shutil import rmtree from functools import partial, wraps # Dulwich imports from dulwich.repo import Repo as DulwichRepo from dulwich.client import get_transport_and_path from d...
2.078125
2
testg.py
dcn01/AndroidDropFrameAnalysis
2
14091
# fpsAllFrameRead = open("profileAllFrame.txt", "r") # profileDataReadList =[] # t = [] # for line in fpsAllFrameRead.readlines(): # profileDataReadList.append(line) # # for line in profileDataReadList: # splitByComma = line.split(",") # l = len(splitByComma) # print str(l) a = 34.4/(1000/60) print str...
2.359375
2
app/core/urls.py
vatsamail/django-profiles
1
14092
<reponame>vatsamail/django-profiles<filename>app/core/urls.py from django.urls import include, path, re_path from . import views from django.contrib.auth.views import ( login, logout, password_reset, password_reset_done, password_reset_confirm, password_reset_complete, ...
1.96875
2
Python/lab2/temp_convert_FtoC.py
varuneagle555/BSA-STEM-Merit-Badge-Week
3
14093
#!/usr/bin/env python # -*- coding: utf-8 -*- """temp_convert.py: Convert temperature F to C.""" # initialize looping variable, assume yes as first answer continueYN = "Y" while continueYN.upper() == "Y": # get temperature input from the user, and prompt them for what we expect degF = int(raw_input("Enter te...
4.25
4
test/connector/exchange/wazirx/test_wazirx_user_stream_tracker.py
BGTCapital/hummingbot
3,027
14094
<reponame>BGTCapital/hummingbot #!/usr/bin/env python from os.path import join, realpath import sys; sys.path.insert(0, realpath(join(__file__, "../../../../../"))) import conf from hummingbot.connector.exchange.wazirx.wazirx_api_order_book_data_source import WazirxAPIOrderBookDataSource from hummingbot.connector....
1.859375
2
setup.py
jaspershen/getDB
0
14095
from setuptools import setup, find_packages setup(name='getDB', version='0.0.4', description="This module can be used to download HMDB and KEGG database.", license='MIT', author='<NAME>', author_email='<EMAIL>', url='https://github.com/jaspershen/getDB', long_description_conte...
1.335938
1
lib/pts2angmap.py
samsafadi/PointRCNN
1
14096
<reponame>samsafadi/PointRCNN """ modified from sparsify.py file. This file gnerate angle map of [H=64,W=1024,4] from velodyne lidar bins To run this: python3 pts2angmap.py --calib_path '/root/gdrive/My Drive/PointRCNN/data/KITTI/object/training/calib/'\ --image_path '/root/gdrive/My Drive/PointRCNN/data/KI...
2.171875
2
testsuite/conversion.py
buganini/bsdconv
33
14097
<gh_stars>10-100 # -*- coding: utf-8 -*- import sys import urllib from bsdconv import Bsdconv def bsdconv01(dt): dt=dt.lstrip("0").upper() if len(dt) & 1: return "010"+dt else: return "01"+dt def bnf(s): return ",".join([bsdconv01(x) for x in s.strip().split(" ")]) iotest=[ ["big5:utf-8","\xa5\x5c\x5c\xaf\...
2.625
3
apps/cloud/odc/apps/cloud/thredds_to_tar.py
robbibt/odc-tools
0
14098
import tarfile import click import requests from odc.io.tar import tar_mode, add_txt_file from multiprocessing.dummy import Pool as ThreadPool from functools import partial from urllib.parse import urlparse from thredds_crawler.crawl import Crawl def download(url): parsed_uri = urlparse(url) target_filename ...
2.484375
2
examples/ec2/tests/config.py
dabble-of-devops-biodeploy/terraform-aws-batch
3
14099
DATA_S3 = "bioanalyze-ec2-test-nf-rnaseq-06o3qdtm7v" JOB_S3 = DATA_S3 # These come from the terraform code in auto-deployment/terraform ECR = "dabbleofdevops/nextflow-rnaseq-tutorial" COMPUTE_ENVIRONMENT = "bioanalyze-ec2-test-nf-rnaseq" JOB_DEF_NAME = "bioanalyze-ec2-test-nf-rnaseq" JOB_QUEUE_NAME = "bioanalyze-ec2-...
1.25
1