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
solutions/official/11_bruteforce.py
kurazu/pycon_quiz
0
12777151
import hashlib ENCODED = 'sha1$bh9ul$8e808fcea5418aa971311ea1598df65627ea3b98' _, SALT, PASSWORD = ENCODED.split('$') def check(possibility): return hashlib.sha1(SALT + possibility).hexdigest() == PASSWORD f = open('solutions/official/CSW12.txt', 'rb') for row in f: row = row.rstrip() if not row: continue if '...
3.4375
3
features/features_classes/kl_divergence.py
swisscom/ai-research-data-valuation-repository
0
12777152
"""Copyright © 2020-present, Swisscom (Schweiz) AG. All rights reserved.""" from .feature import Feature from scipy.stats import entropy import numpy as np class KLDivergence(Feature): r""" A feature that computes the KL divergence between the logits of each data points given by a classifier mean logits ...
3.734375
4
pkgs/anaconda-navigator-1.1.0-py27_0/lib/python2.7/site-packages/anaconda_navigator/utils/errors.py
wangyum/anaconda
0
12777153
# -*- coding: utf-8 -*- # # Copyright 2016 Continuum Analytics, Inc. # May be copied and distributed freely only as part of an Anaconda or # Miniconda installation. # """ Custom errors on Anaconda Navigator. """ class AnacondaNavigatorException(Exception): pass
1.21875
1
spectre/trading/stopmodel.py
rajach/spectre
302
12777154
<filename>spectre/trading/stopmodel.py """ @author: Heerozh (<NAME>) @copyright: Copyright 2019-2020, Heerozh. All rights reserved. @license: Apache 2.0 @email: <EMAIL> """ import math def sign(x): return math.copysign(1, x) class PriceTracker: def __init__(self, current_price, recorder=max): self.l...
2.484375
2
src/chameleon/nodes.py
fschulze/chameleon
0
12777155
<filename>src/chameleon/nodes.py from .astutil import Node class UseExternalMacro(Node): """Extend external macro.""" _fields = "expression", "slots", "extend" class Sequence(Node): """Element sequence.""" _fields = "items", def __nonzero__(self): return bool(self.items) class Conte...
2.453125
2
Anime_Downloader.py
Noah670/Anime-Downloader
3
12777156
import Anime_Scraper import Color import warnings import ssl import argparse import requests import shutil import os import re import sys from platform import system from threading import Thread from queue import Queue from art import text2art directory = "" threads = 1 token = None titles = False args = None gui...
2.78125
3
s3stash/nxstashref_image.py
barbarahui/nuxeo-calisphere
0
12777157
<reponame>barbarahui/nuxeo-calisphere #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import os from s3stash.nxstashref import NuxeoStashRef from ucldc_iiif.convert import Convert import logging PRECONVERT = ['image/jpeg', 'image/gif', 'image/png'] class NuxeoStashIm...
2
2
datahub/sql/controllers/gcp/create_dataset_controller.py
arpitkjain7/synapse
2
12777158
<filename>datahub/sql/controllers/gcp/create_dataset_controller.py from commons.external_call import APIInterface from sql import config from sql.crud.dataset_crud import CRUDDataset from datetime import datetime class CreateDatasetController: def __init__(self): self.gcp_config = config.get("core_engine"...
2.75
3
aws_managers/athena/queries/real_column_query.py
vahndi/aws-managers
0
12777159
<reponame>vahndi/aws-managers from aws_managers.athena.queries.column_query import ColumnQuery from aws_managers.athena.functions.aggregate import AvgMixin, \ GeometricMeanMixin, MaxMixin, MinMixin, SumMixin class RealColumnQuery( AvgMixin, GeometricMeanMixin, MaxMixin, MinMixin, SumMixin, ...
1.679688
2
ptpy/extensions/nikon.py
coon42/sequoia-ptpy
46
12777160
<filename>ptpy/extensions/nikon.py '''This module extends PTP for Nikon devices. Use it in a master module that determines the vendor and automatically uses its extension. This is why inheritance is not explicit. ''' from ..util import _main_thread_alive from construct import ( Container, PrefixedArray, Struct, ) f...
2.203125
2
Change Return Program/changereturn.py
yashpatel123a/Mini-Projects
0
12777161
def change_return(amount,currency): currency.sort(reverse = True) counter = 0 amount_counter = [0]*len(currency) while amount> 0: amount_counter[counter] = int(amount/currency[counter]) amount -= amount_counter[counter]*currency[counter] counter += 1 return [(currency[i],amou...
3.71875
4
AdaBoost/adaboost.py
JNero/Machine-Learning-in-action
0
12777162
<reponame>JNero/Machine-Learning-in-action # -*- coding: utf-8 -*- # @Time : 17-9-26 下午2:47 # @Author : QIAO
1.0625
1
scripts/pick_model.py
jowagner/uuparser
86
12777163
import os import sys #usage: #python file.txt trained_models_dir # where the file contains iso codes of languages for which you want a model # and trained_models_dir is a directory containing trained models and their # evaluation on the dev set for the languages of interest if len(sys.argv) < 3: r...
2.859375
3
e/mail-relay/web/apps/mail/migrations/0099_auto_20170522_1050.py
zhouli121018/nodejsgm
0
12777164
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mail', '0098_auto_20170522_0940'), ] operations = [ migrations.AddField( model_name='checksettings', ...
1.578125
2
scripts/generate_accelerated_bindings.py
miiklay/pymapd
0
12777165
""" Generate Accelerated Thrift bindings """ import os import argparse import re import shutil import subprocess import sys xpr_hints = re.compile(".*completion_hints.*") def parse_args(args=None): parser = argparse.ArgumentParser(description='Run some benchmarks') parser.add_argument('infile', nargs='?', ty...
2.3125
2
readtagger/cli/__init__.py
bardin-lab/read_tagger
3
12777166
<filename>readtagger/cli/__init__.py """CLI module for readtagger."""
1.164063
1
wikipedia/statistics/helpers.py
vsoch/arxiv-equations
2
12777167
<reponame>vsoch/arxiv-equations # helpers.py, useful helper functions for wikipedia analysis # We want to represent known symbols (starting with //) as words, the rest characters def extract_tokens(tex): '''walk through a LaTeX string, and grab chunks that correspond with known identifiers, meaning anything...
2.90625
3
data-structure-exp-toys/exp2/test.py
taoky/gadgets
5
12777168
from huffman import HuffZipFile from os import listdir from os.path import isfile, join, splitext import hashlib import time def get_md5(path): md5 = hashlib.md5() with open(path, "rb") as f: while True: data = f.read(4096) if not data: break md5.up...
2.734375
3
snow-dots/utilities/mouse.py
cpizzica/Lab-Matlab-Control
6
12777169
#! python3 import pyautogui, sys, time #print('Press Ctrl-C to quit.') while True: x, y = pyautogui.position() positionStr = ',' + str(x).rjust(4) + ',' + str(y).rjust(4) print( time.time(), positionStr, '\n', flush=True) time.sleep(0.05)
2.984375
3
conan/recipes/android-sdk-tools/conanfile.py
alexa/aac-sdk
139
12777170
<reponame>alexa/aac-sdk from conans import ConanFile, tools, RunEnvironment import os, logging class AndroidSdkToolsConanFile(ConanFile): name = "android-sdk-tools" version = "4.0" user = "aac-sdk" channel = "stable" no_copy_source = True exports_sources = ["cmake-wrapper.cmd", "cmake-wrapper"]...
2.125
2
print_text/add.py
ErraticO/test_github_release_pypi
2
12777171
def make(): print("add")
1.375
1
multiformats/multicodec/__init__.py
hashberg-io/multiformats
1
12777172
""" Implementation of the `multicodec spec <https://github.com/multiformats/multicodec>`_. Suggested usage: >>> from multiformats import multicodec """ import importlib.resources as importlib_resources from io import BufferedIOBase import json import re import sys from typing import AbstractSet, Any, cas...
2.875
3
k8svimdriver/service/k8s.py
accanto-systems/k8s-vim-driver
0
12777173
from ignition.service.config import ConfigurationPropertiesGroup class K8sProperties(ConfigurationPropertiesGroup): def __init__(self): super().__init__('k8s') self.tmpdir = "./"
1.6875
2
blogger_tests.py
cjhang/blogger
0
12777174
<gh_stars>0 # -*- coding: utf-8 -*- import os import blogger import unittest import tempfile class FlaskTestCase(unittest.TestCase): def setUp(self): self.db_fd, blogger.app.config['DATABASE'] = tempfile.mkstemp() blogger.app.config['TESTING'] = True self.app = blogger.app.test_client() ...
2.5
2
Test_h5.py
philippgualdi/PyQMRI
0
12777175
<filename>Test_h5.py import h5py filename = "../VFA_phantom_8.h5" h5 = h5py.File(filename, 'a') if 'Coils' in h5: Coils = h5['Coils'] # VSTOXX futures data print(Coils) del h5['Coils'] print(list(h5.keys())) if 'flip_angle(s)' in h5: print("Flip angle exists") data = h5['flip_angle(s)'] d...
2.359375
2
kendall.py
Sharingsky/FORMERAMC
0
12777176
<reponame>Sharingsky/FORMERAMC from pandas import DataFrame import pandas as pd x = [10-i for i in range(10)] y = [8,2,9,3,5,10,1,4,7,6] data = DataFrame({'x':x,'y':y}) print(data.head()) kend=data.corr(method='kendall') print(kend)
2.734375
3
src/djangoreactredux/djrenv/lib/python3.5/site-packages/prospector/exceptions.py
m2jobe/c_x
1
12777177
# -*- coding: utf-8 -*- # We are trying to handle pylint changes in their exception classes try: # pylint < 1.7 from pylint.utils import UnknownMessage as UnknownMessageError except ImportError: # pylint >= 1.7 from pylint.exceptions import UnknownMessageError class FatalProspectorException(Exception)...
2.546875
3
ejemplo13/main.py
JandroGC/curso_micropython
0
12777178
<gh_stars>0 # Ejemplo 13, encendido de iluminacion con # Bluetooth de baja energía (BLE) # Bluetooth Low Energy # Autor: <NAME> # Marzo 2022 # Importamos las librerías necesarias from machine import Pin, Timer from time import sleep_ms, sleep import ubluetooth # Creamos una clase BLE que es la que # gesti...
3.15625
3
classResults.py
Mulugruntz/Report-Tool
0
12777179
<reponame>Mulugruntz/Report-Tool from decimal import Decimal, DivisionByZero from typing import Dict, List, Tuple import numpy as np from collections import OrderedDict import funcMisc # TODO: is it needed to subclass dict? Especially for one huge method! class TradesResults(dict): """ Class with metho...
2.96875
3
src/xbase/layout/fill/tech.py
skyworksinc/xbase
3
12777180
<reponame>skyworksinc/xbase # SPDX-License-Identifier: Apache-2.0 # Copyright 2019 Blue Cheetah Analog Design 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.or...
1.835938
2
hangman.py
swatisrs/Hangman
4
12777181
<filename>hangman.py import random from bs4 import BeautifulSoup import urllib.request import requests def display_hangman(tries): stages = [ """ -------- | | | O | \\|/ | | ...
3.65625
4
connection_plugin/macros/__init__.py
bakdata/connection_plugin
1
12777182
from airflow.hooks.base_hook import BaseHook def get_conn(conn_id): # get connection by name from BaseHook conn = BaseHook.get_connection(conn_id) return conn
1.703125
2
FWCore/GuiBrowsers/python/JSONExport.py
NTrevisani/cmssw
3
12777183
from __future__ import absolute_import import sys import os.path import logging import random import FWCore.ParameterSet.SequenceTypes as sqt import FWCore.ParameterSet.Config as cms import FWCore.ParameterSet.Modules as mod import FWCore.ParameterSet.Types as typ import FWCore.ParameterSet.Mixins as mix from .Vispa....
2.015625
2
gdocorg/__init__.py
tgbugs/gdocorgpy
5
12777184
<filename>gdocorg/__init__.py #!/usr/bin/env python3.6 import io from pathlib import Path from googleapiclient.discovery import build from googleapiclient.http import MediaIoBaseDownload from httplib2 import Http from oauth2client import file, client, tools from pyontutils.config import devconfig from IPython import em...
2.46875
2
fairseq/criterions/label_smoothed_cross_entropy_with_regularization.py
raphaelmerx/fairseq_extension
2
12777185
# 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 math import torch.nn.functional as F from fairseq import metrics, utils from fairseq.criterions import register_criterion from .labe...
2.40625
2
tests/real/test_real_proportional.py
simberaj/votelib
13
12777186
import sys import os import csv import decimal import pytest sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) import votelib.candidate import votelib.convert import votelib.evaluate.threshold import votelib.evaluate.proportional DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') @pytest...
2.28125
2
deadtrees/network/extra/efficientunetplusplus/model.py
cwerner/deadtrees
1
12777187
<reponame>cwerner/deadtrees from typing import List, Optional, Union from segmentation_models_pytorch.base import ( ClassificationHead, SegmentationHead, SegmentationModel, ) from segmentation_models_pytorch.encoders import get_encoder import torch from torchvision import transforms from .decoder import ...
2.640625
3
02_app/utils.py
FelipeTe/DS4A
0
12777188
import os import requests from shapely.geometry import Point import geopandas as gpd def geo_code(address, city): """ Geo code address sing open maps API Parameters ------------ address: str Address as clear as possible, better to check first if it can be found in open street sear...
3.265625
3
zephyr/zmake/zmake/zmake.py
sjg20/ec
0
12777189
<filename>zephyr/zmake/zmake/zmake.py # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module encapsulating Zmake wrapper object.""" import logging import os import pathlib import shutil import subpro...
1.945313
2
Utilities.py
haroldport/portfolio-scripts
0
12777190
<reponame>haroldport/portfolio-scripts from os import system, name class Utilities: @staticmethod def clear(): if name == 'nt': _ = system('cls') else: _ = system('clear') @staticmethod def create_ticker(stocks): while True: ticker = input(...
3.046875
3
src/PaperCrawler.py
coutyou/THU-IR-BIG-HW-3
0
12777191
class Url(object): def __init__(self, url, title, ref_num, depth): self.url = url self.title = title self.ref_num = ref_num self.depth = depth def __lt__(self, other): return self.ref_num > other.ref_num def __gt__(self, other): return self.ref_num <...
3.453125
3
dialogs/top_level_dialog.py
Maxwingber/corobot
0
12777192
<gh_stars>0 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import base64 from datetime import date, time from botbuilder.core import MessageFactory from botbuilder.dialogs import ( WaterfallDialog, DialogTurnResult, WaterfallStepContext, ComponentDialog, ...
1.976563
2
applications/utopianIdentificationNumber.py
silvioedu/HackerRank-Regex-Practice
0
12777193
<filename>applications/utopianIdentificationNumber.py import re if __name__ == '__main__': regex = r'^[a-z]{0,3}\d{2,8}[A-Z]{3,}$' dict = {True: "VALID", False: "INVALID"} for _ in range(int(input())): print(dict[bool(re.search(regex, input()))])
3.5
4
benchmark/csv/pandas_read_all.py
tgcandido/time-series-with-arctic
0
12777194
<reponame>tgcandido/time-series-with-arctic<filename>benchmark/csv/pandas_read_all.py<gh_stars>0 import pandas as pd import time start = time.time() df = pd.read_csv('finance.csv') df['unix'] = pd.to_datetime(df['unix']) df.set_index('unix', inplace=True) elapsed = time.time() - start print(f'read_csv took {elaps...
2.40625
2
src/utils/__init__.py
SgtMilk/stock-prediction
0
12777195
<filename>src/utils/__init__.py<gh_stars>0 # Copyright (c) 2021 <NAME>. Licence included in root of package. from .print_colors import Colors from .get_base_path import get_base_path
1.289063
1
libapparmor/utils/test/test-dbus.py
pyronia-sys/libpyronia
0
12777196
<reponame>pyronia-sys/libpyronia<gh_stars>0 #!/usr/bin/python3 # ---------------------------------------------------------------------- # Copyright (C) 2015 <NAME> <<EMAIL>> # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # ...
1.585938
2
optimade-python-tools/tests/validator/test_utils.py
attlevafritt/tfya92-groupa-optimade-python-tools
0
12777197
<reponame>attlevafritt/tfya92-groupa-optimade-python-tools import pytest from optimade.validator.utils import test_case as validator_test_case from optimade.validator.utils import ResponseError from optimade.validator.validator import ImplementationValidator try: import simplejson as json except ImportError: i...
2.5625
3
pitop/miniscreen/oled/core/__init__.py
pi-top/pi-top-Python-SDK
28
12777198
<reponame>pi-top/pi-top-Python-SDK from .device_controller import OledDeviceController from .fps_regulator import FPS_Regulator from .lock import MiniscreenLockFileMonitor
1.039063
1
ssh_interface/ssh.py
ilya-rarov/scylladb_installer
0
12777199
<filename>ssh_interface/ssh.py import paramiko from base64 import b64decode class MissingAuthInformation(Exception): pass class MissingSudoPassword(Exception): pass class SSHConnection: def __init__(self, host, port, user, password=None): self._host = host self._port = port sel...
2.71875
3
seminars/04.15.2022/try_pymorphy.py
veronicamanukyan/2021-2-level-ctlr
0
12777200
<gh_stars>0 import time from pathlib import Path import pymorphy2 def main(): morph_analyzer = pymorphy2.MorphAnalyzer() all_parses = morph_analyzer.parse('стали') print(f'Analyzer found {len(all_parses)} different options of what this word means') # Usually we should take the first one - it is corr...
3.21875
3
crack-data-structures-and-algorithms/leetcode/find_minimum_in_rotated_sorted_array_II_q154.py
Watch-Later/Eureka
20
12777201
# -*- coding: utf-8 -*- # 0xCCCCCCCC # Like Q153 but with possible duplicates. def find_min(nums): """ :type nums: List[int] :rtype: int """ l, r = 0, len(nums) - 1 while l < r and nums[l] >= nums[r]: m = (l + r) // 2 if nums[m] > nums[r]: l = m + 1 elif num...
3.65625
4
test/CSRF-server.py
DanNegrea/PyRules
9
12777202
#!/usr/bin/env python # Example server used to test Simple-CSRF-script.py and Advanced-CSRF-script.py # GET creates the token # POST verifies itand creates a new one from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from optparse import OptionParser import string, random, re html = """ <!DOCTYPE html> ...
3.109375
3
user/mixins.py
calumlim/talentalps
0
12777203
from django.contrib.auth.mixins import AccessMixin class StaffAccessMixin(AccessMixin): def dispatch(self, request, *args, **kwargs): if not (request.user.is_authenticated and request.user.is_staff): return self.handle_no_permission() return super().dispatch(request, *args, **kwargs) c...
2.015625
2
src/cli.py
prettyirrelevant/flask-cookiecutter
2
12777204
from pathlib import Path import click from flask import current_app as app from flask.cli import AppGroup, with_appcontext blueprints_cli = AppGroup( "blueprints", short_help="Creation and listing of blueprints." ) @blueprints_cli.command("create") @click.argument("name") @click.option( "-f", "--full", ...
2.78125
3
tests/test_Services.py
cossio/ProteoPy
0
12777205
<gh_stars>0 """ Tests for the Services class """ from unittest import TestCase import ProteoPy class TestServices(TestCase): """ Contains tests for the Services class """ def setUp(self): self.services = ProteoPy.Services() def test_uniprot_id(self): ''' Tests Services....
2.453125
2
w2v_setup/jsontest.py
derdav3/tf-sparql
5
12777206
def something(a,b): if a > 11: print a, b return True else: return False for a in xrange(10): for b in xrange(20): print a, b if something(a, b): # Break the inner loop... break else: # Continue if the inner loop wasn't broken. ...
3.9375
4
training.py
zeta1999/adversarial-robustness-by-design
8
12777207
<filename>training.py import argparse import torch from utils import get_model, compute_score, cifar10, cifar100, return_path_to_folder def training(net, train_dl, test_dl, device, n_epochs, optimizer, is_scheduler, milestones): if is_scheduler: scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(opti...
2.640625
3
meiduo_mall/utils/django_redis_demo.py
liusudo123/meiduo_project
0
12777208
<gh_stars>0 # 1. 导包 from django_redis import get_redis_connection # 2. 链接 def test_django_redis(): client = get_redis_connection('default') # 3. 曾删改查 client.set('django_redis_key', 'itcast') print(client.get('django_redis_key'))
1.96875
2
app.py
dosterman09/web-scraping-challenge
0
12777209
<reponame>dosterman09/web-scraping-challenge<filename>app.py from flask import Flask, render_template, redirect import pymongo import scrape_mars app = Flask(__name__) mongo = pymongo(app) @app.route("/") def index(): mars = collection.find_one() return render_template("index.html", mars = mars) @app.route(...
2.8125
3
sphinx/tello/source/_static/code/python/control-program/tello.py
oneoffcoder/books
26
12777210
import socket import threading import time class Tello(object): """ Wrapper class to interact with the Tello drone. """ def __init__(self, local_ip, local_port, imperial=False, command_timeout=.3, tello_ip='192.168.10.1', tello_port=8889): "...
3.3125
3
Program.py
bordaigorl/lemma9
0
12777211
<filename>Program.py from NameReprManager import NameReprManager from Definition import Definition from Process import Process from InclusionCheck import check_inclusion from secrets_leaks import get_secret_definition, get_leak_definition, get_leak_proc from Widening import widen_iteratively class Program(object): ...
2.59375
3
myvenv/lib/python3.5/site-packages/allauth/socialaccount/providers/untappd/urls.py
tuvapp/tuvappcom
1
12777212
<reponame>tuvapp/tuvappcom from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns from .provider import UntappdProvider urlpatterns = default_urlpatterns(UntappdProvider)
1.289063
1
describe_dask/test_describe_dask.py
guy1992l/functions
25
12777213
<reponame>guy1992l/functions from mlrun import code_to_function, new_function, import_function from pathlib import Path import os DATA_URL = 'https://s3.wasabisys.com/iguazio/data/iris/iris_dataset.csv' ARTIFACTS_PATH = 'artifacts' PLOTS_PATH = ARTIFACTS_PATH + '/plots' def _create_dask_func(uri): dask_cluster_n...
2.625
3
notecoin/huobi/connection/core.py
notechats/notecoin
0
12777214
<gh_stars>0 import logging from notecoin.huobi.connection.impl import (RestApiRequest, WebsocketManage, WebsocketRequest, WebSocketWatchDog, call_sync, call_sync_perforence_test) from not...
2.0625
2
app/data/rader_chart/bin/sub/output_chart_data.py
yokrh/sdvx-score-rader
0
12777215
<filename>app/data/rader_chart/bin/sub/output_chart_data.py import json import fnmatch import os import codecs """ Create rader chart json data of a track. Parameters ---------- name : string level : string difficulty : string prediction_dir : string output_dir : string """ def create_chart_data( *, name, leve...
2.296875
2
src/db.py
failip/coffee
0
12777216
from pymongo import MongoClient from user import User import json class Database: def __init__(self): self.client = MongoClient( 'localhost', 27017, username="root", password="<PASSWORD>") self.db = self.client.test_database self.users = self.db.users self.settings = se...
3.265625
3
sustainableCityManagement/main_project/ML_models/footfall_prediction.py
Josh-repository/Dashboard-CityManager-
0
12777217
<reponame>Josh-repository/Dashboard-CityManager- import numpy as np import math import sys import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.linear_model import Ridge from sklearn.linear_model import LinearRegression from ..Config.config_handler import read_config config...
2.890625
3
ver1_0/openassembly/pirate_sources/templatetags/sourcetags.py
fragro/Open-Assembly
1
12777218
<filename>ver1_0/openassembly/pirate_sources/templatetags/sourcetags.py from django import template from django import forms from django.http import HttpResponseRedirect from django.contrib.contenttypes.models import ContentType from pirate_sources.models import IMGSource, URLSource from pirate_core.views import HttpRe...
2.125
2
bin/Resize.py
tsteffek/LicensePlateReconstructor
2
12777219
import argparse import multiprocessing from multiprocessing.queues import Queue from queue import Empty from PIL.Image import Image from src.base import IO def repeat(queue: Queue, resize): try: while True: load_resize_save(queue.get(True, 5), resize) except Empty: return def l...
2.796875
3
toBus/base_bus.py
sherry0429/tobus
2
12777220
<reponame>sherry0429/tobus<filename>toBus/base_bus.py # -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> <sherry0429 at SOAPython> """ from threading import Thread import time import pickle import redis from base_msg import BaseMessage class MsgBus(object): access_modules = set() def __init__(self, redi...
2.5
2
experiments/uai_experiments.py
bradyneal/realcause
35
12777221
import numpy as np import pandas as pd import time from pathlib import Path from experiments.evaluation import calculate_metrics from causal_estimators.ipw_estimator import IPWEstimator from causal_estimators.standardization_estimator import \ StandardizationEstimator, StratifiedStandardizationEstimator from exper...
2.140625
2
NER/handlepseudosamples.py
qcwthu/Lifelong-Fewshot-Language-Learning
36
12777222
import os import json import torch import torch.nn as nn import torch.optim as optim import torch.utils as utils import sys import argparse import matplotlib import pdb import numpy as np import time import random import re import time import matplotlib.pyplot as plt from tqdm import tqdm from tqdm import trange from s...
1.929688
2
MoinMoin/packages.py
RealTimeWeb/wikisite
1
12777223
# -*- coding: iso-8859-1 -*- """ MoinMoin - Package Installer @copyright: 2005 MoinMoin:AlexanderSchremmer, 2007-2010 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ import os, re, sys import zipfile from MoinMoin import config, wikiutil, caching, user from MoinMoin.P...
2.140625
2
emulation_execution_run.py
theuerse/emulation_lib
2
12777224
import os import emulation_lib.ssh_lib as ssh import logging from datetime import datetime from datetime import timedelta from multiprocessing.dummy import Pool as ThreadPool import time from . import constants CONFIG = {} EXPECTED_RESULTFILES = {} CONFIG_FILES = {} REMOTE = 0 LOCAL = 1 setup_scripts = [] runtime_sc...
2.09375
2
AnkiTools/api/defaults.py
patarapolw/AnkiTools
53
12777225
<reponame>patarapolw/AnkiTools<filename>AnkiTools/api/defaults.py import json from collections import OrderedDict from AnkiTools.tools.defaults import DEFAULT_API_PREFORMATTED_PAYLOAD def get_default_payload(sample_params: dict, add_note_template: dict=None, preformatt...
2.171875
2
panoptes_client/subject_set.py
RonaCostello/panoptes-python-client
0
12777226
from __future__ import absolute_import, division, print_function from builtins import str from panoptes_client.panoptes import PanoptesObject, LinkResolver from panoptes_client.set_member_subject import SetMemberSubject from panoptes_client.subject import Subject from panoptes_client.utils import batchable class Sub...
2.25
2
bot/exts/error_handler.py
python-discord/sir-robin
12
12777227
from discord import Colour, Embed from discord.ext.commands import (BadArgument, Cog, CommandError, CommandNotFound, Context, MissingRequiredArgument) from bot.bot import SirRobin from bot.log import get_logger log = get_logger(__name__) class Erro...
2.59375
3
tests/suite/test_virtual_server_tls_redirect.py
saptagiri1983/kubernetes-ingress
1
12777228
<gh_stars>1-10 import pytest import requests from settings import TEST_DATA from suite.custom_resources_utils import patch_virtual_server_from_yaml from suite.resources_utils import wait_before_test @pytest.mark.vs @pytest.mark.parametrize('crd_ingress_controller, virtual_server_setup', [({"...
2.140625
2
sv_pdl/atlas/management/commands/upload_atlas_tarball.py
eldarion-client/scaife-viewer
70
12777229
import os import shlex import subprocess from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand class Command(BaseCommand): """ Compresses / uploads an ATLAS database tarball """ help = "Compresses / uploads an ATL...
2.234375
2
bin/api/texsyn.py
wx-csy/P5C
1
12777230
from .. import lang, prob from .. import common as com import csv, sys, pathlib def contest() : com.setroot() print(r'\input{../../resource/statement/stat.tex}') print(r'\begin{document}') meta:dict = prob.load_problist() for shortname in sorted(meta, key=lambda k:meta[k]['order']) : print(...
2.125
2
django_price/settings.py
holg/django_price
4
12777231
from django.conf import settings from django.core.exceptions import ImproperlyConfigured DEFAULT_CURRENCY = getattr(settings, 'PRICE_DEFAULT_CURRENCY', None)
1.695313
2
backend/tests/routes/mobile_access_delete_registed.py
Zaptyp/wulkanowy-web
0
12777232
<reponame>Zaptyp/wulkanowy-web from tests.checks.status_code import status_check from tests.routes.login import client def mobile_access_delete_registed_test( session_data, headers, student, school_id, host, symbol, ssl, id_mobile_deleted, fg ): response = client.post( "/api/v1/uonetplus-uczen/mobile-...
2.109375
2
ds/util/seed_everything.py
Hattyoriiiiiii/snippets
0
12777233
def seed_everything(seed=2020): random.seed(seed) os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) tf.random.set_seed(seed) seed_everything(42)
1.859375
2
tests/test_backends/test_zone.py
luhn/limited
0
12777234
from typing import Dict import pytest from limited import Zone from limited.exceptions import LimitExceededException class MockZone(Zone): buckets: Dict[str, int] def __init__(self, size: int = 10, rate: float = 1.0): self.rate = rate self.size = size self.buckets = dict() def ...
2.640625
3
kong_admin/admin.py
veris-neerajdhiman/django-kong-admin
0
12777235
<filename>kong_admin/admin.py # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function from django.utils.translation import ugettext_lazy as _ from django.contrib import admin from jsonfield2.fields import JSONField from .models import APIReference, PluginConfigurationReference, ConsumerReferen...
1.75
2
libs/applus/applus/django/db/models/manager.py
cnicgpaul123/killNCP
5
12777236
<gh_stars>1-10 # -*- coding: utf-8 -*- """ ManagerCacheMixin """ # pylint: disable=too-few-public-methods,no-self-use from django.conf import settings from django.core.cache import caches, cache from django.utils import functional from django.utils import module_loading class ManagerCacheMixin: """ ManagerCacheMi...
2.109375
2
tests/test_s3.py
calebmarcus/awacs
0
12777237
<gh_stars>0 import unittest from awacs.s3 import ARN class TestARN(unittest.TestCase): def test_aws(self): arn = ARN("bucket/key", "us-east-1", "account") self.assertEqual(arn.JSONrepr(), "arn:aws:s3:::bucket/key") def test_cn(self): arn = ARN("bucket/key", "cn-north-1", "account") ...
2.78125
3
contrastive_rl/ant_envs.py
dumpmemory/google-research
0
12777238
<reponame>dumpmemory/google-research # coding=utf-8 # Copyright 2022 The Google Research Authors. # # 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/LICENS...
1.976563
2
research_mnist/test.py
Gaon-Choi/CSE4007
0
12777239
<reponame>Gaon-Choi/CSE4007 import matplotlib.pyplot as plt import sklearn.linear_model import sklearn.discriminant_analysis import sklearn.svm import sklearn.neighbors import sklearn.neural_network from sklearn import datasets from sklearn.model_selection import train_test_split import numpy as np import time from op...
2.546875
3
Interface/Main.py
cevhersoylemez/DecisionTreeForClassification
2
12777240
from msilib import Table from tkinter import * import tkinter as tk from tkinter import filedialog from pandastable import Table,TableModel import pandas as pd from Hesapla import MC_Karar_Agaci #gerekli değişkenler test_sinir_indeks = 0 #pencere oluşturma root = Tk() root.title("Karar Ağacı Projesi") root.geometry...
2.90625
3
projects/examples/compare_gpa_and_knxproj.py
fgoettel/knx
0
12777241
<gh_stars>0 #!/usr/bin/env python3 """Compare knx GAs from ETS and GPA export.""" import argparse import logging from pathlib import Path from typing import Tuple from projects.gpa import Gpa from projects.knxproj import Knxproj def get_args() -> Tuple[Path, Path]: """Set up the parser. Returns a tuple wit...
3.09375
3
src/384-ShuffleanArray.py
Jiezhi/myleetcode
1
12777242
<reponame>Jiezhi/myleetcode #!/usr/bin/env python """ CREATED AT: 2021/8/23 Des: https://leetcode.com/problems/shuffle-an-array/ https://leetcode.com/explore/featured/card/top-interview-questions-easy/98/design/670/ GITHUB: https://github.com/Jiezhi/myleetcode """ import random from typing import List from itertools...
3.859375
4
get_moods_detail.py
MentalKali/QQZoneSpider
0
12777243
<gh_stars>0 #!/usr/bin/env python #-*- coding:utf-8 -*- """ 获取动态详情 包含3个方法: make_dict -- 用于临时保存每个QQ的动态信息,QQ号为键,值为这个QQ号的所有动态的文件列表 exact_mood_data -- 主要的功能函数,把动态信息从文件里提取出来,并调用insert_to_db方法插入到sqlite数据库中 insert_to_db -- 供exact_mood_data调用,把数据插入到sqlite数据库中 """ import os import json import sqlite3 import html clas...
3.109375
3
unity_env.py
ostamand/continuous-control
2
12777244
import numpy as np import torch class UnityEnv(): """Unity Reacher Environment Wrapper https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Learning-Environment-Examples.md """ def __init__(self, env_file='data/Reacher.exe', no_graphics=True, mlagents=False): if mlagents: ...
2.578125
3
sec09-3_apply_cfg_netmiko/apply_cfg.py
codered-by-ec-council/Network-Automation-in-Python
0
12777245
<gh_stars>0 #!/usr/bin/env python3 import argparse import getpass import netmiko import os def get_creds_interactive(get_secret=False): """ Function to interactively query for network device credentials :param get_secret: Optional argument to query for enable or secret. Defaults to False and sec set to p...
3.25
3
Pacote Dowload/CursoemVideo/ex 090.py
AMF1971/Cursoemvideo-Python
0
12777246
#Faça um programa que leia nome e média de um aluno, guardando também a situação em um dicionário. No final, # mostre o conteúdo da estrutura na tela. aluno = dict() aluno['nome'] = str(input('Nome:')) aluno['média'] = float(input(f'Média de {aluno["nome"]}')) if aluno['média'] >= 7: aluno['situação'] = 'APROVADO'...
3.796875
4
Stacks/first non repeating char in stream.py
mr-mornin-star/problemSolving
0
12777247
<gh_stars>0 from collections import deque from collections import defaultdict class Solution: # @param A : string # @return a strings def solve(self, a): mem=defaultdict(int) q=deque() ans=[] for c in a: # print(q) # print(mem) if c not in ...
3.46875
3
Skoarcery/factoary/Code_Parser_Py.py
sofakid/Skoarcery
343
12777248
<filename>Skoarcery/factoary/Code_Parser_Py.py import unittest from Skoarcery import langoids, terminals, nonterminals, dragonsets, parsetable, emissions from Skoarcery.langoids import Terminal, Nonterminal class Code_Parser_Py(unittest.TestCase): def setUp(self): terminals.init() nonterminals.in...
2.359375
2
tests/test_permissions.py
radiac/django-fastview
8
12777249
""" Test fastview/permissions.py """ import pytest from fastview.permissions import Django, Login, Owner, Public, Staff, Superuser from .app.models import Entry def test_public__public_can_access(test_data, request_public): perm = Public() assert perm.check(request_public) is True assert perm.filter(req...
2.3125
2
enigma/__version__.py
axevalley/enigma
0
12777250
"""Tabler.""" __title__ = "enigma" __description__ = "Enigma emulator" __url__ = "" __version__ = "0.1" __author__ = "<NAME>" __author_email__ = "<EMAIL>" __license__ = "MIT" __copyright__ = "Copyright 2019 <NAME>"
1.054688
1