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
tests/setup.py
rdmolony/berpublicsearch
0
12794251
import os try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="geopandas", version=versioneer.get_version(), description="Geographic pandas extensions", license="BSD", author="GeoPandas contributors", author_email="<EMAIL>", url="h...
1.398438
1
Misc/Join Function.py
Jigyanshu17/Python-Ka-Saara-Gyaan
0
12794252
<filename>Misc/Join Function.py # list = ["John","Cena","Randy","Orton","Sheamus","Khali","<NAME>"] # # for item in list: # # print(item,"and",end=" ") # # # a = " , ".join(list) # print(a , " other are wwe superstars") a = 123 def fun(): a = [] print(type(a))
3.53125
4
linuxmachinebeta/view/api/serializers.py
linux-machine/linuxmachinebeta
0
12794253
<filename>linuxmachinebeta/view/api/serializers.py from django.utils.translation import gettext_lazy as _ from rest_framework import serializers from linuxmachinebeta.view.models import ServiceView from linuxmachinebeta.services.models import Service class ServiceViewSerializer(serializers.ModelSerializer): ser...
2.328125
2
server/app/api/xss.py
vncloudsco/XSS-Catcher
1
12794254
<gh_stars>1-10 from flask import jsonify, request from app import db from app.models import Client, XSS from app.api import bp from flask_login import login_required, current_user from app.decorators import permissions import json @bp.route('/xss/generate/<id>', methods=['GET']) @login_required def xss_generate(id):...
2.78125
3
tests/test_ccppasswordrestsecure.py
dvdangelo33/pyaim
0
12794255
#!/usr/bin/env python3 from pyaim import CCPPasswordRESTSecure aimccp = CCPPasswordRESTSecure('https://cyberark.dvdangelo33.dev/', "clientcert.pem", verify=True) r = aimccp.GetPassword(appid='pyAIM',safe='D-AWS-AccessKeys',username='AnsibleAWSUser') print(r)
1.765625
2
clonigram/posts/apps.py
EdinsonRequena/platzi-django-course
1
12794256
''' Post application module. ''' from django.apps import AppConfig class PostsConfig(AppConfig): ''' :type name: str :type verbose_name: str ''' name = 'posts' verbose_name = 'Posts'
1.710938
2
tests/opening_test.py
karlch/vimiv
268
12794257
<reponame>karlch/vimiv # vim: ft=python fileencoding=utf-8 sw=4 et sts=4 """Test the opening of different file-types with vimiv.""" import os from unittest import main from vimiv_testcase import VimivTestCase class OpeningTest(VimivTestCase): """Open with different file-types Test.""" @classmethod def ...
2.546875
3
flexget/plugins/operate/disable_builtins.py
Crupuk/Flexget
0
12794258
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.plugin import priority, register_plugin, plugins log = logging.getLogger('builtins') def all_builtins(): """Helper function to return an iterator over all builtin plugins.""" return (plug...
2.15625
2
warehouse/legacy/pypi.py
hickford/warehouse
1
12794259
<filename>warehouse/legacy/pypi.py # Copyright 2013 <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 required by applicable law...
2.21875
2
CCF/CSP/2013/13123.py
cnsteven/online-judge
1
12794260
<reponame>cnsteven/online-judge n = int(input()) h = list(map(int, input().split())) ans = 0 for i in range(n): min_height = h[i] for j in range(i, n): min_height = min(min_height, h[j]) ans = max(ans, (j - i + 1) * min_height) print(ans)
3.015625
3
2018/07/debug_me/1_2.py
lfrommelt/monty
0
12794261
# drink price list prices = {coke: 2, beer: 2.5, water: 0, juice: 2} print(price('beer'))
2.828125
3
tests/test_helpers.py
nvn-nil/bigo_test
0
12794262
<reponame>nvn-nil/bigo_test # -*- coding: utf-8 -*- import unittest from time import sleep import numpy as np from bigo_test.assertions.helpers import execution_timer def test_func_factory(n): def func(a): # pylint: disable=unused-argument sleep(n) return func class TestHelpers(unittest.Te...
2.40625
2
colorcode/convert.py
nonylene/lostfound
0
12794263
<gh_stars>0 from config import COLORS def to_color(code, color): r,g,b = (int(code[i*2+1:i*2+3],16) for i in range(3)) return (color, {'r': r, 'g': g, 'b': b}) d = dict(to_color(code,color) for code, color in COLORS) import json print(json.dumps(d,ensure_ascii=False))
3.203125
3
spotify_wordcloud/config.py
HelloRusk/spotify-wordcloud
9
12794264
from dotenv import load_dotenv from os import environ, path from pathlib import Path load_dotenv(verbose=True) parent_path = Path(__file__).parent dotenv_path = path.join(parent_path, ".env") load_dotenv(dotenv_path) CSRF_COOKIE_SECURE = True CSRF_COOKIE_HTTPONLY = True SECRET_KEY = environ.get("SECRET_KEY") SPOT...
2.046875
2
config.py
Anonymous78/Registration-System
0
12794265
<reponame>Anonymous78/Registration-System<filename>config.py # config.py """ Module containing the configurations for different environments """ class Config(object): """Common configurations""" # Put any configurations common across all environments SESSION_COOKIE_NAME = "session" TESTING...
2.5
2
stations/tests/test_validation.py
sharksmhi/stations
0
12794266
<gh_stars>0 # Copyright (c) 2020 SMHI, Swedish Meteorological and Hydrological Institute # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). """ Created on 2020-10-01 16:37 @author: a002028 """ from stations.main import App if __name__ == '__main__': app = App() app.read_list( ...
1.882813
2
SIS/forms.py
toHarsh/Management-System
2
12794267
from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, PasswordField from wtforms.validators import Email,DataRequired,Length, ValidationError from SIS.models import Info import email_validator class sisForm(FlaskForm): rollNo = StringField('Roll No', validators=[Data...
2.78125
3
SVM/Cancer_prediction.py
AlexKH22/Machine_Learning
0
12794268
<filename>SVM/Cancer_prediction.py import numpy as np from sklearn import cross_validation, svm import pandas as pd df = pd.read_csv('breast-cancer-wisconsin.data.txt') df.replace('?',-99999, inplace=True) df.drop(['id'], 1, inplace=True) X = np.array(df.drop(['class'], 1)) y = np.array(df['class']) X_train, X_test,...
3.078125
3
tests/viewmixins/forms.py
samuelmaudo/yepes
0
12794269
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django import forms class JsonMixinForm(forms.Form): boolean = forms.BooleanField() char = forms.CharField( min_length=3, max_length=6) integer = forms.IntegerField( min_value=3, max_valu...
2.109375
2
contrail_api_cli/commands/rm.py
mrasskazov/contrail-api-cli
0
12794270
<reponame>mrasskazov/contrail-api-cli<gh_stars>0 # -*- coding: utf-8 -*- import itertools from ..command import Command, Arg, Option, experimental, expand_paths from ..resource import Resource from ..utils import continue_prompt @experimental class Rm(Command): """Delete a resource from the API. .. warnin...
2.390625
2
r_pass/urls.py
abztrakt/r-pass
0
12794271
from django.conf.urls import patterns, include, url urlpatterns = patterns('', # Examples: url(r'^service/.*/(?P<service_id>[0-9]+)/edit/?$', 'r_pass.views.edit'), url(r'^service/.*/(?P<service_id>[0-9]+)/?$', 'r_pass.views.service'), url(r'^create/?$', 'r_pass.views.create'), url(r'', 'r_pass.view...
1.898438
2
stack-trace-solver-be/src/exception_extractor.py
TeamInterject/stack-trace-solver
0
12794272
from regex_matchers import retrieve_exceptions from utils import chunks import threading import glob from pathlib import Path import os def extract_exceptions(files): for path in files: fileName = Path(path).stem outputFile = f"ignored_data/exceptions/{fileName}.txt" if os.path.isfile(outpu...
2.796875
3
PreFRBLE/PreFRBLE/convenience.py
FRBs/PreFRBLE
5
12794273
from __future__ import print_function import sys, h5py as h5, numpy as np, yt, csv from time import time, sleep from PreFRBLE.file_system import * from PreFRBLE.parameter import * from time import time def TimeElapsed( func, *args, **kwargs ): """ measure time taken to compute function """ def MeasureTime(): ...
2.53125
3
tests/test_well_mapper.py
GallowayLabMIT/rushd
0
12794274
<reponame>GallowayLabMIT/rushd import pytest from rushd.well_mapper import well_mapping def test_default_separator(): """ Tests that the default separator is a period, and that conditions are properly merged together. """ result = well_mapping([{'foo': 'A1'}, {'bar': 'A1'}]) print(result) ...
2.859375
3
bigdata_study/pyflink1.x/batch/demo01.py
kingreatwill/penter
13
12794275
import logging import os import shutil import sys import tempfile from pyflink.dataset import ExecutionEnvironment from pyflink.table import BatchTableEnvironment, TableConfig, DataTypes from pyflink.table import expressions as expr from pyflink.table.descriptors import OldCsv, FileSystem, Schema from pyflink.table.ex...
2.140625
2
agent0/nips_encoder/run.py
zhoubin-me/agent0
0
12794276
import git import ray from ray import tune from ray.tune import CLIReporter from agent0.common.utils import parse_arguments from agent0.nips_encoder.trainer import Trainer, Config if __name__ == '__main__': repo = git.Repo(search_parent_directories=True) sha = repo.git.rev_parse(repo.head.object.hexsha, short...
1.882813
2
src/dagos/core/environments/environment_domain.py
DAG-OS/dagos
0
12794277
from __future__ import annotations import typing as t from dataclasses import dataclass from pathlib import Path from loguru import logger from rich.console import Console from rich.console import ConsoleOptions from rich.console import Group from rich.console import group from rich.console import RenderResult from r...
2.21875
2
Attendance/views.py
MadhuraShanbhag/DRF-Attendance-Web
0
12794278
<gh_stars>0 from django.shortcuts import render, redirect from django.urls import reverse_lazy from . import forms from django.views.generic import TemplateView from django.contrib.auth import logout, authenticate, login from django.contrib.auth.decorators import login_required from rest_framework import generics from...
2.078125
2
Chapter05/myunittest/tests/tests_mycalc/test_mycalc_add.py
MichaelRW/Python-for-Geeks
31
12794279
<filename>Chapter05/myunittest/tests/tests_mycalc/test_mycalc_add.py # test_mycalc_add.py test suite for add class method import unittest from myunittest.src.mycalc.mycalc import MyCalc class MyCalcAddTestSuite(unittest.TestCase): def setUp(self): self.calc = MyCalc() def test_add(self): """ ...
3.203125
3
src/utils/sunrgbd.py
acaglayan/CNN_randRNN
8
12794280
<filename>src/utils/sunrgbd.py<gh_stars>1-10 import os import numpy as np from basic_utils import DataTypesSUNRGBD class_id_to_name = { "0": "bathroom", "1": "bedroom", "2": "classroom", "3": "computer_room", "4": "conference_room", "5": "corridor", "6": "dining_area", "7": "dining_ro...
2.6875
3
custom_components/luxtronik/binary_sensor.py
BenPru/luxtronik
2
12794281
<reponame>BenPru/luxtronik<gh_stars>1-10 """Support for Luxtronik heatpump binary states.""" # region Imports import logging from typing import Any, Final import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant.components.binary_sensor import (DEVICE_CLASS_LOCK, ...
1.679688
2
iNaturalist_stats.py
noameshed/novelty-detection
29
12794282
<filename>iNaturalist_stats.py<gh_stars>10-100 # explore data statistics import numpy as np import os import seaborn as sns import matplotlib.pyplot as plt f = 'D:/noam_/Cornell/CS7999/iNaturalist/train_val_images/' grp_names = [] grp_count = [] grp_min = np.inf min_folder = '' grp_max = 0 max_folder = '' avg_folder ...
3.015625
3
metREx/app/main/util/prometheus_helper.py
vijayragava/metREx
8
12794283
<filename>metREx/app/main/util/prometheus_helper.py<gh_stars>1-10 import os import re from prometheus_client.core import CollectorRegistry from prometheus_client.multiprocess import MultiProcessCollector collector_registries = {} prometheus_multiproc_dir = os.getenv('prometheus_multiproc_dir') def get_pushgateways...
2.1875
2
devpay/__init__.py
DevpayInc/devpay-python-sdk
0
12794284
<reponame>DevpayInc/devpay-python-sdk<filename>devpay/__init__.py<gh_stars>0 # Version of devpay package __version__ = "1.0.0"
1.046875
1
xpmig_precheck.py
kschets/XP_migrator
1
12794285
<reponame>kschets/XP_migrator<gh_stars>1-10 #!/usr/bin/python """ #################################################################################################### TITLE : HPE XP7 Migration, Precheck DESCRIPTION : Precheck to examine hostgroup is ready for migration AUTHOR : <NAME> / StorageTeam VERSION : B...
1.78125
2
src/solutions/common/job/module_statistics.py
goubertbrent/oca-backend
0
12794286
<filename>src/solutions/common/job/module_statistics.py # -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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.apa...
1.6875
2
commands.py
devaos/sublime-remote
2
12794287
<reponame>devaos/sublime-remote<gh_stars>1-10 # -*- coding: utf-8 -*- # # Copyright (c) 2014 <NAME> # http://github.com/devaos/sublime-remote/blob/master/LICENSE """This module implements the Sublime Text 3 commands provided by remote.""" import os import re import sys import sublime import sublime_plugin import subp...
1.828125
2
insert_data.py
FourierYe/calculatepossibility
0
12794288
<filename>insert_data.py import main import traceback import pymysql if __name__ == "__main__": # # ngram_1 # try: # db = pymysql.connect(host='127.0.0.1', # port=3306, # user='root', # password='<PASSWORD>', # ...
2.625
3
2014-2015/1-dec2014/p1/Marathon.py
esqu1/USACO
0
12794289
########## # USACO CONTEST 1 PROBLEM 1 # SOLUTION BY <NAME> # PYTHON 2.7.6 ########## import sys # Reads in the file marathon.in. def readin(): f = open("marathon.in",'r') s = f.read().split("\n") f.close() return s # Checks the supposedly "Manhattan" distance of the list. def checkSum(L): sum = 0...
3.765625
4
docs/examples/robot_motion_1.py
codecademy-engineering/gpiozero
743
12794290
from gpiozero import Robot, Motor, MotionSensor from signal import pause robot = Robot(left=Motor(4, 14), right=Motor(17, 18)) pir = MotionSensor(5) pir.when_motion = robot.forward pir.when_no_motion = robot.stop pause()
2.703125
3
eden/sequence_motif_decomposer.py
zaidurrehman/EDeN
0
12794291
#!/usr/bin/env python """SequenceMotifDecomposer is a motif finder algorithm. @author: <NAME> @email: <EMAIL> """ import logging import multiprocessing as mp import os from collections import defaultdict from eden import apply_async import numpy as np from scipy.sparse import vstack from eden.util.iterated_maximum_s...
2.109375
2
tests/test_remote_pdb.py
MatthewWilkes/python-remote-pdb
0
12794292
from __future__ import print_function import logging import os import re import socket import sys import time from process_tests import TestProcess from process_tests import TestSocket from process_tests import dump_on_error from process_tests import wait_for_strings from remote_pdb import set_trace TIMEOUT = int(o...
2.21875
2
src/web_api/routers/__init__.py
poyang31/hw_2021_12
3
12794293
<gh_stars>1-10 from ...kernel import Config, Database config = Config() database = Database(config) articles_collection = database.get_collection("articles") results_collection = database.get_collection("results")
1.523438
2
test/gends.py
jlinoff/cmpds
0
12794294
<reponame>jlinoff/cmpds<gh_stars>0 #!/usr/bin/env python ''' Generate random floating point numbers in a range for testing. It is used to create datasets to test cmpds. You can decorate the datasets with a header and record counts to make them easier to read. That works because cmpds allows you to specify which colum...
3.734375
4
prep_and_learning/python/arrays/arrayops.py
adityaka/misc_scripts
1
12794295
from typing import List class ArrayOps(object): def __init__(self, input_array:List[int] ): self._input = input_array def _validate_index(self, index): assert (index > len(self._input), "Index can't be greater than length") def remove_at(self, index): self._validate_index(index) ...
3.671875
4
pastebin.py
Optixal/pastebin-wrapper
1
12794296
#!/usr/bin/python3 # Light Pastebin Wrapper # By Optixal # Pastebin Documentation: https://pastebin.com/api import requests, os # Precedence of Confidential Information: # Environment Variable > Function Argument > Constant Defined Here # Recommended: Set confidential information as environment variables with "expo...
2.21875
2
ospurge/tests/client_fixtures.py
esracelik/ospurge
0
12794297
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright © 2014 Cloudwatt # # 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...
1.210938
1
model.py
av192/Flower-Classifier
0
12794298
import yaml import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import os import torch import torchvision import matplotlib.pyplot as plt import seaborn as sns import torch.nn as nn from torch.utils.data import Dataset, DataLoader import torchvision.tr...
2.421875
2
Arbitrage_Spot/dquant/config.py
ronaldzgithub/CryptoArbitrage
1
12794299
<filename>Arbitrage_Spot/dquant/config.py import collections import logging from configparser import ConfigParser from pprint import pprint import os from dquant.constants import Constants from dquant.util import Util # logging.basicConfig(level=logging.INFO) # print(__name__) logger = logging.getLogger(__name__) s...
2.15625
2
examples/cli.py
darosior/pylibbitcoin
3
12794300
import asyncio import sys import binascii import bitcoin.core import pylibbitcoin.client def block_header(client): index = sys.argv[2] return client.block_header(int(index)) def last_height(client): return client.last_height() def block_height(client): hash = sys.argv[2] return client.block_he...
2.34375
2
yle_reader_to_dataframe.py
kamalmemon/yle-news-reader
0
12794301
<reponame>kamalmemon/yle-news-reader<filename>yle_reader_to_dataframe.py import zipfile import argparse import sys import json import re import os from markdown import markdown from bs4 import BeautifulSoup import ftfy import pandas as pd def fix_encoding(text): # MOT: <NAME>ik&auml;\r\ntoimittaja <NAME>en\r\nens...
2.890625
3
pyrosetta_documentarian/attributes.py
matteoferla/Pyrosetta-documentarian
1
12794302
import pyrosetta import pandas as pd from typing import Tuple, List, Dict, Set, Any, Optional, Sequence from .base import BaseDocumentarian class AttributeDocumentarian(BaseDocumentarian): """ Analyses a Pyrosetta object and determines what is different from default. For example. Give a working XML script...
2.984375
3
mlprimitives/candidates/timeseries_errors.py
Hector-hedb12/MLPrimitives
0
12794303
import more_itertools as mit import numpy as np # Methods to do dynamic error thresholding on timeseries data # Implementation inspired by: https://arxiv.org/pdf/1802.04431.pdf def get_forecast_errors(y_hat, y_true, window_size=5, batch_size=30,...
3.265625
3
mkt/webapps/utils.py
acidburn0zzz/zamboni
1
12794304
# -*- coding: utf-8 -*- from collections import defaultdict import commonware.log from amo.utils import find_language import mkt log = commonware.log.getLogger('z.webapps') def get_locale_properties(manifest, property, default_locale=None): locale_dict = {} for locale in manifest.get('locales', {}): ...
2.21875
2
modules/cli/getcli.py
serchaofan/oakleaf
0
12794305
<filename>modules/cli/getcli.py import argparse from modules import get, run def parser_hosts_options(parser): parser.add_argument("-g", "--group", help="Get Hosts from Group") parser.set_defaults(func=get.print_hosts) def parser_groups_options(parser): parser.add_argument("-g", "--group", help="Get Gro...
2.609375
3
run.py
sepro/Flask-Server-Panel
16
12794306
<filename>run.py<gh_stars>10-100 #!/usr/bin/env python3 from serverpanel import create_app app = create_app('config') app.run()
1.367188
1
lenet5/mnist_predict.py
fubiye/machine-learning
0
12794307
# -*- coding: utf-8 -*- """ Created on Thu Nov 7 21:27:18 2019 @author: biyef """ from PIL import Image, ImageFilter import tensorflow as tf import matplotlib.pyplot as plt import mnist_lenet5_backward import mnist_lenet5_forward import numpy as np def imageprepare(): im = Image.open('D:/workspace/machine-learn...
2.71875
3
game/server/game_controller.py
adilnumancelik/cmpe487-final_project
0
12794308
import threading import pickle import json import sys import random import uuid import time sys.path.append('..') from game import Game, GameState from utils import string_to_byte, byte_to_string class GameController(): SPECIAL_KEYWORD = b"xaxaxayarmaW" MAX_RECEIVE_TIME_DIFFERENCE = 0.010 # in seconds de...
2.640625
3
5. Word error rate.py
srijoni68566/Dataset-preparation-for-training-deep-speech2-model-and-making-speech-to-text-conversion-system
0
12794309
from jiwer import wer ground_truth = "কুমিল্লার খাদি সারা দেশে পরিচিত" hypothesis = "কুমিল্লার খাদে সারা দেশে পরিচিত" error = wer(ground_truth, hypothesis) error
1.65625
2
default_cfg_fkie/src/default_cfg_fkie/default_cfg.py
Ryangupta8/multimaster_fkie
0
12794310
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain th...
1.070313
1
examples/advanced/interpolateScalar4.py
mikami520/vedo
1
12794311
<gh_stars>1-10 """Interpolate cell values from a quad-mesh to a tri-mesh""" from vedo import Grid, show # Make up some quad mesh with associated scalars g1 = Grid(res=(25,25)).wireframe(0).lw(1) scalars = g1.points()[:,1] g1.cmap("viridis", scalars, vmin=-1, vmax=1, name='gene') g1.mapPointsToCells() # move the array ...
2.46875
2
master.py
MobileRoboticsSkoltech/bandeja-wrapper
0
12794312
<reponame>MobileRoboticsSkoltech/bandeja-wrapper import time from src.RemoteControl import RemoteControl from concurrent.futures import ThreadPoolExecutor import subprocess import rospy from sensor_msgs.msg import Imu, CameraInfo, TimeReference import numpy as np import pandas as pd from io import StringIO from src.Tim...
1.84375
2
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_conn.py
alialnu/trex-core
0
12794313
from .trex_stl_types import * from .trex_stl_jsonrpc_client import JsonRpcClient, BatchMessage, ErrNo as JsonRpcErrNo from .trex_stl_async_client import CTRexAsyncClient import time import signal import os ############################ RPC layer ############################# ############################ ...
2.140625
2
src/Colors/__init__.py
tuantvk/pystrap
2
12794314
<gh_stars>1-10 # default color primary = '#007bff' secondary = '#6c757d' success = '#28a745' danger = '#dc3545' warning = '#ffc107' info = '#17a2b8' light = '#f8f9fa' dark = '#343a40' white = '#ffffff' black = '#212529' # active color active_primary = '#0069d9' active_secondary = '#5a6268' active_success = '#218838' a...
1.078125
1
classify.py
fedden/TensorFlowSiameseNeuralNetwork
2
12794315
import numpy as np from sklearn.neighbors import KNeighborsClassifier def classify_from_embeddings(model, train_images, train_labels, test_images, test_labels, k=5, ...
3.015625
3
Pythonsnakegame.py
MadJedi/pythonsnakegame
0
12794316
<reponame>MadJedi/pythonsnakegame<gh_stars>0 from tkinter import Tk, Canvas import random # Globals WIDTH = 800 HEIGHT = 600 SEG_SIZE = 20 IN_GAME = True # Helper functions def create_block(): """ Creates an apple to be eaten """ global BLOCK posx = SEG_SIZE * random.randint(1, (WIDTH-SEG_SIZE) / SEG_SIZ...
3.65625
4
botbot/apps/bots/admin.py
Reception123/IRCLogBot
5
12794317
<filename>botbot/apps/bots/admin.py """Django admin configuration for the bot objects. """ import redis from django import forms from django.conf import settings from django.contrib import admin from django.forms.models import BaseInlineFormSet from . import models class PluginFormset(BaseInlineFormSet): def __i...
2.078125
2
ixmp/tests/reporting/conftest.py
ShaiWinograd/ixmp
0
12794318
import pint import pytest @pytest.fixture(scope="session") def ureg(): """Application-wide units registry.""" registry = pint.get_application_registry() # Used by .compat.ixmp, .compat.pyam registry.define("USD = [USD]") registry.define("case = [case]") yield registry
1.9375
2
mmf/datasets/builders/flickr30k_retrieval/database.py
PlusLabNLP/phrase_grounding
2
12794319
# 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 jsonlines import torch import random import numpy as np import _pickle as cPickle class Flickr30kRetrievalDatabase(torch.utils.data.Da...
2.125
2
Algorithms/Divide-and-Conquer/Python/main.py
KumarjitDas/Algorithms
0
12794320
<filename>Algorithms/Divide-and-Conquer/Python/main.py from typing import List def arraysum(array: List[int]) -> int: """ Get the sum of all the elements in the array. arraysum ======== The `arraysum` function takes an array and returns the sum of all of its elements using divide and concuer method. ...
4.34375
4
detokenizefrag.py
aycock/mh
0
12794321
<reponame>aycock/mh<filename>detokenizefrag.py # Python < 3 # see LICENSE file for licensing information # Partial detokenization of LISA assembler fragments found in a binary file. import sys TOKENS = { # reversed by comparing assembly fragments to Mystery House disasm # later verified against LISA decoder at # ...
2.125
2
data-processing-scripts/reverse_saved_dict.py
alecokas/BiLatticeRNN-data-processing
5
12794322
""" Script for generating a reversed dictionary """ import argparse import numpy as np import sys def parse_arguments(args_to_parse): description = "Load a *.npy archive of a dictionary and swap (reverse) the dictionary keys and values around" parser = argparse.ArgumentParser(description=description) gen...
3.796875
4
swf/responses/__init__.py
nstott/simpleflow
69
12794323
from .base import Response # NOQA
0.988281
1
bet9ja.py
kennedyC2/Arbitrage
0
12794324
<gh_stars>0 # Dependencies # ============================================================================================================= import undetected_chromedriver.v2 as uc from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdri...
1.992188
2
src/hermesIII/src/xbox_360.py
hmalatini/hermes3
0
12794325
#!/usr/bin/env python import rospy from geometry_msgs.msg import Twist from sensor_msgs.msg import Joy toggle = False def callback(data): global toggle twist = Twist() twist.linear.x = 1.5*data.axes[1] twist.linear.y = -1.5*data.axes[0] twist.angular.z = 1.5*data.axes[3] if(data.buttons[4] == 1): toggle = Tru...
2.71875
3
scripts/print_trace.py
master-coro/gantt-trampoline
4
12794326
<reponame>master-coro/gantt-trampoline import sys from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) from lib.Tasks import TraceGenerator import argparse parser = argparse.ArgumentParser(description="Print trace from a Trampoline application.") parser.add_argument('--trace_pa...
2.40625
2
sdk/python/pulumi_aws/route53/zone_association.py
Charliekenney23/pulumi-aws
0
12794327
<reponame>Charliekenney23/pulumi-aws # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from .. import utilities, tables ...
1.875
2
codecast/0/dwpage.py
wsricardo/makvincis
0
12794328
<gh_stars>0 # downoad web page import urllib.request as request url = "https://en.wikipedia.org/wiki/Main_Page" data = request.urlopen(url).read() print(data.decode("utf8")) # Save html file with open("data.html","w") as fl: fl.write(data.decode("utf8")) print("\n\nFinishh") print("File saved with name (current d...
3.28125
3
dl/gym_test.py
Nemandza82/g5-poker-bot
4
12794329
import time from load_gym import load_gym import action_helpers as ah import dl_model_1 as m1 def append_winnings(all_states, all_winnings, winnings): while len(all_winnings) < len(all_states): id = len(all_winnings) player_id = all_states[id].player_to_act all_winnings.append(winnings[pla...
2.609375
3
project/migrations/0004_auto_20191027_2049.py
Belie06Loryn/Project_Post
0
12794330
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-10-27 18:49 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('project', '0003_voting'), ] operations = [ m...
1.554688
2
topcoder/solutions/SortEstimate.py
0x8b/HackerRank
3
12794331
<reponame>0x8b/HackerRank<gh_stars>1-10 #!/usr/bin/env python import math def how_many(c, time): assert 1 <= c <= 100 assert 1 <= time <= 2000000000 left, right = 1, 2000000000 while not right - left < 1e-9: n = (left + right) / 2 if n * math.log(n, 2) >= time / c: righ...
3.03125
3
tests/test_vembrane.py
FelixMoelder/vembrane
0
12794332
from pathlib import Path import os from pysam import VariantFile import pytest import yaml from vembrane import errors from vembrane import __version__, filter_vcf CASES = Path(__file__).parent.joinpath("testcases") def test_version(): assert __version__ == "0.1.0" @pytest.mark.parametrize( "testcase", [d...
2.03125
2
tests/test_authLdap.py
kakwa/dnscherry
9
12794333
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import with_statement from __future__ import unicode_literals import pytest import sys from sets import Set from dnscherry.auth.modLdap import Auth, CaFileDontExist import cherrypy import logging import ldap cfg = { 'auth.ldap.module': 'dnscherry.backend....
1.84375
2
fake-switches/run_switch.py
CC-Digital-Innovation/devops-workshop
0
12794334
<reponame>CC-Digital-Innovation/devops-workshop from twisted.internet import reactor from fake_switches.switch_configuration import SwitchConfiguration, Port from fake_switches.transports.ssh_service import SwitchSshService from fake_switches.dell.dell_core import DellSwitchCore class CustomSwitchConfiguration(SwitchC...
2.390625
2
design/server/api/Transaction.py
smdsbz/database-experiment
0
12794335
<gh_stars>0 # -*- coding: utf-8 -*- from flask import request from flask_restful import Resource from flask_restful import abort import decimal as D from db import MerchandiseDao, TransactionDao, TransDetailDao, EmployeeDao from db import ShiftsDao, VIPTransRecordDao from .Auth import auth merch_dao = MerchandiseD...
2.390625
2
doge/filter/__init__.py
zhu327/doge
163
12794336
from typing import Any from gevent.monkey import patch_thread # type: ignore from doge.common.doge import Executer, Request, Response from doge.common.utils import import_string patch_thread() class BaseFilter(Executer): def __init__(self, context: Any, _next: Executer): self.next = _next def exe...
2.046875
2
solution/string/no_58_2_left_rotate.py
LibertyDream/algorithm_data_structure
0
12794337
'''面试题58-2:左旋转字符串 字符串的左旋转操作是把字符串前面的若干个字符转移到字符串的尾部。 请定义一个函数实现字符串左旋转操作的功能。 --------------- input: abcdefg 2 output: cdefgab ''' def left_rotate(string, n): if string is None or len(string) == 0: return None if n < 0 or n >len(string): return None str_arr = [x for x in string] begin =...
3.859375
4
Projects/Online Workouts/w3resource/Collections/program-9.py
ivenpoker/Python-Projects
1
12794338
#!/usr/bin/env python3 ############################################################################################ # # # Program purpose: Adds more number of elements to a deque object from an iterable # # ...
3.90625
4
parts/app/partsnumber/models.py
heljhumenad/parts-arrival
3
12794339
from django.db import models from django.utils.translation import gettext_lazy as _ from django.urls import reverse from parts.core.managers import AbstractUpdateViewManager from parts.core.models import TimeStampModel class PartsNumber(AbstractUpdateViewManager, TimeStampModel): SOURCE_CODE = ( ("01", ...
2.140625
2
backend/app/views/common_data.py
Edinburgh-Genome-Foundry/CAB
19
12794340
<reponame>Edinburgh-Genome-Foundry/CAB<gh_stars>10-100 import os data_path = os.path.join("app", "data", "example_data_file.txt") with open(data_path, "r") as f: DATA = f.read()
1.867188
2
example_problem/settings/daphne_fields.py
seakers/daphne-brain
0
12794341
daphne_fields = ['context', 'data']
1.015625
1
python/problem6.py
shubhamoy/project-euler-solutions
1
12794342
<filename>python/problem6.py #!/usr/bin/python sosq = 0 sqos = 0 for i in range(1, 101): sosq += i*i sqos += i diff = (sqos * sqos) - sosq print "Sum of Squares: ", str(sosq) print "Squares of Sum: ", str(sqos*sqos) print "Difference: ", str(diff)
3.484375
3
euler-29.py
TFabijo/euler
0
12794343
<filename>euler-29.py def različne_potence(a_max,b_max): stevila = set() for a in range(2,a_max+1): for b in range(2,b_max+1): stevila.add(a**b) return len(stevila) različne_potence(100,100)
3.078125
3
Icons/fu4028.py
friedc/fu
0
12794344
#---------------------------------------------------------------------- # This file was generated by C:\Python27\Scripts\img2py # from wx.lib.embeddedimage import PyEmbeddedImage fu4028 = PyEmbeddedImage( "iVBORw0KGgoAAAANSUhEUgAAACgAAAAcCAYAAAATFf3WAAAAAXNSR0IArs4c6QAAAARnQU1B" "AACxjwv8YQUAAAAJcEhZcwA...
1.421875
1
src/main.py
feizhang365/tablestruct2word
0
12794345
# -*- encoding: utf-8 -*- # __author__ = 'FeiZhang <EMAIL>' __date__ = '2019-07-20' from mysqlconn import MyConn from settings import DB_CONFIG from gendocx import gen_doc, doc_append_table def main(): """ entry point :return: """ try: my_conn = MyConn(DB_CONFIG) conn = my_conn.co...
2.6875
3
mtml/toy/tests/test_avimadsen.py
crb479/mcdevitt-trauma-ml
5
12794346
from ..avimadsen import add_user_tag from .. import echo_args def test_avimadsen(): wrapped_echo_args = add_user_tag(echo_args) print(wrapped_echo_args('test1', 'test2')) assert(hasattr(wrapped_echo_args, '__user_tag__') and (wrapped_echo_args.__user_tag__ == 'avimadsen'))
2.609375
3
pyPack/html.py
slozano54/projetDNB
1
12794347
#!/usr/bin/python3 #-*- coding: utf8 -*- # @author : <NAME> """ Génère une page HTML. """ pass # On fait les imports nécessaires selon le contexte # Pour pouvoir créer un répertoire, ici pour y mettre les fichiers HTML import os # On fait les imports nécessaires selon le contexte # Pour générer les fichiers HTML...
2.765625
3
src/deliverer/views.py
OrenBen-Meir/Meal-Spot
0
12794348
from django.shortcuts import render, redirect, get_list_or_404, get_object_or_404 from database.models import user, restaurant, address from helper import parse_req_body, userTypeChecker import django.views # Create your views here. def home(request): my_user = None # makes sure user is deliverer try: ...
2.09375
2
scripts/addons/animation_nodes/nodes/object/object_attribute_input.py
Tilapiatsu/blender-custom_conf
2
12794349
<reponame>Tilapiatsu/blender-custom_conf import bpy from bpy.props import * from ... utils.code import isCodeValid from ... events import executionCodeChanged from ... base_types import AnimationNode class ObjectAttributeInputNode(bpy.types.Node, AnimationNode): bl_idname = "an_ObjectAttributeInputNode" bl_lab...
2
2
opencv/commercial/Instructions/OpenCV_Basics/image/image.py
SSG-DRD-IOT/commercial-iot-security-system
0
12794350
<gh_stars>0 import cv2 img = cv2.imread( 'image.jpg' ) cv2.imshow( "Image", img ) cv2.waitKey( 0 ) cv2.imwrite( "new_image.jpg", img ) cv2.destroyAllWindows()
2.78125
3