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/ut/python/pipeline/parse/test_create_obj.py
unseenme/mindspore
2
35100
<filename>tests/ut/python/pipeline/parse/test_create_obj.py # Copyright 2020 Huawei Technologies Co., Ltd # # 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/LI...
2.234375
2
hw_asr/augmentations/spectrogram_augmentations/SpecAug.py
isdevnull/asr_hw
0
35101
import torchaudio.transforms from torch import nn from hw_asr.augmentations.base import AugmentationBase from hw_asr.augmentations.random_apply import RandomApply class SpecAug(AugmentationBase): def __init__(self, freq_mask: int, time_mask: int, prob: float, *args, **kwargs): self.augmentation = nn.Sequ...
2.390625
2
acrawler/settings.py
s723138643/acrawler
0
35102
<reponame>s723138643/acrawler<gh_stars>0 import json import pathlib DEFAULT_CONFIG = { # 设置默认class 'EngineClass': 'acrawler.engine.Engine', 'SchedulerClass': 'acrawler.scheduler.Scheduler', 'FilterClass': 'acrawler.filterlib.memfilter.MemFilter', 'QueueClass': 'acrawler.queuelib...
2.03125
2
plots/plots/weight_distribution.py
pps-lab/rofl-project-code
12
35103
<reponame>pps-lab/rofl-project-code<filename>plots/plots/weight_distribution.py from functools import reduce import matplotlib.pyplot as plt import numpy as np import pandas as pd import os import yaml from matplotlib import cm import pymongo import matplotlib from matplotlib.backends.backend_pdf import PdfPages from ...
2.375
2
analysis/Mass Action/DP/22Apro.py
tee-lab/PercolationModels
0
35104
# -*- coding: utf-8 -*- """ Created on Fri Apr 23 17:18:39 2021 @author: Koustav """ import os import glob import matplotlib.pyplot as plt import seaborn as sea import numpy as np import pandas as pan import math import collections import matplotlib.ticker as mtick from mpl_toolkits import mplot3d from matplotlib.col...
2.1875
2
loom/group.py
probcomp/loom
2
35105
<filename>loom/group.py # Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # Copyright (c) 2015, Google, Inc. # # 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 ret...
1.398438
1
src/link_baseline.py
tahleen-rahman/linkability_stepcount
0
35106
<reponame>tahleen-rahman/linkability_stepcount # Created by rahman at 16:54 2019-10-20 using PyCharm import os import sys from attacks.Linkability import Link from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LinearRegression from attacks import BinaryDNN from sklearn import svm from...
2.53125
3
main.py
chelyabinsk/FootBallDashboard
0
35107
import streamlit as st import numpy as np import pandas as pd import requests import re import altair as alt # Find all available data def find_all_spreadsheets(): available_data = {} r = requests.get('https://www.football-data.co.uk/downloadm.php') if r.status_code != 200: print('Oh dear. Error {}...
3.0625
3
easyci/app/easyCI/tasksPool.py
9OMShitikov/anytask
0
35108
import json import requests import tempfile import shutil import subprocess import os import logging import urllib.request from multiprocessing import Pool import app.easyCI.docker as docker from contextlib import contextmanager LOG = logging.getLogger(__name__) CONFIG = "config.json" PASSWORDS = "<PASSWORD>" MAX_COM...
2.140625
2
polling_stations/apps/data_collection/management/commands/import_monmouthshire.py
mtravis/UK-Polling-Stations
0
35109
from django.contrib.gis.geos import Point from data_collection.management.commands import BaseShpStationsShpDistrictsImporter class Command(BaseShpStationsShpDistrictsImporter): srid = 27700 council_id = "W06000021" districts_name = "polling_district" stations_name = "polling_station.shp" election...
2.390625
2
compiler/astnodes/typeannotation.py
yangdanny97/chocopy-python-frontend
3
35110
<gh_stars>1-10 from .node import Node class TypeAnnotation(Node): def __init__(self, location: [int], kind: str): super().__init__(location, kind)
2.34375
2
lib/lambdascrapers/sources_ lambdascrapers/de/video4k.py
proxium/script.module.lambdascrapers
11
35111
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @Daddy_Blamo wrote this file. As long as you retain this notice you # can do whatever you want wi...
2.203125
2
lab-sessions/lab-3/ex3_gray_scale.py
DatacollectorVN/BME-Bio-Image-Processing-class
0
35112
import cv2 import numpy as np import argparse def main(image_file_path): img = cv2.imread(image_file_path) img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) name_window_1 = "original" name_window_2 = "grayscale" while True: cv2.imshow(name_window_1, img) cv2.imshow(name_window_2, im...
3.15625
3
project/tests/GUI/tools.py
RemuTeam/Remu
2
35113
<filename>project/tests/GUI/tools.py from functools import partial from kivy.clock import Clock def to_task(s): s.press("//MenuButtonTitled[@name='LOGO']") s.assert_on_screen('activity') s.press('//StartNowButton') s.assert_on_screen('tasks') s.tap("//TestIntro//TestCarouselForwardButton") s....
2.375
2
login_spider.py
ERUIHNIYHBKBNF/Digit-Recognition
0
35114
<filename>login_spider.py<gh_stars>0 import requests as rq import cv2 import time import os from picdiv import divide from knn import getVeryValue from utils import showimg url = 'http://172.16.58.3/inc/validatecode.asp' res = rq.get(url) # 文件名加个时间戳 fileName = str(int(time.time())) + '.jpg' # 由于不会在内存中直接转换二进制到rgb就只能存了再...
2.3125
2
auctions/migrations/0020_bids_bidder_alter_list_date.py
AncientSoup/cs50w_commerce
1
35115
<gh_stars>1-10 # Generated by Django 4.0.1 on 2022-02-12 11:07 import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('auctions', '0019_alter...
1.53125
2
tests/test_baseline.py
pleiszenburg/pyIGRF
1
35116
<filename>tests/test_baseline.py # -*- coding: utf-8 -*- from math import isclose import pytest from pyCRGI.pure import ( get_coeffs as pure_get_coeffs, get_value as pure_get_value, get_variation as pure_get_variation, ) from pyCRGI.jited import ( get_coeffs as jited_get_coeffs, get_value as jite...
2.09375
2
mum/update/__init__.py
mapgears/maritime-update-manager
0
35117
"""Update maritime data using update modules""" from __future__ import annotations from argparse import ArgumentParser import base64 import hashlib import os import shelve import toml from .modules import get_update_module def main(): parser = ArgumentParser(description=__doc__) parser.add_argument('config...
2.296875
2
ENCODN/TOOLS/CRYPTOGRAPHY/OTHER/ROZIERCYPHER/ROZIER.py
chrisyo99/ENCODN
6
35118
<filename>ENCODN/TOOLS/CRYPTOGRAPHY/OTHER/ROZIERCYPHER/ROZIER.py<gh_stars>1-10 """ Information on the Rozier Cipher can be found at: https://www.dcode.fr/rozier-cipher ROZIER.py Written by: MrLukeKR Updated: 16/10/2020 """ # The Rozier cipher needs a string based key, which can be constant for ease # or changed for e...
3.9375
4
tests/highlevel/simpler-deepcell.py
sjdv1982/seamless
15
35119
<reponame>sjdv1982/seamless<filename>tests/highlevel/simpler-deepcell.py from seamless.highlevel import Context from pprint import pprint ctx = Context() ctx.a = 12 ctx.compute() print(ctx.a.value) print(ctx.a.schema) # None def triple_it(a): return 3 * a def triple_it_b(a, b): print("RUN!") return 3 * ...
2.078125
2
kanon_api/units.py
legau/kanon-api
0
35120
from astropy import units as u degree: u.Unit = u.degree
1.578125
2
IMLearn/utils/utils.py
AlonViz/IML.HUJI
0
35121
<filename>IMLearn/utils/utils.py from typing import Tuple import numpy as np import pandas as pd import time def split_train_test(X: pd.DataFrame, y: pd.Series, train_proportion: float = .75) \ -> Tuple[pd.DataFrame, pd.Series, pd.DataFrame, pd.Series]: """ Randomly split given sample to a training- a...
3.875
4
review/migrations/0004_auto_20170315_0930.py
kgdunn/peer-review-system
0
35122
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-15 08:30 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('review', '0003_auto_20170314_2217'), ] operations ...
1.828125
2
sesame/utils.py
GamePad64/django-sesame
0
35123
<reponame>GamePad64/django-sesame<gh_stars>0 from __future__ import unicode_literals from .backends import UrlAuthBackendMixin from .compatibility import urlencode from .middleware import TOKEN_NAME def get_parameters(user): """ Return GET parameters to log in `user`. """ return {TOKEN_NAME: UrlAuth...
2.03125
2
tests/verbs/test_drop_verb.py
RathmoreChaos/intficpy
25
35124
from ..helpers import IFPTestCase from intficpy.things import Thing, Container, Liquid class TestDropVerb(IFPTestCase): def test_verb_func_drops_item(self): item = Thing(self.game, self._get_unique_noun()) item.invItem = True self.me.addThing(item) self.assertIn(item.ix, self.me.c...
2.8125
3
woot/apps/catalog/views/forum.py
Makeystreet/makeystreet
1
35125
from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render from woot.apps.catalog.models.forum import Question, Answer from woot.apps.catalog.models.core import Makey, Comment from woot.ap...
2.171875
2
old_django_malliva/marketplaceAccounts/admin.py
olubiyiontheweb/malliva
0
35126
<reponame>olubiyiontheweb/malliva<filename>old_django_malliva/marketplaceAccounts/admin.py from django.contrib import admin from .models import MarketplaceAccount, Plan, Subscription # Register your models here. admin.site.register(Plan) admin.site.register(Subscription) admin.site.register(MarketplaceAccount)
1.398438
1
tools/cr/cr/commands/info.py
zealoussnow/chromium
14,668
35127
<filename>tools/cr/cr/commands/info.py # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A module for the info implementation of Command.""" from __future__ import print_function import cr class InfoC...
2.34375
2
mlapp/MLAPP_CODE/MLAPP-C5-Code/betaCredibleInt.py
xishansnow/MLAPP
0
35128
"""计算分位数""" from scipy import stats import numpy as np S = 47 N = 100 a = S + 1 b = (N -S) + 1 alpha = 0.05 lu = stats.beta.ppf([alpha/2, 1-alpha/2], a, b) print(lu) ## MC方法 S = 1000 X = stats.beta.rvs(a, b, size=S) X = np.sort(X, axis=0) l = X[round(S*alpha/2)] u = X[round(S*(1-alpha)/2)] print(l,u)
3.15625
3
cqa_dataloader.py
vksriharsha/CQA
8
35129
<reponame>vksriharsha/CQA<gh_stars>1-10 import json import os from concurrent.futures import ProcessPoolExecutor import numpy as np import torch from PIL import Image from nltk.tokenize import word_tokenize from torch.utils.data import Dataset, DataLoader class CQADataset(Dataset): def __init__(self, cqa_data, a...
2.46875
2
re_calc/shunting_yard.py
LilacRapture/re_calc
1
35130
from re_calc.config import * from re_calc.exceptions import CalcException from re_calc.util import is_number import re_calc.meta_containers as meta_containers def peek(stack): return stack[-1] def should_move_to_queue(stack, c_token_prc): ''' Checks token's precedence and associativity to decide if it should...
2.90625
3
image_classification/VOLO/volo.py
chuliuT/PaddleViT
0
35131
# Copyright (c) 2021 PPViT 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 # # Unless required by applicable l...
2.703125
3
setup.py
Mattjez914/Blackjack_Microchallenge
0
35132
<filename>setup.py<gh_stars>0 import learntools from setuptools import setup from setuptools import find_packages setup(name='learntools', version=learntools.__version__, description='Utilities for Kaggle Learn exercises', url='http://github.com/kaggle/learntools', author='<NAME>', author...
1.632813
2
maro/cli/grass/lib/scripts/create_job_details.py
yourmoonlight/maro
1
35133
<reponame>yourmoonlight/maro<filename>maro/cli/grass/lib/scripts/create_job_details.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import argparse import json from redis import Redis from .utils import load_cluster_details, load_job_details def create_job_details(cluster_name: str, jo...
2.234375
2
test_001/test_006.py
kostur86/kasia_tut
0
35134
#!env python3 """ Introducing static object in the world. Tasks: 1. File got really long - move all classes to library file and import them here. """ import pygame from pygame import K_ESCAPE, K_LEFT, K_RIGHT, K_UP, K_DOWN, QUIT class Game(): def __init__(self): """ Set basic configura...
3.734375
4
earth_engine/apps.py
ecsnavarretemit/sarai-satellite-analysis-backend
0
35135
<reponame>ecsnavarretemit/sarai-satellite-analysis-backend # admin.py # # Copyright(c) <NAME> <<EMAIL>> # Licensed under MIT # Version 0.0.0 from __future__ import unicode_literals from django.apps import AppConfig class EarthEngineConfig(AppConfig): name = 'earth_engine'
1.117188
1
seapy/__init__.py
oceanum/seapy
2
35136
<reponame>oceanum/seapy """ __init__.py State Estimation and Analysis for PYthon Module for working with oceanographic data and models Copyright (c)2019 University of Hawaii under the MIT-License. Requires the following packages: joblib Import classes include: - :class:`~seapy.environ.opt` - :cl...
1.898438
2
pypy/module/_ssl/interp_ssl.py
camillobruni/pygirl
12
35137
<filename>pypy/module/_ssl/interp_ssl.py<gh_stars>10-100 from pypy.rpython.rctypes.tool import ctypes_platform from pypy.rpython.rctypes.tool.libc import libc import pypy.rpython.rctypes.implementation # this defines rctypes magic from pypy.interpreter.error import OperationError from pypy.interpreter.baseobjspace impo...
2
2
apps/question2.py
roshik2016/CIS-5810-Health-Care
0
35138
# -*- coding: utf-8 -*- """ Created on Wed Nov 29 00:56:43 2017 @author: roshi """ import pandas as pd import matplotlib.pyplot as plt import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from app import app data = pd.read_csv('./data/youth_to...
2.75
3
tests/test_easy_patient_name.py
taylordeatri/phc-sdk-py
1
35139
from phc.easy.patients.name import expand_name_value def test_name(): assert expand_name_value( [{"text": "ARA251 LO", "given": ["ARA251"], "family": "LO"}] ) == {"name_given_0": "ARA251", "name_family": "LO"} def test_name_with_multiple_values(): # NOTE: Official names are preferred first and t...
3.203125
3
templates/fastApiService/zarubaServiceName/main.py
state-alchemists/zaruba
39
35140
<gh_stars>10-100 from fastapi import FastAPI from fastapi.staticfiles import StaticFiles from sqlalchemy import create_engine from helpers.transport import RMQEventMap, KafkaEventMap, get_rmq_connection_parameters, get_kafka_connection_parameters from configs.helper import get_abs_static_dir, create_message_bus, create...
1.78125
2
integration/tests_ok/user_agent.py
jleverenz/hurl
0
35141
<reponame>jleverenz/hurl from app import app from flask import request @app.route("/user-agent/a") def useragent_a(): assert "Mozilla/5.0 A" == request.headers["User-Agent"] return "" @app.route("/user-agent/b") def useragent_b(): assert "Mozilla/5.0 B" == request.headers["User-Agent"] return ""
2.21875
2
downloader_backend.py
ansys/automatic-installer
2
35142
import argparse import datetime import errno import json import logging import os import random import re import shutil import subprocess import sys import time import traceback import zipfile import zlib from functools import wraps from types import SimpleNamespace import psutil import py7zr from artifactory import A...
1.523438
2
spectrum/input.py
elifesciences/elife-spectrum
0
35143
<reponame>elifesciences/elife-spectrum<filename>spectrum/input.py """utility library for interacting with remote services, such as: * dashboard * journal * elife-bot * journal-cms contains no tests to be run.""" from os import path import random import string import requests from econtools import econ_workflow from ...
2.21875
2
tools/python/maps_generator/generator/osmtools.py
Polas/omim
1
35144
<reponame>Polas/omim import os import subprocess from . import settings from .exceptions import BadExitStatusError from .exceptions import wait_and_raise_if_fail def build_osmtools(path, output=subprocess.DEVNULL, error=subprocess.DEVNULL): src = { settings.OSM_TOOL_UPDATE: "osmupdate.c", setting...
2.046875
2
app.py
mikecarrier4/GITBTC-Prototype
0
35145
<gh_stars>0 from flask import Flask, render_template, redirect, request, url_for, session from flask_sqlalchemy import SQLAlchemy from src import DB import subprocess import os import signal app = Flask(__name__, template_folder='templates') app.secret_key = 'super secret key' app.config['SESSION_TYPE'] = 'filesystem'...
2.21875
2
codes/train_for_each_cate.py
thu-coai/DiaSafety
3
35146
<gh_stars>1-10 from transformers import RobertaTokenizer, RobertaForSequenceClassification, AdamW import torch import json from sklearn import metrics from tqdm import tqdm import numpy as np from time import time from datetime import timedelta import pandas as pd from sklearn.model_selection import train_test_split im...
2.15625
2
tests/functional/test_lentBook.py
deemarc/dmLibrary
0
35147
import unittest from dmLibrary import create_app from dmLibrary.external.googleBook import GoogleBook import time import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class TestClass(unittest.TestCase): def setUp(self): app = create_app() self.ctx = app.app_c...
3
3
LeetCode/Python/search_insert_position.py
tejeshreddy/competitive-programming
0
35148
<reponame>tejeshreddy/competitive-programming """ Title: 0035 - Search Insert Position Tags: Binary Search Time: O(logn) Space: O(1) Source: https://leetcode.com/problems/search-insert-position/ Difficulty: Easy """ class Solution(object): def searchInsert(self, nums, target): """ :type nums: List[...
3.515625
4
server/api/test.py
nwfsc-fram/Warehouse
5
35149
# pylint: disable=global-statement """ Module providing unittest test discovery hook for our Doctest testcases Copyright (C) 2015, 2016 ERT Inc. """ import unittest import doctest from time import sleep from api import app_module as app from api import ( config_loader ,aes ,json ,resource_util ) __au...
1.960938
2
tests/old_wc.py
qiaojunfeng/yambo-aiida
3
35150
from __future__ import absolute_import from __future__ import print_function import unittest from aiida.manage.fixtures import PluginTestCase import subprocess, os def backend_obj_users(): """Test if aiida accesses users through backend object.""" backend_obj_flag = False try: from aiida.backends...
2.1875
2
knn.py
dengbuqi/lie_detection
1
35151
#!/usr/bin/env python # -*- coding:utf-8 -*- # @FileName : knn.py # @Time : 2020/9/25 12:29 # @Author : 陈嘉昕 # @Demand : k-临近算法,和训练的模型作比较 import csv import math import operator from random import shuffle import matplotlib.pyplot as plt # 数据集 training_set = [] # 测试集 test_set = [] def cross_validation(fil...
3.546875
4
vnpy/trader/http/controller/stock.py
chenzj810/vnpy-stock
2
35152
# encoding: UTF-8 import os import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import json ######################################################################## class StockHandler(tornado.web.RequestHandler): """handler""" def initialize(self, mainEngine...
2.421875
2
src/headtracking_network/live_training.py
NaviRice/HeadTracking
1
35153
<reponame>NaviRice/HeadTracking<filename>src/headtracking_network/live_training.py import numpy as np import tensorflow as tf import os import navirice_image_pb2 import cv2 import random import sys from navirice_generate_data import generate_bitmap_label from navirice_helpers import navirice_image_to_np from navirice_...
2.109375
2
src/python-opencv/001-base/test_003_change.py
bjlhx15/python-algorithm
0
35154
# -*- coding: UTF-8 -*- import cv2 import numpy as np # 仿射变换(图像位置校正) def img_three(imgPath): # ---------------------------三点得到一个变换矩阵 --------------------------- """ 三点确定一个平面,通过确定三个点的关系来得到转换矩阵 然后再通过warpAffine来进行变换 """ img = cv2.imread(imgPath) rows,cols,_ = img.shape points1 ...
3.21875
3
affine/preprocessing.py
OSU-slatelab/geometric-embedding-properties
3
35155
<filename>affine/preprocessing.py from progressbar import progressbar from tqdm import tqdm import multiprocessing as mp import pandas as pd import numpy as np import pyemblib import scipy import queue import time import sys import os ''' preprocessing.py Preprocessing methods for cuto.py. ''' #========1=======...
2.421875
2
restcli/cliparser.py
jykntr/rest-cli-client
1
35156
<reponame>jykntr/rest-cli-client import argparse from profile import Profile PROXY = 'proxy' VERIFY = 'verify' DEBUG = 'verbose' class CliParser(): def __init__(self, requests, profiles, options): self.requests = requests self.profiles = profiles self.options = options self.args =...
2.5625
3
src/widgets/button.py
priscilafaliani/Analisis-De-Datos
6
35157
<reponame>priscilafaliani/Analisis-De-Datos """Builds a button according to the theme of the app.""" import PySimpleGUI as sg from src.globals import colors def build(text, key, font, size): """Returns a button with the current theme""" button = sg.Button( button_text=text, button_color=(c...
3.09375
3
python/paddle/fluid/tests/unittests/test_fused_gemm_epilogue_grad_op.py
Li-fAngyU/Paddle
8
35158
<reponame>Li-fAngyU/Paddle # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2022 NVIDIA Corporation. 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 ...
1.945313
2
scripts/classtest.py
alandegenhart/neuropy
1
35159
"""Class static method test""" class TestClass(): """Test class""" def __init__(self, a=1, b=2): self.a = a self.b = b def add(self): return self.a + self.b @staticmethod def static_add(a, b): return 2 * a + 2 * b def add2(self): return self.static_a...
3.734375
4
gsheetsdb/types.py
tim-werner/gsheets-db-api
176
35160
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from enum import Enum class Type(Enum): STRING = 'string' NUMBER = 'number' BOOLEAN = 'boolean' DATE = 'date' DATETIME = 'datetime' TIMEOFDAY = ...
2.015625
2
copy_activities.py
atulbhingarde/PythonTwo
0
35161
import os from pathlib import Path from shutil import copyfile def stu_activities(rootDir): # set the rootDir where the search will start # that is in home dorectory #rootDir = "Downloads" # build rootDir from rootDir with the base as home "~" rootDir = os.path.join(Path.home(),rootDir) ...
2.84375
3
not_so_weird/oneoff/helper.py
psorus/anogen
0
35162
import matplotlib.pyplot as plt import numpy as np def plot(ac): ac=np.array(ac) ac=ac.reshape((28,28)) ac=[[int(ac2+0.48) for ac2 in ac1] for ac1 in ac] plt.imshow(ac) f=np.load("model.npz",allow_pickle=True) f2=np.load("model2.npz",allow_pickle=True) f3=np.load("model3.npz",allow_pickle=True) f4=np.load...
2.90625
3
workers/event_checker.py
D00Movenok/ctf-participation-bot
8
35163
import logging import threading import time from datetime import datetime, timedelta from sqlalchemy import column, func, select from sqlalchemy.orm import SessionTransaction from actions.discord import Discord from actions.telegram import Telegram from common.database import session from common.models import Event, ...
2.265625
2
zigpy_deconz_parser/commands/responses.py
zha-ng/zigpy-deconz-parser
2
35164
<reponame>zha-ng/zigpy-deconz-parser import attr import binascii import zigpy.types as t import zigpy_deconz.types as dt import zigpy_deconz_parser.types as pt @attr.s class Version(pt.Command): SCHEMA = (t.uint32_t, ) version = attr.ib(factory=SCHEMA[0]) def pretty_print(self, *args): self.prin...
2.25
2
run.py
evgsolntsev/labirinth_screensaver
1
35165
<filename>run.py #!/usr/bin/python3 import math import os import random import sys import time from operator import itemgetter import pygame from screeninfo import get_monitors from Xlib import display from level import Level DEBUG = "XSCREENSAVER_WINDOW" not in os.environ BLACK = (0, 0, 0) WHITE = (255, 255, 25...
2.828125
3
q_dic.py
1ahmedg/quote-script
0
35166
<gh_stars>0 # Quotes from: https://www.notion.so/Quotes-by-Naval-Ravikant-3edaf88cfc914b06a98b58b62b6dc222 dic = [\ "Read what you love until you love to read.",\ "True Wisdom Comes From Understanding, Not Memorization.",\ "Meditation is the art of doing nothing. You cannot do meditation. By definition, if you’r...
2.109375
2
back_end/database/update_db_helpers.py
PrincetonResInDe/course-selection
3
35167
<reponame>PrincetonResInDe/course-selection<filename>back_end/database/update_db_helpers.py import json from database_utils import DatabaseUtils from mobileapp import MobileApp from registrar import RegistrarAPI import logging logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s: %(message)s", d...
2.25
2
submission_config.py
ege-k/nlp4nethack
0
35168
<reponame>ege-k/nlp4nethack from agents.custom_agent import CustomAgent from agents.torchbeast_agent import TorchBeastAgent from envs.wrappers import addtimelimitwrapper_fn ################################################ # Import your own agent code # # Set Submision_Agent to your agent ...
1.90625
2
xmem/templates/registry.py
mHaisham/xmem
0
35169
<gh_stars>0 from typing import Union try: import winreg except ImportError: pass from ..template import BaseTemplate from ..exceptions import NotFoundError class RegistryTemplate(BaseTemplate): root = winreg.HKEY_CURRENT_USER def __init__(self, name='xmem'): """ :param name: name of...
2.359375
2
RSA/src/primeCheck3.py
BenGH28/Projects
0
35170
from math import sqrt, ceil def isPrime(x): """Primality test. Param x: int. Returns True if x is prime, False otherwise. """ if x <= 0: return False elif x == 2 or x == 3: return True else: for i in range(2, ceil(sqrt(x)) + 1): if x % i == 0: ...
4.1875
4
text_classifier/utils/analyze_data.py
felixdittrich92/Document_Scanner
0
35171
<gh_stars>0 """Script to analyze the Dataframes """ import pandas as pd import matplotlib.pyplot as plt german_df = pd.read_parquet('/home/felix/Desktop/Document_Scanner/text_classifier/data/german.parquet') english_df = pd.read_parquet('/home/felix/Desktop/Document_Scanner/text_classifier/data/english.parquet') germa...
3
3
timeflux_serial/nodes/driver.py
mesca/timeflux_serial
0
35172
<reponame>mesca/timeflux_serial import serial import time import numpy as np import pandas as pd from timeflux.core.exceptions import WorkerInterrupt from timeflux.helpers import clock from timeflux.core.node import Node class SerialDevice(Node): """A generic serial device driver. Attributes: o (Por...
2.4375
2
example/infer.py
johnson7788/OpenNRE
5
35173
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2021/3/15 10:40 上午 # @File : infer.py # @Author: johnson # @Contact : github: johnson7788 # @Desc : 推理模型 import opennre def infer_wiki80_cnn_softmax(): model = opennre.get_model('wiki80_cnn_softmax') result = model.infer({ ...
2.53125
3
acme_diags/container/e3sm_diags_container.py
zshaheen/e3sm_diags
0
35174
<gh_stars>0 #!/usr/bin/env python """ A standalone script that prepares a set of input to e3sm_diags to be ran as a container, and then runs e3sm_diags as a container. """ import os import sys import importlib import argparse import subprocess # Change these commands if needed. SHIFTER_COMMAND = 'shifter --volume=$REF...
2.75
3
johnhablecode.py
anthonyjclark/MeshroomCLI
0
35175
import sys, os import shutil def SilentMkdir(theDir): try: os.mkdir(theDir) except: pass return 0 def Run_00_CameraInit(baseDir, binDir, srcImageDir): # SilentMkdir(baseDir + "/00_CameraInit") binName = binDir + "\\aliceVision_cameraInit" # .exe" dstDir = baseDir + "/" # ...
2.4375
2
tests/test_cli.py
lucasace/browser-history
0
35176
<filename>tests/test_cli.py import csv import itertools import json import tempfile import re import pytest from browser_history.utils import get_browsers from browser_history.cli import cli, AVAILABLE_BROWSERS from .utils import ( # noqa: F401 become_linux, become_mac, become_windows, change_homedir...
2.34375
2
lab4FinalFLCD/venv/Lib/site-packages/domain/validate.py
raduceaca1234/Formal-Languages-and-Compiler-Design
0
35177
# -*- coding: utf-8 -*- def case_insensitive_string(string, available, default=None): if string is None: return default _available = [each.lower() for each in available] try: index = _available.index(f"{string}".lower()) except ValueError: raise ValueError(f"unrecognised in...
3.234375
3
plugin.video.220ro/default.py
keddyboys/keddy-repo
1
35178
<reponame>keddyboys/keddy-repo<gh_stars>1-10 import HTMLParser import os import re import sys import time import urllib import urllib2 import xbmc import xbmcaddon import xbmcgui import xbmcplugin __addon__ = xbmcaddon.Addon() __cwd__ = xbmc.translatePath(__addon__.getAddonInfo('path')).decode("utf-8") __resou...
2.265625
2
tickets/forms.py
connorgannaway/dockmate
0
35179
from django import forms from . import widgets from .models import Ticket, TicketItem #Creating html forms. # Each class interacts with a model. Fields for a form are chosen in 'fields' class TicketForm(forms.ModelForm): #setting timeDue to have specific formatting timeDue = forms.DateTimeField( input_...
2.515625
3
conftest.py
Budapest-Quantum-Computing-Group/piquassoboost
4
35180
<gh_stars>1-10 # # Copyright 2021 Budapest Quantum Computing Group # # 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...
1.78125
2
app/core/tests/test_models.py
Skyprince-gh/recipe-app-api
0
35181
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_with_emamil_successful(self): """Test creating a new user with an email is successful""" email = '<EMAIL>' password = '<PASSWORD>' user = get_user_model().objects.create_...
3.21875
3
nova/virt/libvirt/storage/dmcrypt.py
bopopescu/nova-token
0
35182
begin_unit comment|'# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory' nl|'\n' comment|'# All Rights Reserved' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with t...
1.226563
1
quiz/routing.py
zeroish/grey-matters
1
35183
from channels.staticfiles import StaticFilesConsumer from .consumers import ws_connect, ws_receive, ws_disconnect, new_contestant, start_quiz, submit_answer from channels import include, route # Although we could, there is no path matching on these routes; instead we rely # on the matching from the top-level routing. ...
2.28125
2
webapp/flow_summary_graphs.py
bfitzy2142/NET4901-SP
3
35184
<gh_stars>1-10 #!/usr/bin/env python3 """ MySql Parser for graphical presentation """ import mysql.connector import datetime from mysql.connector import Error from datetime import datetime, timedelta import json def pull_flow_graphs(node, time, sql_creds, db): """ Pulls the RX and TX information from the databas...
2.953125
3
cardinal_pythonlib/sphinxtools.py
bopopescu/pythonlib
0
35185
#!/usr/bin/env python # cardinal_pythonlib/sphinxtools.py """ =============================================================================== Original code copyright (C) 2009-2020 <NAME> (<EMAIL>). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (the "License"); ...
1.546875
2
monsterapi/migrations/0005_monster_name.py
merenor/momeback
1
35186
# Generated by Django 2.1.3 on 2018-11-08 21:12 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('monsterapi', '0004_name'), ] operations = [ migrations.AddField( model_name='monster', ...
1.6875
2
src/check_ids.py
lubianat/complex_bot
1
35187
import pandas as pd from wikidataintegrator import wdi_login import utils from login import WDPASS, WDUSER import argparse import sys parser = argparse.ArgumentParser() df = utils.get_complex_portal_species_ids() print(df.to_markdown())
2.1875
2
src/sentry/migrations/0028_user_reports.py
pierredup/sentry
0
35188
<reponame>pierredup/sentry # -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-01-23 19:07 from __future__ import unicode_literals import logging from django.db import migrations from sentry import eventstore from sentry.utils.query import RangeQuerySetWrapper from sentry.utils.snuba import ( SnubaErro...
1.882813
2
config.py
sixleaves/fisher
0
35189
<filename>config.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ @Time : 2019/5/5 12:39 AM @Author : sweetcs @Site : @File : config.py @Software: PyCharm """ DEBUG=True HOST="0.0.0.0" PORT=9292
1.351563
1
garbage/buidlInformation.py
mjasnikovs/horus
0
35190
import cv2 print(cv2.getBuildInformation())
1.421875
1
contrib/gitian-build.py
castarco/unit-e
36
35191
<reponame>castarco/unit-e<gh_stars>10-100 #!/usr/bin/env python3 # Copyright (c) 2018-2019 The Bitcoin Core developers # Copyright (c) 2019 The Unit-e developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://opensource.org/licenses/MIT. import argparse import os import su...
1.945313
2
src/commands/guild_list.py
HugeBrain16/ZenRPG
0
35192
<reponame>HugeBrain16/ZenRPG import discord from lib import utils async def _guild_list(page=1): try: page = int(page) - 1 except Exception: await _guild_list.message.channel.send( ":warning: use number to navigate between pages" ) return guilds = utils.get_gu...
2.625
3
redshift-dataapi/iac/app.py
InfrastructureHQ/AWS-CDK-Accelerators
0
35193
<reponame>InfrastructureHQ/AWS-CDK-Accelerators # # Copyright (c) 2021, SteelHead Industry Cloud, Inc. <<EMAIL>>. # All Rights Reserved. * # # # Import Core Modules # For consistency with other languages, `cdk` is the preferred import name for the CDK's core module. from aws_cdk import core as cdk ...
1.859375
2
chronosoft8puppeteer/gpio.py
mika1337/chronosoft8-puppeteer
0
35194
# ============================================================================= # System imports import logging import RPi.GPIO as RPiGPIO # ============================================================================= # Logger setup logger = logging.getLogger(__name__) # =============================================...
2.59375
3
eventos/admin.py
JohnVictor2017/StartTm
0
35195
<filename>eventos/admin.py from django.contrib import admin from .models import Evento, EventoCategoria, InscricaoSolicitacao # Register your models here. admin.site.register(Evento) admin.site.register(EventoCategoria) admin.site.register(InscricaoSolicitacao)
1.40625
1
indra/benchmarks/assembly_eval/batch4/rasmodel.py
pupster90/indra
2
35196
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from indra.statements import * from indra.preassembler.grounding_mapper import GroundingMapper, \ default_grounding_map def get_statements(): statements = [] ...
2.09375
2
gdal/swig/python/scripts/gcps2wld.py
Sokigo-GLS/gdal
0
35197
<reponame>Sokigo-GLS/gdal import sys # import osgeo.utils.gcps2wld as a convenience to use as a script from osgeo.utils.gcps2wld import * # noqa from osgeo.utils.gcps2wld import main from osgeo.gdal import deprecation_warn deprecation_warn('gcps2wld', 'utils') sys.exit(main(sys.argv))
1.3125
1
sort-characters-by-frequency/sort-characters-by-frequency.py
anomius/Leetcode-dump
0
35198
<reponame>anomius/Leetcode-dump class Solution: def frequencySort(self, s: str) -> str: return reduce(lambda a, b: a + b[1]*b[0], Counter(s).most_common(), '')
3.234375
3
api_tests/principal_claim_test.py
bhatti/saas_rbac
5
35199
import unittest import base_test import json class PrincipalClaimTest(base_test.BaseTest): def setUp(self): super(PrincipalClaimTest, self).setUp() self._org = self.post('/api/orgs', {"name":"claim_org", "url":"https://myorg.com"}) self._principal = self.post('/api/orgs/%s/principals' % sel...
2.40625
2