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
flatisfy/cmds.py
guix77/Flatisfy
0
12771351
# coding: utf-8 """ Main commands available for flatisfy. """ from __future__ import absolute_import, print_function, unicode_literals import collections import logging import os import flatisfy.filters from flatisfy import database from flatisfy import email from flatisfy.models import flat as flat_model from flatis...
2.390625
2
individuals/arantza/03_language_replacement/paragraph_3.py
periode/software-art-text
2
12771352
<reponame>periode/software-art-text #### import modules #### from textblob import TextBlob import random import re #### import twitter database into program #### word_database = [] with open('final_dataset.txt') as my_file: word_database = my_file.read().split() #### join and process words #### database_sentence ...
3.125
3
tutorial/relationship/many_to_many.py
aebrahim/FastAPIQuickCRUD
0
12771353
import uvicorn from fastapi import FastAPI, Depends from sqlalchemy.orm import declarative_base, sessionmaker from fastapi_quickcrud import CrudMethods from fastapi_quickcrud import crud_router_builder from fastapi_quickcrud import sqlalchemy_to_pydantic from fastapi_quickcrud.misc.memory_sql import sync_memory_db ap...
2.234375
2
aliyun-python-sdk-videoenhan/aliyunsdkvideoenhan/request/v20200320/ChangeVideoSizeRequest.py
yndu13/aliyun-openapi-python-sdk
1,001
12771354
<filename>aliyun-python-sdk-videoenhan/aliyunsdkvideoenhan/request/v20200320/ChangeVideoSizeRequest.py<gh_stars>1000+ # 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 ...
1.9375
2
tests/r/test_bio_chemists.py
hajime9652/observations
199
12771355
<reponame>hajime9652/observations<gh_stars>100-1000 from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.bio_chemists import bio_chemists def test_bio_chemists(): """Test module bio_chemists.py by ...
2.40625
2
src/relstorage/adapters/tests/test_batch.py
enfold/relstorage
40
12771356
############################################################################## # # Copyright (c) 2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
2.125
2
sasmodels/models/two_power_law.py
jmborr/sasmodels
0
12771357
r""" Definition ---------- The scattering intensity $I(q)$ is calculated as .. math:: I(q) = \begin{cases} A q^{-m1} + \text{background} & q <= q_c \\ C q^{-m2} + \text{background} & q > q_c \end{cases} where $q_c$ = the location of the crossover from one slope to the other, $A$ = the scaling coeffi...
2.6875
3
012.py
Mytho/project-euler-python
1
12771358
<reponame>Mytho/project-euler-python #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ PROBLEM 12 ---------- The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6...
3.90625
4
venv/Lib/site-packages/flask_administration/blueprints.py
DoesArt-Studios/RamBrowse
1
12771359
<gh_stars>1-10 from flask import jsonify, Blueprint, request, Response, render_template from .utils import (static_folder, template_folder, encode_model) admin = Blueprint('main', 'flask.ext.administration.main', static_folder=static_folder, template_folder=template_...
1.679688
2
manage.py
eolchina/tna.pyspecies
0
12771360
#!/usr/bin/env python # # manage.py 用于启动程序以及其他的程序任务 import os # from flask import Flask # from flask_sqlalchemy import SQLAlchemy from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import app, db from flask_debugtoolbar import DebugToolbarExtension app.config.from_object(os.en...
2.140625
2
frontends/relay-futil/compiler.py
tedbauer/futil
1
12771361
<filename>frontends/relay-futil/compiler.py from tvm import relay, ir from tvm.relay.expr_functor import ExprFunctor from tvm.relay.function import Function import textwrap from collections import namedtuple, defaultdict import math from pretty_print import * from utilities import * from futil_ast import * # Map stan...
2.34375
2
test/record/parser/test_response_whois_in_ua_status_registered.py
huyphan/pyyawhois
0
12771362
<reponame>huyphan/pyyawhois<gh_stars>0 # This file is autogenerated. Do not edit it manually. # If you want change the content of this file, edit # # spec/fixtures/responses/whois.in.ua/status_registered # # and regenerate the tests with the following script # # $ scripts/generate_tests.py # from nose.tools impor...
2.078125
2
phase_2/pkg_KOG/class_hero.py
Jackson-Cong/191130
0
12771363
<reponame>Jackson-Cong/191130 # -*- coding: UTF-8 -*- import random class Hero(): ''' skin = '英雄原始皮肤' name = '英雄姓名' position = '英雄定位' ab_viability = 0 ab_damage = 0 ab_effect = 0 ab_difficulty = 0 ''' def __init__(self, s, n, p): '初始化英雄类' self.skin = s ...
3.28125
3
src/model.py
talipucar/PyFlow_DomainAdaptation
1
12771364
<filename>src/model.py """ Author: <NAME>: <EMAIL> Version: 0.2 - Added support for unsupervised and semi-supervised training. Description: Class to train an Autoencoder using multiple datasets with same number of features and to align their latent representations. It is configured such that it expects 3 datas...
2.828125
3
regTests.py
RyanClinton777/graph-theory-project
0
12771365
import ShuntingYard_RE import ThompsonConstruct def runTests(): # List of ["Regular Expression", ["Strings"...]] # (Infix Regular Expressions) tests = [ ["(a.b|b*)", ["", "ab", "b", "bb", "a"]], ["a.(b.b)*.a", ["aa", "bb", "abba", "aba"]], ["1.(0.0)*.1", ["11",...
2.78125
3
env/lib/python3.6/site-packages/jeepney/__init__.py
michaelpeterswa/darkthyme
1
12771366
<reponame>michaelpeterswa/darkthyme<gh_stars>1-10 """Low-level, pure Python DBus protocol wrapper. """ from .auth import AuthenticationError from .low_level import Message, Parser from .bus import find_session_bus, find_system_bus from .wrappers import * __version__ = '0.4.3'
1.15625
1
adx_lib/pjnz_file.py
jonathansberry/adx_lib
0
12771367
<reponame>jonathansberry/adx_lib<filename>adx_lib/pjnz_file.py<gh_stars>0 from rpy2.robjects import r, pandas2ri, packages from rpy2.rinterface import NALogicalType import pandas import numpy import zipfile import io import re import logging # Setup R packages to import the data utils = packages.importr("utils") if no...
2.4375
2
archive/google_stuff.py
Tahlor/cleanvid
0
12771368
import os import pickle from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from googleapiclient.errors import HttpError SCOPES = ['https://www.googleapis.com/auth/calendar.events', 'https://www.googleap...
2.796875
3
djTest/pages.py
born2code4u/game
0
12771369
from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants def detail(request, question_id): question = get_object_or_404(Question, pk=question_id) return render(request, 'djTest/index.html', {'question': question}) class MyPage(Page): pass clas...
2.234375
2
addons/mendeley/views.py
gaybro8777/osf.io
628
12771370
# -*- coding: utf-8 -*- from .provider import MendeleyCitationsProvider from website.citations.views import GenericCitationViews mendeley_views = GenericCitationViews('mendeley', MendeleyCitationsProvider)
1.226563
1
19-10-15-exercises/main.py
stogacs/cscex
0
12771371
<filename>19-10-15-exercises/main.py ''' Conestoga Computer Science Club Programming Challenges Instructions: Finish each method and run the test.py file to test the methods. ''' ''' Karaca Encrypt -------------- Make a function that encrypts a given input with these steps: Input: "apple" Step 1: Reverse the inpu...
4.21875
4
messages/ClientAddContributorMessage.py
zadjii/nebula
2
12771372
# last generated 2016-10-14 13:51:52.131000 from messages import BaseMessage from msg_codes import CLIENT_ADD_CONTRIBUTOR as CLIENT_ADD_CONTRIBUTOR __author__ = 'Mike' class ClientAddContributorMessage(BaseMessage): def __init__(self, sid=None, new_user_id=None, cloud_uname=None, cname=None, fpath=None, permissio...
2.078125
2
tests/python/test_units.py
aTrotier/sycomore
14
12771373
<reponame>aTrotier/sycomore<gh_stars>10-100 import unittest import sycomore from sycomore.units import * class TestUnits(unittest.TestCase): def test_basic_unit(self): length = 100*cm self.assertEqual(length.magnitude, 1) self.assertEqual(length.dimensions, sycomore.Length) def test_d...
2.59375
3
SQL/1068. Product Sales Analysis I.py
joshlyman/Josh-LeetCode
0
12771374
-- Write an SQL query that reports all product names of the products in the Sales table along with their selling year and price. -- For example: -- Sales table: -- +---------+------------+------+----------+-------+ -- | sale_id | product_id | year | quantity | price | -- +---------+------------+------+----------+----...
3.03125
3
tools/dns-sync/dns_sync/api.py
ruchirjain86/professional-services
2,116
12771375
# Copyright 2017 Google Inc. # # 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 wr...
2.609375
3
django_simple_coupons/actions.py
brunovila/django-simple-coupons
19
12771376
<filename>django_simple_coupons/actions.py from django.contrib.admin import ModelAdmin from django.utils import timezone # Create your actions here # ======================== def reset_coupon_usage(modeladmin, request, queryset): for coupon_user in queryset: coupon_user.times_used = 0 coupon_user....
2.25
2
rrs/tools/dump_upgrades.py
ardier/layerindex-web
0
12771377
<gh_stars>0 #!/usr/bin/env python3 # # Copyright (C) 2019 Intel Corporation # Author: <NAME> <<EMAIL>> # # Licensed under the MIT license, see COPYING.MIT for details # # SPDX-License-Identifier: MIT import sys import os.path sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))) sys.p...
1.984375
2
pid.py
hrafnkelle/pid-autotune
97
12771378
<reponame>hrafnkelle/pid-autotune from time import time import logging # Based on Arduino PID Library # See https://github.com/br3ttb/Arduino-PID-Library class PIDArduino(object): """A proportional-integral-derivative controller. Args: sampletime (float): The interval between calc() calls. kp...
3.109375
3
global_variables.py
DirkZomerdijk/status
0
12771379
#%% # dutch_w = 0.664 # turkish_w = 0.075 # moroccan_w = 0.13 # ghanaian_w = 0.021 # suriname_w = 0.11 # sample_n = 4000 # dutch_pop = sample_n * dutch_w # suriname_pop = sample_n * suriname_w # turkish_pop = sample_n * turkish_w # moroccan_pop = sample_n * moroccan_w # ghanaian_pop = sample_n * ghanaian_w # ethn...
1.789063
2
airtech/apps/flights/urls.py
sam-karis/airtech
0
12771380
<reponame>sam-karis/airtech from django.urls import path from airtech.apps.flights.views import GetAllFlightsAPIView app_name = 'flight' urlpatterns = [ path('flights/', GetAllFlightsAPIView.as_view(), name='flights'), ]
1.679688
2
plugins/photos/__init__.py
mohnjahoney/website_source
13
12771381
<reponame>mohnjahoney/website_source from .photos import *
1.070313
1
tests/test_client.py
max-arnold/python-block-disposable-email
0
12771382
# -*- coding: utf-8 -*- import os from io import StringIO import json import pytest from unittest.mock import patch from bdea.client import BDEAClient, URLError from bdea.client import is_disposable_domain, is_disposable_email class TestBDEAClientRequest(object): def test_urlerror_returns_empty(self): ...
2.453125
2
emlx_parse/time_utls.py
crb912/emlx_parse
8
12771383
<filename>emlx_parse/time_utls.py """ Date and Time Converting. """ import datetime from dateutil import parser import pytz IOS_UTC_FORMAT = '%Y-%m-%dT%H:%M:%SZ' UTC_FORMAT = '%Y-%m-%dT%H:%M:%S+00:00' def time_str_to_utc_str(time_str: str) -> str: """Return UTC str from arbitrary timezone time string. Abo...
3.359375
3
run_modes/parallel_run.py
seblee97/run_modes
0
12771384
<filename>run_modes/parallel_run.py import os from typing import List, Type from config_manager import base_configuration from run_modes import base_runner, constants, single_run, utils try: import torch.multiprocessing as mp except ModuleNotFoundError: import multiprocessing as mp def parallel_run( run...
2.265625
2
app/commands/default/slack_send.py
mallycrip/jenkinsfile-converter
0
12771385
from app.commands.default import BaseCommand class SlackSend(BaseCommand): def get_command(self, color, message) -> str: return self.generate_command(color, message) @classmethod def generate_command(cls, color, message): return f'slackSend (color: "{color}", message: """\\\n{message}"""....
2.515625
3
squish/test.py
bd-j/squish
2
12771386
<filename>squish/test.py import numpy as np import corner as triangle from sampler import SliceSampler def lnprob_gaussian(x, ivar): return -0.5 * np.sum(ivar * x ** 2) def rosenbrock(x, a=1, b=100): f = ((a - x[0])**2 + b * (x[1] - x[0]**2)**2) return -f def test_gaussian(niter=10000, ndim=2): i...
2.46875
2
node_modules/nuclide/pkg/nuclide-server/scripts/utils.py
kevingatera/kgatewebapp
1
12771387
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. from __future__ import print_function import httplib import logging import os import re import socket import ssl import subproce...
2.078125
2
functions_cache/engines/base.py
BalighMehrez/functions-cache
0
12771388
<gh_stars>0 #!/usr/bin/env python """ functions_cache.engines.base ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Contains BaseCache class which can be used as in-memory cache engine or extended to support persistence. """ import hashlib from datetime import datetime, timezone from io import BytesIO from typing import A...
3.015625
3
test/tests.py
jealuna/NReinas
0
12771389
import pytest import reinas.queens as queens import numpy as np import models.consultas as consultas def test_numero_reinas(numero): n = int(numero) lista_soluciones = [] session = consultas.loadSession() tablero = np.zeros(shape=(n,n),dtype=int) queens.n_reinas(tablero,0,lista_soluciones) ...
2.296875
2
knownly/console/tests/test_models.py
dwightgunning/knownly
2
12771390
<gh_stars>1-10 from django.test import TestCase from knownly.console.models import DropboxUser class DropboxUserTests(TestCase): fixtures = ['test_fixtures.json'] def test_has_activated_website_true(self): user = DropboxUser.objects.get( django_user__email="<EMAIL>") self.assertT...
2.5
2
apps/article/urls.py
moogoo78/portal20
7
12771391
from django.urls import path, re_path from . import views urlpatterns = [ path('category/<str:category>/', views.article_list, name='article-list'), path('tag/<str:tag_name>/', views.article_tag_list, name='article-tag-list'), path('<int:pk>/', views.article_detail, name='article-detail-id'), #path('<...
1.890625
2
tests/test_graphic_coloring_engine.py
filosfino/graphic-coloring-engine
0
12771392
import logging from shapely.geometry.multipolygon import MultiPolygon from shapely.geometry.polygon import Polygon from snapshottest import TestCase from graphic_coloring_engine.core import ( Color, ColorChoice, ColoringEngine, ColoringEngineConstants, Coordinate, DominantColor, Layer, ...
2.25
2
program/object-detection-tf-py/tensorRT_hooks.py
G4V/ck-tensorflow
108
12771393
''' hooks for using tensorRT with the object detection program. names and parameters are defined as required by the detect.py infrastructure. ''' import tensorflow as tf import tensorflow.contrib.tensorrt as trt def load_graph_tensorrt(params): graph_def = tf.compat.v1.GraphDef() with tf.compat.v1.gfile.GFile(pa...
2.515625
3
tasks/task_11.2_triangle/test_gerone.py
ivanguy/python-course-tasks
0
12771394
<filename>tasks/task_11.2_triangle/test_gerone.py #!/usr/bin/env python from unittest.mock import patch import unittest import gerone mocked_input = """0 0 0 3 4 0""".split() @patch(target='builtins.input', side_effect=mocked_input) class TestInput(unittest.TestCase): def setUp(self): super().setUp() ...
3.046875
3
tests/run_tests.py
alercebroker/lc_correction
0
12771395
import unittest import os import sys FILE_PATH = os.path.dirname(os.path.abspath(__file__)) sys.path.append(FILE_PATH) from ZTF_correction import * if __name__ == "__main__": unittest.main()
1.710938
2
despike.py
ColinBrosseau/DataManipulation
0
12771396
<reponame>ColinBrosseau/DataManipulation import numpy as np def despike_background(y, length, threshold=3.5, order=6, verbose=False): """ Despike the vector y using background estimation. Inputs: y (vector) Evenly spaced vector length (in...
3
3
name_generator/generator.py
cookyt/name-generator
1
12771397
<reponame>cookyt/name-generator #! /usr/bin/env python2 import os import random from collections import defaultdict def GetNames(fname): with open(fname, 'r') as fin: names = [name.strip().lower() for name in fin.readlines()] return names class WordGenerator(object): ''' Generates words using statistical...
3.71875
4
rldb/db/paper__gorila_dqn/algo__dqn/entries.py
seungjaeryanlee/sotarl
45
12771398
entries = [ { 'env-title': 'atari-alien', 'env-variant': 'Human start', 'score': 570.20, }, { 'env-title': 'atari-amidar', 'env-variant': 'Human start', 'score': 133.40, }, { 'env-title': 'atari-assault', 'env-variant': 'Human start', ...
1.515625
2
experiments/distributed.py
DeNeutoy/flowseq
256
12771399
<reponame>DeNeutoy/flowseq import sys import os current_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(root_path) import json import signal import threading import torch from flownmt.data import NMTDataSet import experiments...
1.984375
2
config.py
superiorkid/todo
0
12771400
import os class Config(object): SECRET_KEY = os.environ.get('SECRET_KEY') or os.urandom(32) SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'postgresql://superiorkid:root@localhost/todo' SQLALCHEMY_TRACK_MODIFICATIONS = False
1.882813
2
examples/insertion_sort.py
kelsheyk/coverageRanker
25
12771401
from pyllist import dllist #Classical implementation, requires manipulations with indexes def ins_sort(array): for i in range(1, len(array)): for k in range(i, 0, -1): if array[k] < array[k - 1]: array[k], array[k - 1] = array[k - 1], array[k] return array #Linked-list im...
3.90625
4
tests/test_cuckoofilter/generate_testfile.py
crownstone/crownstone-lib-python-core
0
12771402
""" Script for generating a .csv.cuck file with a few parameters. """ import sys, os, random def getPathFromFileName(fname): if not fname.find(os.path.pathsep): fname = os.path.join(os.path.dirname(__file__), fname) return fname if __name__ == "__main__": ### arg parsing if len(sys.argv) < 5 ...
3.453125
3
arclines/misc/low_redux.py
pypeit/arclines
2
12771403
<reponame>pypeit/arclines<filename>arclines/misc/low_redux.py """ Generate hdf5 files from LowRedux save files """ from __future__ import print_function, absolute_import, division, unicode_literals import os import numpy as np import pdb import h5py from scipy.io.idl import readsav from astropy.table import Table fro...
2.328125
2
problems/que-shi-de-shu-zi-lcof/solution.py
MleMoe/LeetCode-1
2
12771404
<filename>problems/que-shi-de-shu-zi-lcof/solution.py from typing import List class Solution: def missingNumber(self, nums: List[int]) -> int: length = len(nums) for i in range(length): if i != nums[i]: return i return length if __name__ == '__main__': tes...
3.78125
4
zerver/webhooks/trello/view/templates.py
Supermanu/zulip
1
12771405
TRELLO_SUBJECT_TEMPLATE = u'{board_name}.' TRELLO_MESSAGE_TEMPLATE = u'{full_name} {rest}.'
0.910156
1
discrete_fuzzy_operators/decision_making/yager_aggregation.py
mmunar97/discrete-fuzzy-operators
0
12771406
<filename>discrete_fuzzy_operators/decision_making/yager_aggregation.py<gh_stars>0 from typing import Callable, List, Tuple def yager_aggregation_decision_making(assessments: List[List[int]], aggregation_function: Callable[[List[int]], int]) -> Tuple[int, int]: """ Computes the best alternative from a matrix ...
3.828125
4
buoi7/bai3.py
Viet7501/viet1
0
12771407
''' Cho một list chứa nhiều phần tử mang nhiều kiểu dữ liệu khác nhau, trong đó có một phần tử kiểu tuple. Viết chương trình đếm số lượng các phần tử trong một list đó, đến khi gặp một phần tử kiểu tuple. ''' list = [1, 2, 'Vietnam', (99, 'hello', 2 + 3j)] count = 0 print(type(list[3])) for i in r...
4.03125
4
__init__.py
gszy/kicad-boardview
116
12771408
import pcbnew import os from .pcbnew2boardview import convert class Pcbnew2Boardview(pcbnew.ActionPlugin): def defaults(self): self.name = "Pcbnew to Boardview" self.category = "Read PCB" self.description = "Generate Boardview file from KiCad pcb." def Run(self): kicad_pcb =...
2.625
3
monitor/migrations/0004_auto_20170912_1037.py
gserv/mining_monitor
0
12771409
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-12 02:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('monitor', '0003_auto_20170912_1018'), ] operations = [ migrations.AddField(...
1.664063
2
pexels_cli/pexels_cli.py
amirzenoozi/pexels-crawler-cli
1
12771410
<reponame>amirzenoozi/pexels-crawler-cli<gh_stars>1-10 __author__ = "<NAME>" __license__ = "MIT" __version__ = "0.1.0" __proxy__ = False __doc__ = """ Pexels CLI Crawler Usage: pexels search [--show-browser] [--load-time=<seconds>] [--page-count=<count>] <keyword> pexels -h | --help pexels -v | --v...
2.21875
2
learning/md2hugo.py
trib0r3/scripts
0
12771411
import argparse import datetime DESCRIPTION = "Convert markdown to hugo post page" HUGO_POST_FORMAT = """--- title: "{}" date: {} --- <!--more--> """ def convert(source, dest, img_dest, time): assert isinstance(source, file) assert isinstance(dest, file) # create heading title = source.readline()....
3.0625
3
tests/unit/test_regmap.py
crzdg/acconeer-python-exploration
0
12771412
import inspect import pytest import acconeer.exptool.structs.configbase as cb from acconeer.exptool import configs from acconeer.exptool.clients.reg import regmap from acconeer.exptool.modes import Mode BO = regmap.BYTEORDER def test_full_names_unique(): unique_names = set([r.full_name for r in regmap.REGISTE...
1.9375
2
align/detect_align.py
taan02991/WarpGAN
0
12771413
"""Align face images given landmarks.""" # MIT License # # Copyright (c) 2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the...
2.21875
2
getprices_api.py
real-poker/Polygon-FarmTools
0
12771414
<gh_stars>0 # -*- coding: utf-8 -*- import requests import time import json import os if os.path.isfile('tokendict.json'): with open('tokendict.json', 'r') as f: token_contract = json.loads(f.read()) token_ids = [] for token in token_contract: response = requests.get('https://api.coingecko.com/api/v3...
2.921875
3
classes/Speak.py
Sunuba/roc
23
12771415
import pyttsx3 class Speak: def __init__(self): self.speaker = pyttsx3.init(driverName='sapi5') # self.speaker.setProperty('voice', 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_ZIRA_11.0') def speak(self, text): pass self.speaker.say(text) s...
2.390625
2
backend/banner/urls/oj.py
skku-npc/SKKU_Coding_Platform
1
12771416
<gh_stars>1-10 from django.urls import path from ..views.oj import BannerAPI urlpatterns = [ path("banner/", BannerAPI.as_view(), name="banner_api") ]
1.492188
1
src/estimate_start_times/estimator.py
AutomatedProcessImprovement/start-time-estimator
0
12771417
<filename>src/estimate_start_times/estimator.py import math from datetime import timedelta from statistics import mode import numpy as np import pandas as pd from estimate_start_times.concurrency_oracle import NoConcurrencyOracle, AlphaConcurrencyOracle, \ HeuristicsConcurrencyOracle, DeactivatedConcurrencyOracle...
2.21875
2
__init__.py
dx1983/qgis-server-font-loader
2
12771418
# -*- coding: utf-8 -*- def serverClassFactory(serverIface): from .FontLoader import FontLoaderServer return FontLoaderServer(serverIface)
1.546875
2
examples/ComputeAreaWithConsoleInput.py
Ellis0817/Introduction-to-Programming-Using-Python
0
12771419
# Prompt the user to enter a radius radius = eval(input("Enter a number for radius: ")) # Compute area area = radius * radius * 3.14159 # Display results print("The area for the circle of radius", radius, "is", area)
4.34375
4
deliverables/deliverables_3/dashflaskapp/flaskapp/macros_plotly/dashboard.py
NicholasGoh/real_estate_app
0
12771420
<reponame>NicholasGoh/real_estate_app import dash from dash.dependencies import Input, Output import plotly.express as px import dash_html_components as html import dash_core_components as dcc import dash_bootstrap_components as dbc import pandas as pd # self packages from .data_generator import load_gdp, load_hpi, lo...
2.875
3
tests/test_utils.py
localuser2/pre-commit-hooks
164
12771421
<reponame>localuser2/pre-commit-hooks<filename>tests/test_utils.py #!/usr/bin/env python3 import difflib import os import re import shutil import subprocess as sp import sys import pytest test_file_strs = { "ok.c": '// Copyright 2021 <NAME>\n#include <stdio.h>\n\nint main() {\n printf("Hello World!\\n");\n retu...
2.5
2
views/__init__.py
darshanshewale/facerecognition
66
12771422
from flask import render_template, request, redirect, url_for, session from app import app from model import * @app.route('/', methods=["GET"]) def home(): if "username" in session: return render_template('index.html') else: return render_template('login.html') # Register new user @app.route('...
2.890625
3
sparseConv/multitask/finetune/data_loader.py
ShengyuH/Scene-Recognition-in-3D
48
12771423
import torch, numpy as np, glob, math, torch.utils.data, scipy.ndimage, multiprocessing as mp import math import MinkowskiEngine as ME from torch.utils.data.sampler import Sampler import os,sys MAX_POINTS=3000000 SEM_COLOR_MAP = { 0: (0., 0., 0.), 1: (174., 199., 232.), 2: (152., 223., 138.), 3: (31.,...
1.757813
2
google-dinosaur/google_dinosaur.py
cameronweibel/python-game-automation
5
12771424
<gh_stars>1-10 import mss import cv2 import numpy as np import keyboard import pyautogui import time pyautogui.PAUSE = 0.01 def take_screenshot(): with mss.mss() as sct: filename = sct.shot(output='fullscreen.png') return filename def get_frame(region): with mss.mss() as sct: screen = np....
2.671875
3
optimization/shared/fed_dual_avg_schedule.py
diptanshumittal/FCO-ICML21
4
12771425
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
2.109375
2
day04.py
joelgrus/advent2021
13
12771426
<reponame>joelgrus/advent2021 from typing import List RAW = """7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1 22 13 17 11 0 8 2 23 4 24 21 9 14 16 7 6 10 3 18 5 1 12 20 15 19 3 15 0 2 22 9 18 13 17 5 19 8 7 25 23 20 11 10 24 4 14 21 16 12 6 14 21 17 24 4 10 16 15 9 19 18...
3.421875
3
setup.py
arsham/django-cachedpaginator
5
12771427
<filename>setup.py<gh_stars>1-10 # -*- coding: utf-8 -*- import os from setuptools import setup, find_packages def read_file(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() setup( name='django-cachedpaginator', version=__import__('django_cachedpaginator').__version__, ...
1.53125
2
python/tasks/task11.py
eiseazei/core
0
12771428
#! /usr/bin/python3.7 from common import test_input_integer, \ handle_age_input, \ num_denum, \ week_day # test user input and make exception if bad test_input_integer() # test age value handle_age_input() # test two input values and divide num_denum() # pri...
3.515625
4
tester.py
abr-98/Chatbot_modified
10
12771429
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import webbrowser import requests import time import datetime from bs4 impo...
3.140625
3
08_Paquetes/8.1_uso-paquetes.py
alemr214/curso-python-desde-cero
0
12771430
<filename>08_Paquetes/8.1_uso-paquetes.py<gh_stars>0 # Se llama a un modulo del paquete "paquetito" usando todas sus funcionalidades from paquetito.funcionesMatematicas import * def main(): print(sumar(5, 4)) if __name__ == '__main__': main()
2.171875
2
src/py21cmmc/prior.py
dprelogo/21CMMC
0
12771431
<gh_stars>0 """Module containing additional priors to be used in 21CMMC.""" import logging import numpy as np from functools import partial from sklearn.neighbors import KernelDensity from . import likelihood logger = logging.getLogger("21cmFAST") class PriorBase(likelihood.LikelihoodBase): """Base prior class...
2.40625
2
strats/always_come.py
crschmidt/crapssim
0
12771432
<filename>strats/always_come.py #!/usr/bin/python # Copyright 2022 <NAME> # # 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 req...
2.359375
2
clubadmin/config/memadmin.py
rpmoseley/clubadmin
0
12771433
<reponame>rpmoseley/clubadmin ''' This module provides the configuration information for the database used by the memadmin sub-package of the ClubAdmin package. ''' from .options import DefaultOptions
1.179688
1
notebooks/vbm/spm.py
tobiashepp/brainage
1
12771434
import time from pathlib import Path import scipy.io import pandas as pd import numpy as np import matplotlib.pyplot as plt import nibabel as nib from nilearn import datasets from nilearn.input_data import MultiNiftiMasker from nilearn.image import get_data from nilearn.mass_univariate import permuted_ols from sklea...
1.90625
2
delete.py
cemitchell07/sgmatrix_to_swe
1
12771435
<gh_stars>1-10 ########################################################################################## ## Delete Functions for Identity Services Engine and Stealthwatch SMC ## ## This script contains all functions used to delete events from SMC for ## sgmatrix_to_swe.py ############################################...
1.429688
1
heartrate.py
oldnapalm/vpower
14
12771436
<filename>heartrate.py #!/usr/bin/env python import os, sys import time import csv import platform from ant.core import driver from ant.core import node from ant.plus.heartrate import * from usb.core import find from PowerMeterTx import PowerMeterTx from config import DEBUG, LOG, NETKEY, POWER_SENSOR_ID from functio...
2.546875
3
parser/parse.py
raymond-s/data-visualizer
0
12771437
<filename>parser/parse.py #!/usr/bin/env python2.7 import json import csv import sys import os import keen import itertools import urllib3 urllib3.disable_warnings() csv.field_size_limit(sys.maxsize) data_rows = [] #helper function to check if incoming data is a decimal number def isfloat(value): ...
3.359375
3
deformable_conv.py
kennis-coder/multimodal_generative_fusion_framework
1
12771438
<gh_stars>1-10 # -*- encoding: utf-8 -*- # @Date : 6/27/19 # @Author : <NAME> from keras import activations from keras import constraints from keras import initializers from keras import regularizers from keras.backend import (arange, reshape, flatten, ...
2.09375
2
jsonrpc/tests/test_backend_django/settings.py
DMantis/json-rpc
409
12771439
SECRET_KEY = 'secret' ROOT_URLCONF = 'jsonrpc.tests.test_backend_django.urls' ALLOWED_HOSTS = ['testserver'] DATABASE_ENGINE = 'django.db.backends.sqlite3' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } JSONRPC_MAP_VIEW_ENABLED = True
1.296875
1
registry/packages.py
AraOshin/civic-sandbox-backend
1
12771440
<reponame>AraOshin/civic-sandbox-backend<gh_stars>1-10 packages = { 'Greenspace': { 'description': '', 'foundations' : [ 'neighborhood_development_18_027', 'neighborhood_development_18_021' ], 'default_foundation' : 'neighborhood_development_18_027', 'slides' : [ 'ne...
1.210938
1
instabot/user/user.py
SOUFIANEZAZA/instapro
84
12771441
import hashlib import json import os import pickle import uuid import requests import logging from .. import config from ..api.request import Request users_folder_path = config.PROJECT_FOLDER_PATH + config.USERS_FOLDER_NAME class Dotdict(dict): __getattr__ = dict.get __setattr__ = dict.__setitem__ __dela...
2.171875
2
setup.py
frague59/django-yamlfield
0
12771442
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from distutils.core import Command class TestCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): from django.conf impo...
1.945313
2
2020/Day 21/advent.py
Urgau/advent_of_code
0
12771443
#!/usr/bin/env python3 import sys def main(args): with open(args[1], "r") as file: ingredients = [] allergens = {} repices = [] for line in file: line = line.strip().replace(",", " ")[:-1] sIngredients, sAllergens = line.split("(contains") lIngr...
3.4375
3
13Dec2016.py
andela-dmigwi/project-euler-solutions
0
12771444
<reponame>andela-dmigwi/project-euler-solutions # Solution 2 # def fib(num, l=[]): # a=b=1 # while(True): # a+=b # if a % 2 == 0: # l.append(a) # a,b=b,a # if a >= num: # break # return l # print(sum(fib(4000000))) # Solution 3 # import math # def factors(num): # factors_list...
3.203125
3
tests/test_flaskapp.py
ricardochaves/flask_template
1
12771445
import pytest from app import app @pytest.fixture def client(): client = app.test_client() yield client def test_empty_db(client): """Start with a blank database.""" rv = client.get("/") assert b"Hello World!" in rv.data
2.34375
2
tests/test_projection.py
SnowEx/snowexsql
5
12771446
import shutil from os import mkdir, remove from os.path import dirname, isdir, isfile, join import pytest from geoalchemy2.shape import to_shape from geoalchemy2.types import WKTElement from numpy.testing import assert_almost_equal from rasterio.crs import CRS from snowexsql.projection import * @pytest.mark.paramet...
1.976563
2
vqa_experiments/s_mac/s_write_unit.py
Bidur-Khanal/REMIND
67
12771447
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # MIT License # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitatio...
1.28125
1
bot/__init__.py
SmartManoj/run-py-bot
0
12771448
'''Run Python Code on Telegram [BOT]'''
1.085938
1
zen.py
plovefish/python-sdprac
0
12771449
import urllib.request from bs4 import BeautifulSoup from random import randint # fetch the full html fp = urllib.request.urlopen("https://www.python.org/dev/peps/pep-0020/") mybytes = fp.read() mystr = mybytes.decode("utf8") fp.close() # fetch the zen of python soup = BeautifulSoup(mystr, 'html.parser') txt = soup.pr...
3.140625
3
mmdet2trt/core/__init__.py
tehkillerbee/mmdetection-to-tensorrt
496
12771450
<reponame>tehkillerbee/mmdetection-to-tensorrt from .anchor import * # noqa: F401,F403 from .bbox import * # noqa: F401,F403 from .post_processing import * # noqa: F401,F403
1.125
1