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
prepper.py
shawntan/quora-codesprint-2013
3
31300
<filename>prepper.py<gh_stars>1-10 import json,sys,re,math from random import random import numpy as np from pprint import pprint from sklearn import svm from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer,TfidfTransformer from sklearn.feature_extraction import DictVectori...
2.53125
3
wsgi.py
pointerish/Brevis
3
31301
from api import app if __name__ == '__main__': with open('urls.json', 'w') as fj: fj.write('') app.run()
1.757813
2
CustomerReviewSummarizer/main.py
shashwatsagar/ReviewSummarizer
0
31302
# -*- coding: utf-8 -*- """ @author: <NAME>, <NAME>, <NAME>, <NAME> """ from Processor.Processor import Processor from WebScrapper.Scrapper import Scrapper import json import os print("The Data is being scrapped please wait!!!!!!!!!!") start=0 flag = 1 scrap = Scrapper() p = Processor() print("Creati...
2.84375
3
Python 2/code/json1.py
gabrielwolf/5-python-kurse
0
31303
import json data = ''' { "name" : "Chuck", "phone" : { "type" : "intl", "number" : "+1 734 303 4456" }, "email" : { "hide" : "yes" } }''' info = json.loads(data) print 'Phone:',info["phone"] print 'Number:',info["phone"]["number"]
3.28125
3
samples/python/minimal_service/minimal_service_client.py
OrhanKupusoglu/ecal
0
31304
# ========================= eCAL LICENSE ================================= # # Copyright (C) 2016 - 2019 Continental Corporation # # 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...
2.0625
2
model.py
yz540/Behavioral_Cloning
0
31305
<filename>model.py import csv import cv2 import numpy as np from scipy import ndimage # Setup Keras from keras.models import Sequential, Model from keras.layers import Flatten, Dense, Lambda, Dropout from keras.layers.convolutional import Conv2D from keras.layers.pooling import MaxPooling2D from keras.layers import Cro...
2.6875
3
vsphere_network_plugin/tests/ippool_test.py
Vladimir-Antonovich/cloudify-vsphere-plugin
10
31306
<reponame>Vladimir-Antonovich/cloudify-vsphere-plugin # Copyright (c) 2014-2020 Cloudify Platform Ltd. 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...
1.835938
2
common/migrations/0002_auto_20180722_1316.py
Red-Teapot/bbyaworld.com-django
1
31307
<filename>common/migrations/0002_auto_20180722_1316.py # Generated by Django 2.0.7 on 2018-07-22 10:16 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.AlterField( model_n...
1.4375
1
MTS/__init__.py
ohhorob/pyMTS
1
31308
# MTS Log protocol -- http://www.innovatemotorsports.com/support/downloads/Seriallog-2.pdf # Serial: 8-N-1-19.2 kbit/sec # Packet periodicity: 81.92 milliseconds (12.2 hertz) (8 MHz / 655360) # Sample resolution: 10 bits (0..5V at 0.1% resolution) import Header from word import *
1.78125
2
savecode/threeyears/idownclient/clientdbmanager/dbsqlite/tbdata.py
Octoberr/swm0920
2
31309
<filename>savecode/threeyears/idownclient/clientdbmanager/dbsqlite/tbdata.py """ data表 create by judy 2019/02/20 插入data表前判断数据是否存在于数据库中 update by judy 2019/03/22 作为当前数据的唯一标识,保留当前数据的uniqueid 不再需要account来分辨不同的账号,因为uniqueid确实回事独一无二的 update by judy 2019/03/27 """ from datacontract.outputdata import EStandardDataType impor...
2.265625
2
resorganizer/task.py
anton-pershin/research-organizer
0
31310
<filename>resorganizer/task.py from resorganizer.aux import * class Command(object): """Command is an abstraction for any command line able to be executed. Command line has the components: program name, params (flags followed by some values, e.g. -f filename), flags (alone flags. e.g. -f) and trailing arg...
3.734375
4
orbit/coe2mee.py
lasr/orbit
0
31311
"""Created on Sat Oct 01 2015 16:24. @author: <NAME> """ import numpy as np def coe2mee(COE, mu=1.): """ Convert classical orbital elements to modified equinoctial elements. Parameters ---------- COE : ndarray mx6 array of elements ordered as [p e i W w nu]. mu : float Standa...
3.28125
3
contrib/bulk_operations/metadata.py
tzhaoredhat/automation
18
31312
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # """ Use the provided metadata generator if you wish to support OPTIONS requests on list url of resources that support bulk operations. The only difference from the generator provided by REST Framework is that it...
2.15625
2
str/regex_example.py
gitdummyac/Python
0
31313
<filename>str/regex_example.py import re txt = "Hello welcome to hacktober fest" x = re.search("hacktober", txt)
3.390625
3
web/templatetags/tags.py
codeschule/koodikoulu-site
5
31314
from django import template register = template.Library() @register.inclusion_tag('templatetags/form_field.html') def show_form_field(field, icon=False): return {'field': field, 'icon': icon} @register.inclusion_tag('templatetags/learning_resource.html') def show_resource(resource): return {'resource': resou...
1.835938
2
sandbox/simstream/simstream/eventmonitor.py
docquantum/airavata
74
31315
<reponame>docquantum/airavata<filename>sandbox/simstream/simstream/eventmonitor.py # # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses th...
1.921875
2
Guitar Training Remote/music_theory/mode.py
keremkoseoglu/Python-Library
3
31316
import random from music_theory.note import Note class Mode: def __init__(self): self._modes = [ # Major oriented "Ionian", "Dorian", "Phrygian", "Lydian", "Mixo", "Aeolian", "Locrian", # Melodic ...
3.5625
4
test/py/t-searchmem.py
alexbudmsft/dbgscript
27
31317
from utils import * car = get_car() # Positive cases. Can't print the result because the address may change # from run to run. # dbgscript.search_memory(car['name'].address-16, 100, b'FooCar', 1) dbgscript.search_memory(car['name'].address-16, 100, b'FooCar', 2) # Negative cases. # # 4 is not a multipl...
2.734375
3
make_valid.py
shawnlewis/wordle
0
31318
<filename>make_valid.py words_file = open('wordlist.txt') print("export const VALIDGUESSES6 = [") for word in words_file.read().split('\n'): word = word.strip() if word.isalpha() and len(word) == 6: print(' "%s",' % word.lower()) print("];")
3.515625
4
03_BFS_DFS/01_DFS_BFS/01_DFS_BFS.py
ki-yungkim/Algorithm_Step_1_Stack_Queue
0
31319
<reponame>ki-yungkim/Algorithm_Step_1_Stack_Queue<gh_stars>0 graph = {} n = input().split(' ') node, edge, start = map(int, n) for i in range(edge): edge_number = input().split(' ') n1, n2 = map(int, edge_number) if n1 not in graph: graph[n1] = [n2] elif n2 not in graph[n1]: graph[...
3.453125
3
server/rtracker/mainapp/tests.py
Aqudei/RTrackerv3
0
31320
<reponame>Aqudei/RTrackerv3 from django.test import TestCase from . import models # Create your tests here. class FlowTest(TestCase): def setUp(self): flow = models.ReportFlow.objects.create( specification='od-base.pd.ard.rd') self.fielduser = models.ROUser(Office='pso-borong') ...
2.234375
2
topfarm/tests/test_topfarm_utils/test_utils.py
DTUWindEnergy/TopFarm2
4
31321
<reponame>DTUWindEnergy/TopFarm2 from topfarm.utils import smart_start import numpy as np from topfarm.tests import npt from topfarm import TopFarmProblem from py_wake.examples.data import hornsrev1 from py_wake.deficit_models.noj import NOJ from topfarm.easy_drivers import EasyScipyOptimizeDriver from topfarm.constra...
1.835938
2
Jinja/002_BGPtemplate/config_render.py
CalvinDawgz/Python-Projects
1
31322
<filename>Jinja/002_BGPtemplate/config_render.py import yaml from jinja2 import Template from argparse import ArgumentParser parser = ArgumentParser("Specifying the YAML File") parser.add_argument("-d", "--data-file", help="Please specify the YAMl file.", required=True ...
3.15625
3
src/gans/wgangp.py
universuen/RVGAN-TL
0
31323
import torch from src import config, models from src.models import WGANGPGModel, WGANGPDModel from src.datasets import PositiveDataset from ._base import Base class WGANGP(Base): def __init__(self): super().__init__(WGANGPGModel(), WGANGPDModel()) def _fit(self): d_optimizer = torch.optim.Ad...
2.234375
2
brainlit/napari_viterbrain/viterbrain_plugin.py
neurodata/mouselight
0
31324
import pickle from sys import intern from numpy import uint32 import numpy as np import zarr from napari_plugin_engine import napari_hook_implementation from qtpy.QtWidgets import QWidget, QHBoxLayout, QPushButton from magicgui import magic_factory import pathlib import napari def viterbrain_reader(path: str) -> lis...
2
2
examples/twisted/resource.py
florath/spyne-1
0
31325
#!/usr/bin/env python # encoding: utf8 # # Copyright © <NAME> <burak at arskom dot com dot tr>, # Arskom Ltd. http://www.arskom.com.tr # 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.523438
2
code/part_I_D/arima.py
Spacebody/MCM-ICM-2018-Problem-C
1
31326
import pandas as pd import re import numpy as np import os import sys from collections import OrderedDict, defaultdict import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns # from theano import * # load state data az_year = pd.read_csv("data/csv/price_expenditures/sector/az/price/teacd.csv", e...
2.46875
2
autoPyTorch/pipeline/components/setup/augmentation/image/Resize.py
ravinkohli/Auto-PyTorch
1
31327
<filename>autoPyTorch/pipeline/components/setup/augmentation/image/Resize.py from typing import Any, Dict, Optional, Union from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, ) import imgaug.augmenters as iaa from imgaug.augmenters.me...
2.34375
2
test/unittests/chemical/building_blocks/aminoacids.py
Alexhuszagh/XLDiscoverer
0
31328
<filename>test/unittests/chemical/building_blocks/aminoacids.py ''' Unittests/Chemical/Building_Blocks/aminoacids _____________________________________________ Unit tests for aminoacid lookups. :copyright: (c) 2015 The Regents of the University of California. :license: GNU GPL, see licenses/GNU GP...
2.890625
3
firewall/firewallManager.py
uzairAK/serverom-panel
0
31329
#!/usr/local/CyberCP/bin/python import os import os.path import sys import django sys.path.append('/usr/local/CyberCP') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings") django.setup() import json from plogical.acl import ACLManager import plogical.CyberCPLogFileWriter as logging from plogical.virtual...
1.882813
2
operacoes.py
cleber-si/Calculadora-Clebsh-Gordan
0
31330
<filename>operacoes.py import sympy as sp from sympy.solvers.solveset import linsolve def printa_latex(eq): # Lê J e M no lado esquerdo da equação J_lt = eq[0][1] M_lt = eq[0][2] # Monta o código em LaTeX para o lado esquerdo da equação lado_esquerdo = '|' + sp.latex(J_lt) + ';' + sp.latex(M_lt) +...
3.03125
3
src/routers/user.py
momonoki1990/fastapi-todo-list
1
31331
<reponame>momonoki1990/fastapi-todo-list from typing import List from fastapi import APIRouter, Depends, HTTPException, status from fastapi.security import OAuth2PasswordRequestForm from sqlalchemy.ext.asyncio import AsyncSession from src.schema import user as user_schema, task as task_schema from src.cruds import user...
2.5
2
maguey/tests/test_systems_api.py
andrewmagill/maguey
0
31332
<reponame>andrewmagill/maguey<filename>maguey/tests/test_systems_api.py from unittest import TestCase import maguey class TestSystems(TestCase): def test_add_system(self): pass def test_delete_system(self): pass
1.5
2
ml/regressor_with_kerasModel.py
shilang1220/tfwrapper
0
31333
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 18-5-15 下午4:54 # @Author : <NAME> # @File : regressor_with_kerasSquential.py # @Software: tfwrapper import numpy as np np.random.seed(1337) from keras.models import Model from keras.layers import Dense from keras.layers import Activation impo...
2.703125
3
isolates/download_accession_list.py
josl/ASM_challenge
2
31334
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is a skeleton file that can serve as a starting point for a Python console script. To run this script uncomment the following line in the entry_points section in setup.cfg: Then run `python setup.py install` which will install the command `download` inside your c...
2.28125
2
tkinker/Code/messageBox.py
siddhantjoshi/Thinker
0
31335
<reponame>siddhantjoshi/Thinker from tkinter import * from tkinter import messagebox rootWidget = Tk() rootWidget.title("Message Box Example") def messageBox(): response = messagebox.showinfo(title="Show Info", message="Message") Label(rootWidget, text = response).pack() Button(rootWidget,text= "Click Me!!...
3.53125
4
octavia/controller/worker/v2/flows/flow_utils.py
zhangi/octavia
129
31336
<reponame>zhangi/octavia # 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 i...
1.351563
1
blogproject/blog/views.py
MrWolffy/django-tutorial
0
31337
import re import markdown from django.contrib import messages from django.db.models import Q from django.shortcuts import render, get_object_or_404, redirect from django.utils.text import slugify from django.views.generic import ListView, DetailView from markdown.extensions.toc import TocExtension from pure_pagination....
2.171875
2
apps/sentry/apps.py
ShAlireza/Sentry-Telegram
0
31338
from django.apps import AppConfig class SentryConfig(AppConfig): name = 'sentry'
1.140625
1
tests/test_compare.py
grst/jupytext
0
31339
<reponame>grst/jupytext<gh_stars>0 import pytest from nbformat.v4.nbbase import new_notebook, \ new_markdown_cell, new_code_cell, new_raw_cell import jupytext from jupytext.compare import compare_notebooks, \ test_round_trip_conversion as round_trip_conversion jupytext.file_format_version.FILE_FORMAT_VERSION =...
2.109375
2
test_initial.py
BickySamourai/djreact
1
31340
def hello(name): return 'Hello ' + 'name' def test_hello(): assert hello('name') == 'Hello name'
3.078125
3
hashing/pdq/python/pdqhashing/utils/matrix.py
larrycameron80/ThreatExchange
1
31341
<gh_stars>1-10 #!/usr/bin/env python class MatrixUtil: @classmethod def allocateMatrix(cls, numRows, numCols): rv = [0.0] * numRows for i in range(numRows): rv[i] = [0.0] * numCols return rv @classmethod def allocateMatrixAsRowMajorArray(cls, numRows, numCols): ...
2.65625
3
Scripts/simulation/plex/plex_service.py
velocist/TS4CheatsInfo
0
31342
<gh_stars>0 # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\plex\plex_service.py # Compiled at: 2020-03-06 03:39:09 # Size of source mod 2**32: 8464...
1.820313
2
youtube.py
yappy2000d/MoodBot
0
31343
import os KEY = os.environ['KEY'] from urllib.parse import parse_qs, urlparse import requests def getid(url): if url.startswith("http"): try: url_data = urlparse(url) query = parse_qs(url_data.query) return query["v"][0] except KeyError: return ur...
3.046875
3
Course_4_Week_4_Project_2.py
Vivek9Chavan/DeepLearning.AI-TensorFlow-Developer-Professional-Certificate
0
31344
<reponame>Vivek9Chavan/DeepLearning.AI-TensorFlow-Developer-Professional-Certificate """ This is is a part of the DeepLearning.AI TensorFlow Developer Professional Certificate offered on Coursera. All copyrights belong to them. I am sharing this work here to showcase the projects I have worked on Course: Introdu...
3.1875
3
2018/1/solution1.py
frenzymadness/aoc
2
31345
<gh_stars>1-10 with open("input.txt") as input_file: lines = input_file.readlines() result = 0 for line in lines: print(line.strip(), result) result += int(line.strip()) print(result)
3.296875
3
packages/models-library/tests/conftest.py
KZzizzle/osparc-simcore
0
31346
# pylint: disable=redefined-outer-name # pylint: disable=unused-argument # pylint: disable=unused-import import json import subprocess import sys from pathlib import Path from typing import Callable, Dict import pytest import models_library pytest_plugins = [ "pytest_simcore.repository_paths", "pytest_simcor...
1.84375
2
cellular-automata/examples/forest_fire_parameter_exploration.py
enthought/ets-examples
3
31347
# Copyright (c) 2017, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only # under the conditions described in the aforementioned license. The license # is also available online at http://www.ent...
3.046875
3
src/RobotFrameworkPercy/RobotFrameworkPercy.py
carlosnizolli/robot-framework-percy
0
31348
<reponame>carlosnizolli/robot-framework-percy<gh_stars>0 from robot.libraries.BuiltIn import BuiltIn import os import percy class RobotFrameworkPercy(): ROBOT_LIBRARY_SCOPE = 'TEST SUITE' def __init__(self): self.percy_runner = None def Percy_Initialize_Build(self, **kwargs): driver = Bu...
2.28125
2
source/clusters.py
ehutt/text2topics
2
31349
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 17 11:02:21 2019 @author: elizabethhutton """ import pandas as pd import numpy as np from sklearn.manifold import TSNE from matplotlib import pyplot as plt from sklearn.cluster import KMeans from wordcloud import WordCloud from yellowbrick.cluster ...
3
3
week_2/ex1a.py
scodes1/pyneta
0
31350
from netmiko import ConnectHandler from getpass import getpass device1 = { 'host' : 'cisco4.lasthop.io', 'username' : 'pyclass', 'password' : getpass(), 'device_type' : 'cisco_ios', 'global_delay_factor' : 2, } net_connect = ConnectHandler(**device1) print(net_connect.find_prompt()) output = net_...
2.265625
2
bot.py
egor5q/hawkeyegame
0
31351
# -*- coding: utf-8 -*- import os import telebot import time import random import threading from emoji import emojize from telebot import types from pymongo import MongoClient import traceback token = os.environ['TELEGRAM_TOKEN'] bot = telebot.TeleBot(token) fighters=[] btimer=10 names=['Волк', 'Осёл', 'Кроль', '<NA...
2.25
2
napari_svg/_tests/test_get_writer.py
nclack/napari-svg
1
31352
<reponame>nclack/napari-svg import os import numpy as np import pytest from napari_svg import napari_get_writer from napari.layers import Image, Labels, Points, Shapes, Vectors @pytest.fixture def layer_data_and_types(): np.random.seed(0) layers = [ Image(np.random.rand(20, 20)), L...
2.375
2
django_easy_report/migrations/0001_initial.py
ehooo/django_easy_report
0
31353
from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( ...
1.914063
2
games_logger/games/migrations/0001_initial.py
HaeckelK/games_logger_django
0
31354
<gh_stars>0 # Generated by Django 3.1.5 on 2021-01-07 21:50 import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( na...
1.890625
2
button.py
anas652/button
0
31355
<reponame>anas652/button n kjhimport Tkinter window = Tkinter.Tk() button = Tkinter.Button(window, text="do not press this because i will kill you.", width=40) button.pack(padx=10, pady=10) clickCount=0 def onClick(event): global clickCount clickCount = clickCount + 1 if clickCount == 1: button.configure(text="ser...
3.859375
4
corehq/apps/fixtures/interface.py
omari-funzone/commcare-hq
471
31356
from django.contrib import messages from django.http import HttpResponseRedirect from django.utils.functional import cached_property from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop, ugettext_lazy from couchdbkit import ResourceNotFound from memoized import memoized...
1.882813
2
pyDR/blopt.py
ClayCampaigne/pyDR
0
31357
""" Code for the optimization and gaming component of the Baselining work. @author: <NAME>, <NAME> @date Mar 2, 2016 """ import numpy as np import pandas as pd import logging from gurobipy import GRB, Model, quicksum, LinExpr from pandas.tseries.holiday import USFederalHolidayCalendar from datetime import datetime f...
2.65625
3
setup.py
edjdavid/aiml
0
31358
<gh_stars>0 from setuptools import setup, find_packages setup(name='aiml', version='1.0', description='ML Automation', author='MSDS ML', author_email='<EMAIL>', packages=find_packages(), install_requires=[ 'numpy', 'pandas', 'matplotlib', 'sci...
1.007813
1
python_scripts/wikiracer/__init__.py
gulyas/network_games_analysis
0
31359
<gh_stars>0 """ WikiRacer is a project of stong1108. https://github.com/stong1108/WikiRacer Rewritten for Python 3.8 by <NAME> (csertant) """ from .wikiracer import check_pages, find_shortest_path, get_result, redirected from .wikiracer_threaded import check_page_threaded, find_shortest_path_threaded, result_threaded
1.585938
2
provisioner/python/prp_provisioner/provisioner.py
sfiligoi/prp-htcondor-portal
0
31360
# # prp-htcondor-portal/provisioner # # BSD license, copyright <NAME> 2021 # # Main entry point of the provisioner process # import sys import time from . import provisioner_logging from . import provisioner_htcondor from . import provisioner_k8s from . import event_loop def main(namespace, max_pods_per_cluster=10, ...
2.015625
2
linetools/isgm/abscomponent.py
marijana777/linetools
0
31361
<gh_stars>0 """ Class for absorption line component """ from __future__ import print_function, absolute_import, division, unicode_literals # Python 2 & 3 compatibility try: basestring except NameError: basestring = str import pdb import numpy as np import warnings from astropy import constants as const from ...
2.234375
2
120_GruneisenParam/FeNiSi/collectScalingParam.py
r-a-morrison/fe_alloy_sound_velocities
0
31362
# Front matter ############## import os from os import fdopen, remove from tempfile import mkstemp from shutil import move import glob import re import time import pandas as pd import numpy as np from scipy import constants from scipy.optimize import curve_fit, fsolve from scipy.interpolate import interp1d import matpl...
1.929688
2
classes/strategies.py
noaillypau/Polyvalent_Backtester_3
2
31363
<gh_stars>1-10 import numpy as np, pandas as pd, json, os, datetime, time from order import Order class Strategies(): def __init__(self): self._dict = {} def add(self, name, strategy): self._dict[name] = strategy def compute(self, arrs, index): list_order = [] ...
2.984375
3
orders/api.py
terryjbates/restbucks
0
31364
<reponame>terryjbates/restbucks import os from datetime import datetime from dateutil import parser as datetime_parser from dateutil.tz import tzutc from flask import Flask, url_for, jsonify, request from flask.ext.sqlalchemy import SQLAlchemy from utils import split_url basedir = os.path.abspath(os.path.dirname(__fi...
2.484375
2
__findLengthsNoEmptyStrings.py
simdevex/01.Basics
0
31365
<reponame>simdevex/01.Basics #License: https://bit.ly/3oLErEI def test(strs): return [*map(len, strs)] strs = ['cat', 'car', 'fear', 'center'] print("Original strings:") print(strs) print("Lengths of the said list of non-empty strings:") print(test(strs)) strs = ['cat', 'dog', 'shatter', 'donut', 'at', 'todo',...
3.546875
4
speedtest2dynamodb_test.py
ujuettner/speedtest2DynamoDB
0
31366
"""Test cases.""" import unittest import logging from speedtest2dynamodb import parse_output class SpeedTest2DynamoDBTestCase(unittest.TestCase): """Collection of tests.""" def setUp(self): self.logger = logging.getLogger() def test_parse_output_bit(self): """Test output that contains on...
2.8125
3
freenet/lib/file_parser.py
augustand/fdslight
0
31367
<filename>freenet/lib/file_parser.py #!/usr/bin/env python3 """文件解析器,对dns分发的rules和白名单ip列表进行解析 文件格式:一条规则就是一行,#开头的表示注解: """ class FilefmtErr(Exception): pass def __drop_comment(line): """删除注释""" pos = line.find("#") if pos < 0: return line return line[0:pos] def __read_from_file(fpath): ...
3.015625
3
src/duty/context.py
pawamoy/duty
25
31368
<reponame>pawamoy/duty """Module containing the context definition.""" import os from contextlib import contextmanager from typing import Any, Callable, Dict, List, Union from failprint.runners import run as failprint_run from duty.exceptions import DutyFailure CmdType = Union[str, List[str], Callable] class Cont...
2.671875
3
Tests/TestImgRecognitionAndMotorControl/Test2048Detect4.py
robdobsn/RobotPlay2048
0
31369
import cv2 import numpy as np import picamera import time def identifySq(pt, w, h): tlx = 80 tly = 210 ppx = 94 ppy = 82 sqx = (pt[0]-(tlx-ppx/2))/ppx sqy = (pt[1]-(tly-ppy/2))/ppy # print ("ID",pt, w, h, sqx, sqy) if sqx < 0 or sqx >= 4 or sqy < 0 or sqy >= 4: return 0, False ...
2.453125
2
utils/views/modals/tag.py
DiscordGIR/Bloo2
0
31370
import re import discord from data.model import Tag class TagModal(discord.ui.Modal): def __init__(self, bot, tag_name, author: discord.Member) -> None: self.bot = bot self.tag_name = tag_name self.author = author self.tag = None super().__init__(title=f"Add tag {self.tag...
2.84375
3
meterological_data.py
ask-santosh/Weather-Data-Analysis
0
31371
#!/usr/bin/env python # coding: utf-8 # In[3]: import pandas as pd # In[4]: weather_data = pd.read_csv("weatherHistory.csv") # weather_data.columns = weather_data.iloc[0] # weather_data.columns # weather_data # weather_data.head() weather_data.columns.values # In[5]: weather_data = weather_data.iloc[1:] # ...
3.546875
4
JPS_NLP/python/caresjpsnlq/NLQ_Chunker.py
mdhillmancmcl/TheWorldAvatar-CMCL-Fork
21
31372
import NLQ_Preprocessor as preProcessor import NLP_Engine as nlpEngine import NLQ_Interpreter as interpreter import nltk import time class NLQ_Chunker: def __init__(self): self.preprocessor = preProcessor.PreProcessor() self.nlp_engine = nlpEngine.NLP_Engine() self.interpreter = interpre...
3.046875
3
build/lib.linux-armv7l-2.7/bibliopixel/drivers/LPD8806.py
sethshill/final
6
31373
from spi_driver_base import DriverSPIBase, ChannelOrder class DriverLPD8806(DriverSPIBase): """Main driver for LPD8806 based LED strips on devices like the Raspberry Pi and BeagleBone""" def __init__(self, num, c_order=ChannelOrder.RGB, use_py_spi=True, dev="/dev/spidev0.0", SPISpeed=2): super(Driver...
2.421875
2
tests/test_tokenizers.py
GateNLP/python-gatenlp
30
31374
<reponame>GateNLP/python-gatenlp import os import time from gatenlp import logger, Document class TestTokenizers01: def makedoc(self): return Document(" This is a 💩 document. It has two sentences and 14 tokens. ") def test_nltk_tokenizers01(self): """ Unit test method (make linte...
2.953125
3
tests/neural_networks/art_fuzzy/test_class.py
DavidVinicius/artmap-fuzzy-tcc
0
31375
from src.neural_networks.art_fuzzy import ARTFUZZY import numpy as np def test_If_I_isintance_numpy(): A = ARTFUZZY([1.0, 2.0]) assert isinstance(A.I, np.ndarray) def test_If_W_isintance_numpy(): A = ARTFUZZY([1.0, 2.0]) assert isinstance(A.I, np.ndarray)
2.578125
3
tests/unit/test_para_helper_utilities.py
lizschley/number_six
1
31376
'''Tests for methods in helpers/no_import_common_class/utilities.py''' # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name import pytest import helpers.no_import_common_class.paragraph_helpers as helpers import utilities.random_methods as utils import testing.data.dict_constants as cons...
2.421875
2
scripts/train.py
dowalder/gym-duckietown
0
31377
<reponame>dowalder/gym-duckietown #!/usr/bin/env python3 """ DEPRECATED: better use trainv2.py together with conf files. This file persists as not everything in it has been moved to trainv2.py, but in most cases the other one should be used. """ import argparse import os import pathlib import yaml from typing import ...
1.898438
2
oskb/ui_editkey.py
rushic24/oskb
6
31378
<reponame>rushic24/oskb # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'EditKey.ui' # # Created by: PyQt5 UI code generator 5.14.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_EditKey(object): def setupUi(self, EditKe...
1.625
2
variaveis.py
OHolandes/Athena-Public
0
31379
CANAIS_ADM = { "diretoria": 441263190832185350, "secretaria": 731689039853518848 } SAUDACOES = ["Olá!", "Oi!", "Iai!"] GUIA_ANONIMA_ID = 956319073568976967 msg_ajuda = "**::ola** | **::oi** | **::iai** | **::athena**: Mande um ola caloroso para mim, e responderei!\n" \ "**::cool** `texto`: Você po...
1.875
2
neodroidagent/utilities/signal/experimental/__init__.py
gitter-badger/agent
8
31380
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __doc__ = "" from .discounting import * from .generalised_advantage import * from .nstep import *
1.15625
1
NSI/Chapitre 6/Mini projet 5 AB/morse.py
S-c-r-a-t-c-h-y/coding-projects
0
31381
<reponame>S-c-r-a-t-c-h-y/coding-projects from arbre_binaire import AB def parfait(ngd): """ Fonction qui renvoit un arbre binaire parfait à partir de son parcourt en profondeur préfixe ngd de type str """ cle = ngd[0] ab1 = AB(cle) if len(ngd) > 1: ngd_g = ngd[1 : len(ngd) // 2 + ...
2.875
3
spharpy/samplings/coordinates.py
mberz/spharpy
0
31382
<gh_stars>0 import numpy as np from spharpy.samplings.helpers import sph2cart from scipy.spatial import cKDTree class Coordinates(object): """Container class for coordinates in a three-dimensional space, allowing for compact representation and convenient conversion into spherical as well as geospatial coor...
3.078125
3
09_Recurrent_Neural_Networks/05_Creating_A_Sequence_To_Sequence_Model/05_seq2seq_translation.py
maxim5/tensorflow_cookbook
2
31383
<reponame>maxim5/tensorflow_cookbook #!/usr/bin/env python # -*- coding: utf-8 -*- # # Creating Sequence to Sequence Models # ------------------------------------- # Here we show how to implement sequence to sequence models. # Specifically, we will build an English to German translation model. # import io import os ...
2.671875
3
hxmirador/settings/prod.py
nmaekawa/hxmirador
0
31384
<reponame>nmaekawa/hxmirador<filename>hxmirador/settings/prod.py """ Django settings for hxmirador project. Generated by 'django-admin startproject' using Django 2.0.7. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see ht...
1.789063
2
Conecta 4/AlphaZero/test.py
alberto-maurel/Aprendizaje-por-refuerzo-Fundamentos-te-ricos-del-algoritmo-AlphaZero-e-implementaci-n
0
31385
<gh_stars>0 from board import Game from agent import Agent from humanAgent import HumanAgent from randomAgent import RandomAgent from MCTS import * from NeuralNetwork import Connect4Zero import numpy as np import matplotlib.pyplot as plt import tensorflow as tf #AI VS RANDOM ''' def main(): builder ...
2.640625
3
fabio/pilatusimage.py
picca/fabio
0
31386
# coding: utf-8 # # Project: X-ray image reader # https://github.com/silx-kit/fabio # # # Copyright (C) European Synchrotron Radiation Facility, Grenoble, France # # Principal author: <NAME> (<EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this s...
1.789063
2
tests/components/tasks/gqa_tests.py
aasseman/pytorchpipe
232
31387
<filename>tests/components/tasks/gqa_tests.py # -*- coding: utf-8 -*- # # Copyright (C) tkornuta, IBM Corporation 2019 # # 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.apac...
2.203125
2
Start.py
nuti23/StudentsAssignmentsManagement
0
31388
<filename>Start.py from Domain.student import Student from Repository.assignment_repository import AssignmentRepository from Repository.grade_repository import GradeRepository from Repository.student_repository import StudentRepository from Repository_Binary_File.assignment_repository_binary_file import AssignmentRepos...
2.234375
2
contrib/frontends/py/nntpchan/__init__.py
majestrate/nntpchan
233
31389
<filename>contrib/frontends/py/nntpchan/__init__.py # # entry for gunicorn # from nntpchan.app import app from nntpchan import viewsp
1.21875
1
_unittests/ut_profiling/test_event_profiler.py
sdpython/cpyquickhelper
2
31390
<filename>_unittests/ut_profiling/test_event_profiler.py<gh_stars>1-10 """ @brief test log(time=3s) """ import unittest import inspect import logging from time import sleep, perf_counter from pyquickhelper.pycode import ExtTestCase from cpyquickhelper.profiling import ( EventProfiler, WithEventProfiler) from c...
2.40625
2
ionoscloud/models/s3_key_properties.py
ionos-cloud/ionos-cloud-sdk-python
0
31391
# coding: utf-8 """ CLOUD API IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and ...
1.796875
2
setup.py
ProjexSoftware/orb
7
31392
import os import re import subprocess from setuptools import setup, find_packages, Command from setuptools.command.test import test as TestCommand __author__ = '<NAME>' __email__ = '<EMAIL>' __license__ = 'MIT' INSTALL_REQUIRES = [] DEPENDENCY_LINKS = [] TESTS_REQUIRE = [] LONG_DESCRIPTION = '' class Tox(TestComma...
2.203125
2
forms.py
tecoholic/student_score_graph
0
31393
from flask_wtf import FlaskForm from flask_wtf.file import FileField, FileRequired, FileAllowed class CSVUploadForm(FlaskForm): csvfile = FileField( "CSV Mark Sheet", validators=[FileRequired(), FileAllowed(["csv"], "CSV Files only!")], )
2.359375
2
recommendation-api/models/next_song_prediction/retrain.py
Kabeers-Network/yebrmusic
1
31394
import pandas as pd from tensorflow import keras, reduce_sum, ragged, function, math, nn, reduce_mean from os import environ class MaskedEmbeddingsAggregatorLayer(keras.layers.Layer): def __init__(self, agg_mode='sum', **kwargs): super(MaskedEmbeddingsAggregatorLayer, self).__init__(**kwargs) if ...
2.59375
3
examples/example_plugin/example_plugin/tables.py
susanhooks/nautobot
0
31395
import django_tables2 as tables from nautobot.utilities.tables import ( BaseTable, ButtonsColumn, ToggleColumn, ) from example_plugin.models import AnotherExampleModel, ExampleModel class ExampleModelTable(BaseTable): """Table for list view of `ExampleModel` objects.""" pk = ToggleColumn() ...
2.46875
2
pyfacebook/utils/reformat_response.py
Socian-Ltd/python-facebook-1
0
31396
<filename>pyfacebook/utils/reformat_response.py import json from typing import Optional, Union, Dict def replace_from_keyword_in_json( data, # type: Optional[Dict] ): # type: (...) -> Dict """ Rename the 'from' field coming from the Graph API. As 'from' is a Python keyword, we cannot use this as a...
2.9375
3
tests/test_ctparse.py
bharathi-srini/ctparse
0
31397
from unittest import TestCase from datetime import datetime from ctparse.ctparse import ctparse, _match_rule from ctparse.types import Time class TestCTParse(TestCase): def test_ctparse(self): txt = '12.12.2020' res = ctparse(txt) self.assertEqual(res.resolution, Time(year=2020, month=12,...
3.015625
3
src/data/preprocessing/rescale_videos.py
HochulHwang/gc_test
0
31398
<reponame>HochulHwang/gc_test import argparse import os import subprocess import time import sys import ipdb import pickle from utils.meter import * def main(args): # Parameters from the args dir, h, w, fps, common_suffix = args.dir, args.height, args.width, args.fps, args.common_suffix # avi dir dir...
2.21875
2
sample_linear.py
Oleg-Krivosheev/Sample-Gamma-small-alpha
0
31399
<filename>sample_linear.py<gh_stars>0 #!/usr/bin/env python import math import random import matplotlib.pyplot as plt # sample from linear distribution and plot it bins = [0.1 * i for i in range(12)] plt.hist([(1.0 - math.sqrt(random.random())) for k in range(10000)], bins) plt.show()
3.046875
3