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
rally/plugins/openstack/scenarios/nova/flavors.py
TeamXgrid/xgrid-rally
1
12782351
<gh_stars>1-10 # Copyright 2015: Inc. # 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 requ...
1.835938
2
log_generator/es_settings.py
DobyLov/loggenerator
0
12782352
# es_settings index_template = { "index_patterns": ["loggen-*"], "settings": { "number_of_shards": 1, "number_of_replicas": 0, "index.lifecycle.name": "ilm_loggen", "index.lifecycle.rollover_alias": "loggen_rollov" } } test_index_template = { "index_patterns": ["loggen-*"], "settings": { ...
1.375
1
puchkidb/puchkidb_cli/commands/show.py
triump0870/puchkidb
0
12782353
from json import dumps from .base import Base class Show(Base): """Show the databases and the tables using this command. Usage: puchkidb show [options] options: dbs: show all the databases in the server tables: show all the tables inside a database Example: puchki...
2.953125
3
Leetcoding-Actions/Explore-Monthly-Challenges/2020-12/15-squaresOfASortedArray.py
shoaibur/SWE
1
12782354
<gh_stars>1-10 class Solution: def sortedSquares(self, nums: List[int]) -> List[int]: n = len(nums) i, j, k = 0, n - 1, n - 1 result = [0] * n while i <= j: if abs(nums[j] > abs(nums[i])): result[k] = nums[j] * nums[j] j -= 1 ...
3.046875
3
interview_qns/max_mushrooms_picked.py
shiram/learning-django-rest
0
12782355
<gh_stars>0 """ Problem: You are given a non-empty, zero-indexed array A of n (1 � n � 100 000) integers a0, a1, . . . , an−1 (0 � ai � 1 000). This array represents number of mushrooms growing on the consecutive spots along a road. You are also given integers k and m (0 � k, m < n). A mushroom picker is at spot number...
3.796875
4
pythonidbot/inline/hints.py
hexatester/pythonidbot
0
12782356
import logging from fuzzywuzzy import process from telegram import ( Update, InlineQuery, InlineQueryResultArticle, InlineKeyboardButton, InlineKeyboardMarkup, ) from telegram.ext import CallbackContext from typing import List, Optional from pythonidbot.constants import HINTS from pythonidbot.utils...
2.0625
2
plot/compare_algorithms.py
alod83/srp
2
12782357
# Compare Algorithms import pandas import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from sklearn import model_selection from sklearn.linear_model import LogisticRegression from sklearn.tree import DecisionTreeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.discriminant_...
2.578125
3
cobl/lexicon/migrations/0148_fill_romanisedsymbol.py
Bibiko/CoBL-public
3
12782358
<reponame>Bibiko/CoBL-public<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from django.db import migrations def forwards_func(apps, schema_editor): RomanisedSymbol = apps.get_model("lexicon", "RomanisedSymbol") allowedRomanised = { 'a', 'n', '-', 'm', 'i...
1.679688
2
lib/jsnes.py
Ekleog/jsmark
0
12782359
import os import subprocess as subp import sys class Bench: moreisbetter = False def run(interp): os.chdir(os.path.join(sys.path[0], 'vendor', 'jsnes', 'test')) res = subp.run([interp, 'shell-bench.js'], stdout=subp.PIPE, universal_newlines=True) if res.returncode != 0: ret...
2.296875
2
happy_birthder_script_tests.py
wis-software/rocketchat-tests-based-on-splinter
2
12782360
<filename>happy_birthder_script_tests.py #!/usr/bin/env python3 # Copyright 2018 <NAME> <<EMAIL>> # Copyright 2018 <NAME> <<EMAIL>> # Copyright 2018 <NAME> <<EMAIL>> # # 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 ...
2.15625
2
cropper.py
alfcrisci/pySIC
1
12782361
############################################################### import os import cv2 import math import numpy as np from scipy.ndimage import interpolation as inter from scipy.ndimage import rotate ############################################################### C_percentage = 0 ACCEPTED_EXTENSIONS = (".jpeg", ".jpg", "...
2.296875
2
cogs/admin.py
staciax/ValorantStoreChecker-discord-bot
37
12782362
<reponame>staciax/ValorantStoreChecker-discord-bot import discord from discord.ext import commands class Admin(commands.Cog): """Error handler""" def __init__(self, bot: commands.Bot) -> None: self.bot = bot @commands.command() # @commands.is_owner() async def sync(self, ctx: commands.Con...
2.28125
2
day-16/part-1/chloe.py
lypnol/adventofcode-2017
16
12782363
from runners.python import Submission class ChloeSubmission(Submission): def run(self, s): string = list('abcdefghijklmnop') choregraphie = s.split(',') for mouvement in choregraphie: if mouvement[0] == 's': longueur_groupe = int(mouvement[1:]) stringA = string[len(string) - longueur_groupe:] st...
3.46875
3
stubs.min/Autodesk/Revit/DB/__init___parts/Sweep.py
ricardyn/ironpython-stubs
1
12782364
<reponame>ricardyn/ironpython-stubs<gh_stars>1-10 class Sweep(GenericForm,IDisposable): """ A sweep solid or void form. """ def Dispose(self): """ Dispose(self: Element,A_0: bool) """ pass def getBoundingBox(self,*args): """ getBoundingBox(self: Element,view: View) -> BoundingBoxXYZ """ pass def Rel...
2.03125
2
Posture/show_marked.py
TY-Projects/Virtual-Yoga-App
0
12782365
<filename>Posture/show_marked.py<gh_stars>0 import cv2 import numpy as np cap = cv2.VideoCapture("./Videos/yoga_women7.avi") semaPhore = False while True: ret, frame = cap.read() if not ret: break print(frame[0,0,0]) if(not ret): break if(frame[0,0,0] > 250): semaPhore = no...
2.75
3
hyk/information/models/info_rutine.py
morwen1/hack_your_body
0
12782366
<reponame>morwen1/hack_your_body #django from django.db import models #utils from hyk.utils.models.abstract_hyb import HybModel from .Info_abstract import Info class Info_rutine (Info) : reps = models.IntegerField()
2.09375
2
PyQt5/Widget/DrawPointDemo.py
zhaokai0402/PyQt5-Study
0
12782367
<gh_stars>0 import sys, os, math #pylint: disable=E0602 sys.path.append(os.getcwd()) from importQt import * class DrawPointDemo(QWidget): def __init__(self): super().__init__() self.resize(300, 200) self.setWindowTitle("draw Point in window") def paintEvent(self, event): paint...
2.6875
3
2021_TetCTF/SuperCalc/findingChars.py
Haltz01/CTFs_Writeups
0
12782368
<gh_stars>0 #!/usr/bin/python3 wantedChars = ['$', '_', 'G', 'E', 'T', '[', ']'] availableChars = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '(', ')', '.', '~', '^', '|', '&', '+', '-', '*', '/' ] for char1 in availableChars...
3.625
4
daireVeMerkeziKareler/daireVeMerkeziKareler.py
emremrt98/Python-Projeleri
0
12782369
import turtle captain = turtle.Turtle() print("\n--------------------------") print("Ad ve Soyad : <NAME>\nOkul No : 203305028") print("----------------------------") kenar = float(input("Kenar Uzunluklarini Gir : ")) yariCap = float(input("Dairenin Yaricapini Gir : ")) x = 0 y = 0 count = 0 kenar += yariCap captain....
3.796875
4
setup.py
vvanholl/smsgateway
23
12782370
<filename>setup.py #!/usr/bin/env python from setuptools import setup with open('VERSION') as version_file: version = version_file.read() with open('README.rst') as readme_file: long_description = readme_file.read() with open('requirements.txt') as requirements_file: install_requires = requirements_file...
1.390625
1
sponge-app/sponge-app-demo-service/sponge/sponge_demo_context_actions_active.py
mnpas/sponge
9
12782371
""" Sponge Knowledge Base Demo - Action - Active context actions """ class ContextActionsActiveInactive(Action): def onConfigure(self): self.withLabel("Action with active/inactive context actions").withArgs([ BooleanType("active").withLabel("Active").withDefaultValue(False) ]).withNonCa...
2.640625
3
WEEKS/CD_Sata-Structures/_RESOURCES/sprint-prep/codesignal-my-solutions-master/boxBlurImage/boxBlurImage.py
webdevhub42/Lambda
0
12782372
<filename>WEEKS/CD_Sata-Structures/_RESOURCES/sprint-prep/codesignal-my-solutions-master/boxBlurImage/boxBlurImage.py def boxBlur(image): m = len(image) - 2 n = len(image[0]) - 2 blur_img = [[0] * n for _ in range(m)] for i in range(1, m + 1): for j in range(1, n + 1): indexes = [...
3.0625
3
tensorflow/python/ops/filesystem_ops.py
wainshine/tensorflow
54
12782373
<reponame>wainshine/tensorflow # Copyright 2021 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...
1.546875
2
gym_rubiks_cube/envs/functions.py
marc131183/3DimensionalRendering
0
12782374
from logging import error import numpy as np class Plane: def __init__(self, origin: np.array, vector1: np.array, vector2: np.array) -> None: self.origin = origin self.vector1 = vector1 self.vector2 = vector2 def getBarycentricCoordinates(self, point: np.array, direction: np.array): ...
3.140625
3
networks/dorn/dp/metircs/__init__.py
EvoCargo/mono_depth
0
12782375
<gh_stars>0 #!/usr/bin/python3 # -*- coding: utf-8 -*- def build_metrics(cfg): mod = __import__("{}.{}".format(__name__, "metrics"), fromlist=['']) return getattr(mod, "Metrics")() # noqa # return mod.Metrics
1.585938
2
tests/test_numba_toolbox_gpu.py
3d-pli/SLIX
5
12782376
import SLIX if SLIX.toolbox.gpu_available: print(SLIX.toolbox.gpu_available) from SLIX.GPU import _toolbox as ntoolbox import cupy from numba import cuda threads_per_block = (1, 1) blocks_per_grid = (1, 1) class TestNumbaToolboxGPU: def test_peak_cleanup(self): test_on...
2.125
2
antlir/vm/tpm.py
vmagro/antlir
0
12782377
<reponame>vmagro/antlir #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import subprocess import threading from dataclasses import dataclass, ...
2.015625
2
src/thexb/UTIL_converters.py
harris-2374/THEx
0
12782378
def convert_window_size_to_int(ws): """This function converts the shorthand input window size and returns an integer of the same value (i.e. "100kb" == int(100000))""" ws = ws.lower() window_units = ws[-2:] try: window_int = int(ws[:-2]) except ValueError: raise ValueError("Pleas...
3.984375
4
mapocr/segmentation.py
karimbahgat/mapocr
0
12782379
<reponame>karimbahgat/mapocr<filename>mapocr/segmentation.py import itertools import math import numpy as np import PIL from PIL import Image, ImageCms, ImageMorph, ImageFilter, ImageOps, ImageMath import cv2 from colormath.color_objects import sRGBColor, LabColor from colormath.color_conversions import convert_co...
2.78125
3
src/tests/unit/test_mail_models.py
uescher/byro
0
12782380
<gh_stars>0 import pytest from byro.mails.models import EMail from byro.mails.send import SendMailException @pytest.mark.django_db @pytest.mark.parametrize('skip_queue', (True, False)) def test_template_to_mail(mail_template, skip_queue): count = EMail.objects.count() mail_template.to_mail('test@localhost', ...
2.140625
2
02.NeoRegionLoader.py
buzzfactoryFE/AwsGraphDB
8
12782381
import os, csv, json from py2neo import Graph with open("./AWSNEoConfig.json") as c: conf = json.load(c) c.close graph = Graph(conf[0]["NeoParametes"][0]["Url"], auth=(conf[0]["NeoParametes"][0]["Username"], conf[0]["NeoParametes"][0]["Password"])) regions ="US East (Ohio),us-east-2\n\ US East (N. Virginia),us-...
2.84375
3
background/send_fake_charge_message.py
B-ROY/TESTGIT
2
12782382
<gh_stars>1-10 # -*- coding: utf-8 -*- import os import sys PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(PROJECT_ROOT, os.pardir)) sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '../'))) sys.path.append(os.path.abspath(os.path.join(os.path.abspath...
1.992188
2
python/example_code/lookoutvision/csv_to_manifest.py
grjan7/aws-doc-sdk-examples
1
12782383
<filename>python/example_code/lookoutvision/csv_to_manifest.py # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to create an Amazon Lookout for Vision manifest file from a CSV file. The CSV file format is image location,anomaly classificat...
2.984375
3
tests/test_hashutils.py
thurask/bbarchivist
7
12782384
#!/usr/bin/env python3 """Test the hashutils module.""" import hashlib import os from shutil import copyfile, rmtree import pytest from bbarchivist import hashutils as bh try: import unittest.mock as mock except ImportError: import mock __author__ = "Thurask" __license__ = "WTFPL v2" __copyright__ = "2015-2...
2.453125
2
scripts/random_plots.py
JLans/jl_spectra_2_structure
0
12782385
<filename>scripts/random_plots.py # -*- coding: utf-8 -*- """ Created on Tue Dec 17 19:33:16 2019 @author: lansf """ from __future__ import division import os import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from jl_spectra_2_structure import IR_GEN from jl_spectra_2_structure.plotting_tools impo...
1.960938
2
src/dictionary.py
rzjfr/sayit
0
12782386
import os import requests from bs4 import BeautifulSoup from fake_useragent import UserAgent class Dictionary: """audio related parts""" def __init__(self, word, files_path='~/.sayit'): self.word = word self.user_agent = UserAgent().random # Random user_agent for http calls self.file...
2.90625
3
hackerrank/The Minion Game.py
safakhan413/leetcode
0
12782387
<reponame>safakhan413/leetcode<filename>hackerrank/The Minion Game.py from itertools import permutations from collections import Counter def minion_game(string): # finding all substrings of s # vowels= ['A', 'E', 'I', 'O', 'U'] # substrings = [] # for i in range(len(string)): # for j in range(i+...
3.8125
4
dask/context.py
epervago/dask
2
12782388
""" Control global computation context """ from __future__ import absolute_import, division, print_function from collections import defaultdict _globals = defaultdict(lambda: None) _globals['callbacks'] = set() class set_options(object): """ Set global state within controled context This lets you specify v...
2.4375
2
open3dlab/open3dlab-scraper.py
piyushd26/scrapers
1
12782389
<gh_stars>1-10 from bs4 import BeautifulSoup as soup import requests import os import re import argparse from multiprocessing.pool import ThreadPool from tqdm.auto import tqdm from database import Project, User, Download, Database import sys BASE_DIR = os.path.dirname(os.path.realpath(__file__)) BASE_URL = "https://s...
2.625
3
tests/test_sedas_api.py
oskarfkrauss/sedas_pyapi
3
12782390
""" Copyright 2019 Satellite Applications Catapult 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.265625
2
Exercicios/ex081.py
mauroalbuquerque/Python-CursoEmVideo
0
12782391
<reponame>mauroalbuquerque/Python-CursoEmVideo<filename>Exercicios/ex081.py<gh_stars>0 num = list() while True: while True: valor = input('Digite um valor: ') if valor.isnumeric(): valor = int(valor) break else: print('Valor Incorreto. Por favor, tente n...
3.609375
4
balancesheet/mongoData/equities.py
tylertjburns/ledgerkeeper
0
12782392
<filename>balancesheet/mongoData/equities.py import mongoengine from balancesheet.mongoData.valueSnapshot import ValueSnapshot class Equity(mongoengine.Document): # Top Level Elements name = mongoengine.StringField(required=True) description = mongoengine.StringField(required=True) account_id = mongoe...
2.109375
2
rest_framework_idempotency_key/utils.py
hardcoretech/djangorestframework-idempotency-key
5
12782393
def raise_if(expression, error): if expression: raise error
1.664063
2
teamcat_service/doraemon/business/project/project_service.py
zhangyin2088/Teamcat
6
12782394
#coding=utf-8 ''' Created on 2015-10-23 @author: Devuser ''' from doraemon.project.models import Project,ProjectMember,Product,ProjectModule,Version from gatesidelib.common.simplelogger import SimpleLogger from django.contrib.admin.models import DELETION,CHANGE,ADDITION from business.project.version_service import Ver...
2.09375
2
render.py
tranquada/ga-capstone
4
12782395
from jinja2 import Environment, PackageLoader, select_autoescape from IPython.display import HTML # MODULE INTRODUCTION """This module contains dislay functions to render the different data layers using Jinja2 templates and IPython rendering methods for Jupyter Notebook.""" # GLOBAL VARIABLE DECLARATIONS ENV = Enviro...
3.3125
3
mailslurp_client/models/webhook_projection.py
mailslurp/mailslurp-client-python
6
12782396
<reponame>mailslurp/mailslurp-client-python<gh_stars>1-10 # coding: utf-8 """ MailSlurp API MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, att...
2.28125
2
modules/server/physim.py
bullseyestudio/guns-game
0
12782397
<gh_stars>0 """ Physics simulation module for Guns!, the tank game. Even more docstringy stuff goes here. Todo: I have no idea what physics sim functions we need yet, but we should have the module. Todo: This will probably end up breaking into bits. """ pass
1.46875
1
winners/nontargeted-attack/teaflow/cleverhans/attacks.py
geekpwn/caad2018
50
12782398
from abc import ABCMeta import numpy as np from six.moves import xrange import warnings import collections import cleverhans.utils as utils from cleverhans.model import Model, CallableModelWrapper class Attack(object): """ Abstract base class for all attack classes. """ __metaclass__ = ABCMeta ...
2.734375
3
medicare_appeals/tests/appeals_tests.py
18F/medicare-appeals-prototyping
1
12782399
import pytest from medicare_appeals.appeals import models from medicare_appeals.tests import factories @pytest.fixture(scope='function') def build_an_appeal(): """ Build a single appeal """ appeal = factories.AppealFactory() @pytest.fixture(scope='function') def build_two_appeals(): """ Buil...
2.40625
2
nbaspa/data/tasks/io.py
ak-gupta/nbaspa
1
12782400
<gh_stars>1-10 """Simple tasks for loading data from the ``BaseRequest`` API.""" from datetime import datetime, timedelta from pathlib import Path from typing import Dict, List, Optional, Set, Tuple, Union import fsspec import numpy as np import pandas as pd from prefect import Task from ..factory import NBADataFact...
2.828125
3
kamrecsys/utils/kammath.py
tkamishima/kamrecsys
7
12782401
<filename>kamrecsys/utils/kammath.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Summary of Mathematical Functions """ from __future__ import ( print_function, division, absolute_import, unicode_literals) from six.moves import xrange # ==============================================...
2.234375
2
theanompi/easgd_server.py
uoguelph-mlrg/Theano-MPI
65
12782402
from __future__ import absolute_import from theanompi.lib.base import MPI_GPU_Process from mpi4py import MPI server_alpha = 0.5 class EASGD_Server(MPI_GPU_Process): ''' An implementation of the server process in the Elastic Averaging SGD rule https://arxiv.org/abs/1412.6651 implementation ...
2.25
2
ponnobot/management/commands/daraz_crawl.py
ahmedshahriar/bd-ponno
3
12782403
<reponame>ahmedshahriar/bd-ponno from django.core.management.base import BaseCommand from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from ponnobot.spiders.daraz_spider import DarazSpider class Command(BaseCommand): help = "Release the Mke Crawler" def handle(s...
1.8125
2
tests/test_plugin.py
fopina/tgbotplug
1
12782404
from tgbot import plugintest from sample_plugin import TestPlugin class TestPluginTest(plugintest.PluginTestCase): def setUp(self): self.plugin = TestPlugin() self.bot = self.fake_bot( '', plugins=[self.plugin], ) def test_print_commands(self): from cSt...
2.4375
2
lib/encoder_configuration_unittest.py
Jesseyx/compare-codecs
50
12782405
<reponame>Jesseyx/compare-codecs #!/usr/bin/python # Copyright 2015 Google. # # 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 requir...
2.359375
2
src/mainControllerClass.py
SeferMirza/CommandWithEyesOpenCV
0
12782406
import cv2 import numpy as np import sys, getopt import time import dlib import math i=False class Controller(): def __init__(self): self.detector = dlib.get_frontal_face_detector() self.predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") self.frame = None self....
2.578125
3
spatiam_persist.py
Spatiam/Spatiam_ION_DMI
0
12782407
<gh_stars>0 import sys import time import requests import subprocess from subprocess import PIPE import datetime MGR_API_URL = "https://www.spatiam.com/ion-dtn-mgr/api/" CONFIG_FILENAME = "spatiam_config.txt" AUTH_TOKEN = sys.argv[1] NETWORK_ID = sys.argv[4] NODE_UUID = sys.argv[5] NODE_LISTENING_IP = sys.argv[6] no...
2.625
3
textstat_core/sentence.py
textstat/textstat-core
1
12782408
<filename>textstat_core/sentence.py<gh_stars>1-10 from .word_collection import WordCollection class Sentence(WordCollection): @property def length(self): return len(self.words)
2.453125
2
src/diem/testnet.py
Embodimentgeniuslm3/client-sdk-python
32
12782409
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 """Provides utilities for working with Diem Testnet. ```python from diem import testnet from diem.testing import LocalAccount # create client connects to testnet client = testnet.create_client() # create faucet for minting coins for y...
2.390625
2
lambda/src/compiler/pkg/state_machine_resources.py
jack-e-tabaska/BayerCLAW
0
12782410
<filename>lambda/src/compiler/pkg/state_machine_resources.py from collections import deque import json import logging from typing import Generator, List, Dict, Tuple from uuid import uuid4 import boto3 from . import batch_resources as b from . import chooser_resources as c from . import enhanced_parallel_resources as...
1.859375
2
tests/conftest.py
sameraslan/rymscraper
41
12782411
<reponame>sameraslan/rymscraper from rymscraper import RymNetwork import pytest # @pytest.fixture @pytest.fixture(scope="session", autouse=True) def network(): network = RymNetwork(headless=True) yield network network.browser.close() network.browser.quit()
1.851563
2
test/transfer_action_test.py
mvdbeek/pulsar
0
12782412
<reponame>mvdbeek/pulsar<gh_stars>0 import os from .test_utils import files_server from pulsar.client.action_mapper import RemoteTransferAction def test_write_to_file(): with files_server() as (server, directory): from_path = os.path.join(directory, "remote_get") open(from_path, "wb").write(b"123...
2.375
2
utils/sundry_utils.py
czh513/RLs-for-TF2.0-Gym-Unity
1
12782413
<filename>utils/sundry_utils.py class LinearAnnealing: def __init__(self, x, x_, end): ''' Params: x: start value x_: end value end: annealing time ''' assert end != 0, 'the time steps for annealing must larger than 0.' self.x = x ...
2.984375
3
Post-process/correlation/correl.py
michgz/vibration-record
0
12782414
# Run with Python 2.7 ## from trace import Trace from trace import ReadIn import datetime import os import sys import zipfile import shutil import math import getopt import numpy def ODSDate(dt): return dt.strftime("<table:table-cell table:style-name=\"ce2\" office:value-type=\"date\" office:date-value=\"%Y-%m-%...
2.234375
2
tests/themes/kenney/demo_checkbox.py
Rahuum/glooey
86
12782415
<reponame>Rahuum/glooey<gh_stars>10-100 #!/usr/bin/env python3 import pyglet import glooey.themes.kenney as kenney import run_demos import itertools colors = 'blue', 'red', 'green', 'yellow', 'grey' icons = 'checkmark', 'cross' window = pyglet.window.Window() gui = kenney.Gui(window) @run_demos.on_space(gui) # def ...
2.375
2
ipscanner.py
molney239/ipscanner
1
12782416
<filename>ipscanner.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Python script and module for scanning IPv4 addresses range. Shows basic information about devices and addresses. Usage examples: From console: pip3 install -r requirements.txt python3 ipscanner.py 192.168.1.0-192.168.1.255,8....
3.171875
3
bindings/python/src/cloudsmith_api/apis/webhooks_api.py
cloudsmith-io/cloudsmith-api
9
12782417
# coding: utf-8 """ Cloudsmith API The API to the Cloudsmith Service OpenAPI spec version: v1 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import sys import os import re # python 2 and python 3 compatibility libra...
1.796875
2
Unit 2/Lesson 3/y=mx+b.py
KevinBoxuGao/ICS3UI
0
12782418
<reponame>KevinBoxuGao/ICS3UI m = int(input("enter slope of line: ")) b = int(input("enter the y-intercept: ")) if b == 0: bOutput="" elif b < 0: bOutput = str(b) else: bOutput="+"+str(b) if m == 0: mOutput = "" bOutput = str(b) elif m == 1: mOutput = "x" elif m == -1: ...
3.890625
4
buildhelpers.py
nCov19-DataPoints/nCov19-DataPoints
42
12782419
<gh_stars>10-100 import urllib.request import csv from io import StringIO import json import datetime import pytz from collections import namedtuple CET = pytz.timezone('CET') Color = namedtuple("Color",['r','g','b','a']) colortable = [ {"t":0, "c":{"r":0,"g":255,"b":0,"a":0.1} }, {"t":0.1, "c":{"r":128,"g"...
2.578125
3
HW/HW7/CW7.2.py
kolyasalubov/Lv-639.pythonCore
0
12782420
<reponame>kolyasalubov/Lv-639.pythonCore<gh_stars>0 def reverse_list(l): return [list for list in reversed (l)] #'return a list with the reverse order of l'
3.109375
3
implementation/server/factories/books_author.py
Aincient/cleo
0
12782421
""" Books Author model factory. """ import random from factory import DjangoModelFactory, LazyAttribute from books.models import Author from .factory_faker import Faker __all__ = ( 'AuthorFactory', 'LimitedAuthorFactory', 'SingleAuthorFactory', ) class BaseAuthorFactory(DjangoModelFactory): """Ba...
2.859375
3
test_shorturl.py
lepture/flask-shorturl
28
12782422
<reponame>lepture/flask-shorturl from nose.tools import raises from flask import Flask from flask_shorturl import ShortUrl def test_shorturl(): app = Flask(__name__) su = ShortUrl(app) for a in range(0, 200000, 37): b = su.encode(a) c = su.enbase(b) d = su.debase(c) e = su...
2.625
3
ExpenseTracker/expense/urls.py
lennyAiko/LifeExpenses
0
12782423
<filename>ExpenseTracker/expense/urls.py from django.contrib import admin from django.urls import path, include from .views import home, ExpenseList, createExpense, deleteExpense, setBudget urlpatterns = [ path("home/", home, name="home"), path("expenses/", ExpenseList, name="expense"), path("create_expens...
1.625
2
shhelper/paths.py
PowerSnail/PythonShellHelper
0
12782424
import typing as T from pathlib import Path import re class Globals: cwd = Path(".").absolute() def cd(p: str): Globals.cwd.joinpath(p).absolute() def pwd() -> Path: return Globals.cwd def ls(p: str = ".") -> T.List[Path]: path = Globals.cwd.joinpath(p) return [p for p in path.iterdir()] def ba...
2.890625
3
OLD/Location.py
bhuvan21/TBGC
0
12782425
from input_functions import safe_input, numbered_choice from display_funcs import decorate class Location(): def __init__(self, name, short_desc, long_desc, contains=[], level=0, starting_location=False, input_func=safe_input, output_func=print): self.name = name self.short_desc = short_desc ...
3.65625
4
app/app/api/category_routes.py
Web-Dev-Collaborative/Anvil_2.0
12
12782426
from flask import Blueprint from flask_login import current_user from app.models import Category category_routes= Blueprint('category', __name__) @category_routes.route("") def get_categories(): user_categories = Category.query.filter_by(user_id=current_user.id) default_categories = Category.query.filter_by(...
2.515625
3
mobyle/web/security.py
mobyle2/mobyle2.web
0
12782427
import time from mobyle.common.connection import connection from mobyle.common import users def groupFinder(userid, request): #try to find user in database: user = connection.User.find_one({"email": userid}) if user is not None: groups = user['groups'] if user['admin']: grou...
2.65625
3
scripts/extract-changeid-map.py
thewtex/gerrit-static-archive
1
12782428
import sys import os import json import json_lines output_file = 'output.jl' if not os.path.exists(output_file): print('Did not find expected output file!') sys.exit(1) change_id_to_change_number = {} with open(output_file, 'rb') as fp: for item in json_lines.reader(fp): if 'ChangeIdToChangeNumbe...
2.640625
3
efls-console/console/argo_template/test_template.py
universe-hcy/Elastic-Federated-Learning-Solution
65
12782429
# -*- coding: utf8 -*- import kfp def flip_coin(): return kfp.dsl.ContainerOp( name='Flip a coin', image='python:alpine3.6', command=['python', '-c', """ import random res = "heads" if random.randint(0, 1) == 0 else "tails" with open('/output', 'w') as f: f.write(res) """], ...
2.5625
3
cdc_config.py
dlf412/mysql-cdc-redis
4
12782430
#!/usr/bin/env python # encoding: utf-8 # redis for saving binlog file and position # please reverse the db + 1 for saving mysql changed data redis_url = "redis://127.0.0.1/0" cache_url = "redis://127.0.0.1/1" # mysql server id server_id = 1 # mysql connection setting mysql_settings = {'host': '192.168.1.34', ...
1.929688
2
Finance/Python/finance/lib/python2.7/site-packages/pandas_datareader/google/quotes.py
pallavbakshi/datascience
1
12782431
import pandas as pd from dateutil.parser import parse import numpy as np from pandas_datareader.base import _BaseReader import json import re class GoogleQuotesReader(_BaseReader): """Get current google quote""" @property def url(self): return 'http://www.google.com/finance/info' @property...
2.921875
3
paper/make_language_fig.py
csdms/bmi_wrap
0
12782432
import matplotlib.pyplot as plt import pandas as pd def main(): if 0: data = pd.read_html("https://csdms.colorado.edu/wiki/CSDMS_models_by_numbers")[ 2 ] languages = pd.DataFrame( {"Count": data["Count"].values}, index=data["Program language"] ) lan...
3.375
3
copyfile.py
UncleEngineer/pythonbackupfile
1
12782433
import os import shutil path = r'C:\Users\<NAME>\Desktop\Work' destination = 'F:\\HERE' allfile = os.listdir(path) for f in allfile: if f[-3:] == 'txt': #print(f) source = os.path.join(path,f) dest = os.path.join(destination,f) print(source) print(dest) ...
3.09375
3
genesis_blockchain_tools/crypto/backend/rubenesque.py
potehinre/genesis-blockchain-tools
0
12782434
from rubenesque.codecs.sec import encode, decode from rubenesque.signatures import ecdsa import rubenesque.curves from hashlib import sha256 from ..formatters import encode_sig, decode_sig from ...convert import int_to_hex_str from .common import point_to_hex_str, split_str_to_halves from .errors import ( UnknownP...
2.59375
3
tests/event/beforeafter/modules/directcalls/__init__.py
da-h/miniflask
5
12782435
<gh_stars>1-10 # note that this function does not ask for any miniflask variables (state/event/mf) def dosomething(): print("event called") def before_dosomething(): print("before_-event called") def after_dosomething(): print("after_-event called") def main(event): event.dosomething() def regi...
2.40625
2
app/wakkerdam/__init__.py
mofferthond/flask-base
0
12782436
from app.wakkerdam.views import wakkerdam
1.101563
1
user/utils.py
superior-prog/JobLand
1
12782437
from datetime import date from io import BytesIO from django.core.mail import send_mail from django.http import HttpResponse from django.template import loader from django.template.loader import get_template from xhtml2pdf import pisa from .models import * def match_skill(job_list, skill_list, preferred_job_list): ...
2.28125
2
sc_sample_writer.py
MasterScott/scamper
23
12782438
#!/usr/bin/env python # Program: $Id: $ # Author: <NAME> <<EMAIL>> # Description: Example use of sc_warts_writer library. # import sys import time from sc_warts_writer import WartsWriter, WartsTrace if __name__ == "__main__": assert len(sys.argv) == 2 now = time.time() w = WartsWriter(sys.argv[...
2.25
2
test/test_app/models.py
revpoint/prefs-n-perms
3
12782439
<reponame>revpoint/prefs-n-perms<filename>test/test_app/models.py from django.db import models class Site(models.Model): def __unicode__(self): return u'Site {0}'.format(self.id) class Customer(models.Model): site = models.ForeignKey('Site', related_name='customers') def __unicode__(self): ...
2.234375
2
portfolio_api/serializers/project.py
tjeerddie/portfolio-backend
0
12782440
from portfolio_admin.models import Project from rest_framework import serializers class ProjectSerializer(serializers.ModelSerializer): skills = serializers.StringRelatedField(many=True) class Meta: model = Project exclude = ['id', 'created_at', 'updated_at', 'portfolio', 'private']
1.789063
2
cmsplugin_embed/migrations/0001_initial.py
glomium/cmstemplate
0
12782441
<reponame>glomium/cmstemplate # -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-23 16:14 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('cms', '00...
1.4375
1
tests/r/test_friendship.py
hajime9652/observations
199
12782442
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.friendship import friendship def test_friendship(): """Test module friendship.py by downloading friendship.csv and testing shape of extrac...
2.53125
3
setup.py
xdssio/zappa_client
1
12782443
<reponame>xdssio/zappa_client from setuptools import setup setup(name='zappa_client', description='A tool to call Zappa serverless function directly without AWS APIGateway', long_description="Zappa is a tool wrap the deployment of serverless applications to AWS Lambda, " "you can inv...
1.476563
1
main_cpu.py
vietbt/ViTextnormASR
0
12782444
<reponame>vietbt/ViTextnormASR from utils.data import Data from network.trainer import train if __name__=="__main__": config = "configs/config.norm.cpu.json" mbert = "configs/config.mbert.json" vibert = "configs/config.vibert.json" velectra = "configs/config.velectra.json" # for fold_id i...
2.234375
2
cerebstats/stat_scores/chi2GOFScore.py
HarshKhilawala/cerebstats
0
12782445
# ============================================================================ # ~/cerebstats/cerebstats/stat_scores/chi2GOFScore.py # # This py-file contains custum score functions initiated by # # from cerebstats import scoreScores # from cerebstats.scoreScores import ABCScore # ======================================...
2.28125
2
admin/management/commands/migrate.py
adelsonllima/djangoplus
21
12782446
<reponame>adelsonllima/djangoplus # -*- coding: utf-8 -*- from django.core.management.commands import migrate from djangoplus.admin.management import sync_permissions class Command(migrate.Command): def add_arguments(self, parser): super(Command, self).add_arguments(parser) parser.add_argument('...
1.929688
2
w2b/fft.py
adamd1008/wav2bmp
1
12782447
<filename>w2b/fft.py<gh_stars>1-10 # MIT License # # Copyright (c) 2020 <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 rights #...
1.882813
2
ege_date.py
rlowrance/re-local-linear
0
12782448
<reponame>rlowrance/re-local-linear '''create files contains estimated generalization errors for model sys.argv: year month day The sale_date of the models. Uses data up to the day before the sale date Files created: year-month-day-MODEL-SCOPE-T[-MODELPARAMS].foldResult where: MODEL is one of the models {...
2.15625
2
plugins/share_post/__init__.py
mohnjahoney/website_source
13
12782449
from .share_post import * # noqa
1.046875
1
generators/generate_interactions_personalize_offers.py
ajayfenix/retail-demo-store
0
12782450
""" A simple script for generating sample data for learning to give personalised offers. """ import json import pandas as pd import numpy as np import gzip import random import logging GENERATE_INBALANCED_DATA = False NUM_INTERACTIONS_PER_USER = 3 FIRST_TIMESTAMP = 1591803782 # 2020-06-10, 18:43:02 LAST_TIMESTAMP = ...
3.21875
3