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
test/test.py
elna4os/mlflow_flask_artifacts_logger
1
12792551
<reponame>elna4os/mlflow_flask_artifacts_logger import unittest import requests from mlflow.exceptions import RestException from mlflow.tracking import MlflowClient class TestMLFlowArtifactsProxy(unittest.TestCase): def testLogArtifact(self): with open('artifacts/foo.txt', 'rb') as f1, open('artifacts/im...
2.359375
2
conftest.py
Chilipp/autodocsumm
45
12792552
<gh_stars>10-100 import os.path as osp import sys import pytest from sphinx.testing.path import path pytest_plugins = 'sphinx.testing.fixtures' sphinx_supp = osp.abspath(osp.join(osp.dirname(__file__), "tests")) @pytest.fixture(scope='session') def rootdir(): return path(sphinx_supp) sys.path.insert(0, osp...
1.59375
2
LNU_OS/main.py
JessyTsu1/DL_Backup
0
12792553
from process import * #结构体 from out import * #界面窗口 # from config import originate, target import time import os if __name__ == '__main__': run()
1.210938
1
plugins/newbie.py
PalashTanejaPro/cvbot
0
12792554
<filename>plugins/newbie.py import re from errbot import BotPlugin, re_botcmd class Newbie(BotPlugin): """ List the bot rules """ @re_botcmd(pattern=r'newbie', re_cmd_name_help='newbiw', flags=re.IGNORECASE, template='newbie.jinja2') def newb...
2.359375
2
wowspy/extras.py
MaT1g3R/Warships.py
4
12792555
from enum import Enum from typing import List, Union class Region(Enum): NA = 'com' EU = 'eu' RU = 'ru' AS = 'asia' def lst_of_int(id_, name): if id_ is None: return None if not isinstance(id_, int) and any(not isinstance(x, int) for x in id_): raise ValueError('{} must be an...
3.125
3
marbles.py
jepace/marbles
0
12792556
<gh_stars>0 # Marbles! # # An implementation of the classic marble board game that can be very # frustrating! # from random import randint #import tkinter # GLOBALS BOARDSIZE = 84 # Number of space around the main track CENTER=98 # "Location" of the center of death. BASE=99 # "Location" for base spots....
4.03125
4
The Grid Manager - Simple Calculator.py
DirkTayab/OOP-1-1
0
12792557
from tkinter import * window = Tk() window.title("Simple Calculator") window.geometry("400x300+20+10") window.grid_columnconfigure(0, weight=1) class MyWindow: def __init__(self, window): self.lbl1 = Label(window, text = "Simple Calculator") self.lbl1.grid(row = 0, columnspan = 5, pady...
3.71875
4
setup.py
Anuj-singla/TOPSIS_PYTHON_PACKAGE
2
12792558
from setuptools import setup def readme(): with open('README.md') as f: README = f.read() return README setup( name = 'TOPSIS_ANUJ_101803638', # How you named your package folder (MyLib) packages = ['TOPSIS_ANUJ_101803638'], # Chose the same as "name" version = '0.5', # Start with a...
1.859375
2
test/const.py
mikeshultz/py4byte
0
12792559
<reponame>mikeshultz/py4byte<filename>test/const.py # flake8: noqa SWAP_TRANSACTION = { 'blockHash': '0x3f43cba31e73252412c88d42f80b64e3c81ed99a1ef3743d14c891ed0ef54ab3', 'blockNumber': 11325697, 'from': '0x9283099A29556fCF8fFF5b2Cea2D4F67CB7A7A8b', 'gas': 203049, 'gasPrice': 69000000000, 'hash'...
1.796875
2
acq4/util/prioritylock.py
campagnola/acq4
47
12792560
<reponame>campagnola/acq4 from __future__ import print_function, division import weakref from threading import Lock, Thread, Event from six.moves import queue from .future import Future class PriorityLock(object): """Mutex with asynchronous locking and priority queueing. The purpose of this class is t...
3.203125
3
bin/print_busco_config.py
ewels/nf-core-neutronstar
4
12792561
#!/usr/bin/env python from __future__ import print_function import os print( """[busco] out_path = {0} tmp_path = {0}/tmp [tblastn] # path to tblastn path = /usr/bin/ [makeblastdb] # path to makeblastdb path = /usr/bin/ [augustus] # path to augustus path = /opt/augustus/bin/ [etraining] # path to augustus etraining...
1.695313
2
logs/models.py
Ishayahu/MJCC-tasks
1
12792562
# -*- coding:utf-8 -*- # coding=<utf8> from django.db import models # Модели для логирования действий пользователей с активами class Logging(models.Model): user = models.CharField(max_length=140) request = models.TextField(blank = True, null = True) goal = models.TextField(blank = True, null = True) d...
2
2
directory_components/forms/forms.py
MichaelWalker/directory-components
2
12792563
from directory_constants.choices import COUNTRY_CHOICES from django import forms from django.conf import settings from django.forms import Select from django.template.loader import render_to_string from django.utils import translation from directory_components.forms import fields from directory_components import help...
2.171875
2
Tools/ecl_ekf/batch_process_logdata_ekf.py
WeRobotics/Firmware
6
12792564
<filename>Tools/ecl_ekf/batch_process_logdata_ekf.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os, glob """ Runs process_logdata_ekf.py on the .ulg files in the supplied directory. ulog files are skipped from the analysis, if a corresponding .pdf file already exists (unless t...
2.734375
3
bm/apis/v1/APIsServices.py
kapousa/BrontoMind2
0
12792565
import json import numpy from bm.controllers.prediction.ModelController import predict_values_from_model from bm.db_helper.AttributesHelper import get_features, get_model_name, get_labels class NpEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, (numpy.int_, numpy.intc, numpy.intp, nu...
2.703125
3
manganelo/errors.py
nixonjoshua98/manganelo
22
12792566
class ManganeloError(BaseException): ... class NotFound(ManganeloError): ...
1.617188
2
prepare.py
NateLol/BAM_A_lightweight_but_efficient_Balanced_attention_mechanism_for_super_resolution
33
12792567
<gh_stars>10-100 import argparse import glob import h5py import numpy as np import PIL.Image as pil_image from torchvision.transforms import transforms def train(args): h5_file = h5py.File(args.output_path, 'w') lr_group = h5_file.create_group('lr') hr_group = h5_file.create_group('hr') image_list =...
2.390625
2
trackeddy/utils/field_generator.py
navidcy/trackeddy
36
12792568
import numpy as np import random as rnd import pdb def dist(loc1,loc2): return np.sqrt((loc1[0]-loc2[0])**2 + (loc2[1]-loc1[1])**2) #### BUG WHEN LEN(x) != LEN(y) class Generate_field(): def __init__(self,a,b,n,x,y,opt=''): self.xlen=len(x) self.ylen=len(y) self.a = a*rnd.uniform(...
3.015625
3
examples/scheduling.py
arnimarj/crochet
152
12792569
<filename>examples/scheduling.py #!/usr/bin/python """ An example of scheduling time-based events in the background. Download the latest EUR/USD exchange rate from Yahoo every 30 seconds in the background; the rendered Flask web page can use the latest value without having to do the request itself. Note this is examp...
3.15625
3
camera-opencv/01-color_space/crop.py
josemarin7/Python-OpenCV-Recognition-via-Camera
0
12792570
<reponame>josemarin7/Python-OpenCV-Recognition-via-Camera<gh_stars>0 import cv2 import numpy as np img = cv2.imread("lena256rgb.jpg") cv2.imshow("Normal", img) cv2.waitKey(0) face = img[95:195, 100:180] cv2.imshow("Face", face) cv2.waitKey(0) body = img[20:, 35:210] cv2.imshow("Body", body) cv2.waitKey(0) cv2.dest...
2.984375
3
utils/transforms/augmenter.py
meet-minimalist/Learn-pytorch-in-one-example
0
12792571
<reponame>meet-minimalist/Learn-pytorch-in-one-example<filename>utils/transforms/augmenter.py import imgaug.augmenters as iaa class Augmenter(object): def __init__(self): self.seq_aug = iaa.SomeOf((1, 2), [ iaa.OneOf([ #iaa.Dropout(p=(0.1, 0.2...
2.546875
3
mmdet/models/cls_heads/__init__.py
atoaiari/mmdetection
0
12792572
# Copyright (c) OpenMMLab. All rights reserved. from .cls_head import ClsHead from .linear_head import LinearClsHead from .orientation_head import OrientationHead from .resnet_orientation_head import ResNetOrientationHead __all__ = [ 'ClsHead', 'LinearClsHead', 'OrientationHead', 'ResNetOrientationHead' ]
0.988281
1
niddk_covid_sicr/data.py
nih-niddk-mbs/covid-sicr
4
12792573
"""Functions for getting data needed to fit the models.""" import bs4 from datetime import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import requests from tqdm import tqdm from typing import Union from urllib.error import HTTPError import urllib.request, json import os from datetim...
2.21875
2
jetson/od/objcet_detection.py
lonerlin/SelfDrivingCVCar
2
12792574
<gh_stars>1-10 import jetson.inference import jetson.utils from multiprocessing import Process, Pipe import time class ObjectDetection(Process): """ 物体识别进程类,实际的识别程序 """ def __init__(self, conn1, conn2, stop_process, width=320, height=240, frequency=10, device="/dev/video0", network="ssd-mobilenet-...
2.21875
2
data/hook_dataloader.py
jireh-father/InsightFace_Pytorch
0
12792575
import torch.multiprocessing as multiprocessing import threading from torch.utils.data import _utils import torch import random import sys from torch._six import queue import os from torch.utils.data._utils import collate, signal_handling, MP_STATUS_CHECK_INTERVAL, \ ExceptionWrapper, IS_WINDOWS if IS_WINDOWS: ...
2.046875
2
python/athena/communicator/mpi_nccl_comm.py
sj1104/Het
2
12792576
from ctypes import * from athena import ndarray from athena.stream import * import numpy as np from enum import Enum import os def _load_nccl_lib(): """Load libary in build/lib.""" curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__))) lib_path = os.path.join(curr_path, '../../../build/...
2.03125
2
game/migrations/0001_initial.py
m4tx/hackthespace
8
12792577
# Generated by Django 2.1.7 on 2019-03-27 13:01 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Player', fields=[ ...
1.835938
2
auth.py
Emberwalker/Arke
2
12792578
<reponame>Emberwalker/Arke from flask import Blueprint, render_template, abort, request, redirect, url_for from flask.ext.login import LoginManager, UserMixin, login_required, current_user, login_user, logout_user from werkzeug.security import generate_password_hash, check_password_hash from db import User, get_user, h...
2.484375
2
examples/steps/custom_extract_local.py
hillsdale18/ProjectX
3
12792579
""" ETL step wrapper for creating an S3 node for input from local files """ from dataduct.steps import ExtractLocalStep import logging logger = logging.getLogger(__name__) class CustomExtractLocalStep(ExtractLocalStep): """CustomExtractLocal Step class that helps get data from a local file """ def __init...
2.171875
2
paclair/docker/docker_image.py
jpthiery/paclair
0
12792580
<gh_stars>0 # -*- coding: utf-8 -*- """ Docker_image module """ import hashlib from paclair.logged_object import LoggedObject class DockerImage(LoggedObject): """ A Docker Image """ def __init__(self, name, registry, repository="", tag='latest'): """ Constructor :param name...
2.3125
2
hyperadmin/clients/common.py
zbyte64/django-hyperadmin
25
12792581
<reponame>zbyte64/django-hyperadmin<filename>hyperadmin/clients/common.py try: from django.conf.urls import patterns, url except ImportError: from django.conf.urls.defaults import patterns, url from django.views.generic import TemplateView from django.core.urlresolvers import reverse from hyperadmin.apirequest...
2.015625
2
qodex/ui/new_shelf.py
grapesmoker/qodex
0
12792582
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'new_shelf.ui' ## ## Created by: Qt User Interface Compiler version 6.1.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #################...
2.046875
2
crusher/utils.py
JudahRockLuberto/crusher
2
12792583
#!/usr/bin/env python # -*- coding: utf-8 -*- """Useful tools.""" import os import glob import pickle from astropy.io import fits __all__ = [ 'read_from_pickle', 'save_to_pickle', 'save_to_fits', 'linux_or_mac', 'clean_after_ellipse', ] def read_from_pickle(name): """Read the data from Pick...
2.625
3
update-attempt-ids.py
inducer/courseflow
284
12792584
<filename>update-attempt-ids.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import django django.setup() from course.models import GradeChange for gchange in GradeChange.objects.all(): if gchange.flow_session is not None: gchange.attempt_id = "flow-session-%d" % gchange.flow_session....
1.929688
2
ibdp_classes/__main__.py
ram6ler/ibdp_classes
0
12792585
import sys from .ibdp_classes import Pseudocode def run(): def help(): print( """ To use: python -m ibdp_classes [options] filename Options: -md Output markdown. -py Output intermediate Python code. """ ) exit(0) if len(sys.argv) < 2: help() md = "...
3.328125
3
floor.py
devcusn/civil-engineering
0
12792586
<filename>floor.py """ cordinate = [ [1,2,1,2,1], [2,0,2,0,2], [1,2,1,2,1] ] before use this class,you must to create column and beam by using column and beam class """ class floor(): def __init__(self,column,columnNumber,beam,beamNumber,cordinate): self.columnNumber = columnNumber self....
3.53125
4
webGrover.py
meghu2791/evaluate_neuralFakenewsDetectors
1
12792587
news = "Online disinformation, or fake news intended to deceive, has emerged as a major societal problem. Currently, fake news articles are written by humans, but recently-introduced AI technology based on Neural Networks might enable adversaries to generate fake news. Our goal is to reliably detect this “neural fake n...
3.046875
3
config/urls.py
shirishgoyal/scholars
0
12792588
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from rest_framework.routers import SimpleRouter from django.views import defaults ...
1.789063
2
PythonExample/tmp/12_spider.py
RobinTang/machine-learning
1
12792589
<reponame>RobinTang/machine-learning<gh_stars>1-10 # -*- coding: utf-8 -*- # Filename: my_crawl.py # Function: 租房小爬虫 # Author:<EMAIL> # 微博:OceanBase晓楚 # 微信:hustos from bs4 import BeautifulSoup import re import sys import urllib import time import random import time reload(sys) sys.setdefaultencoding("GBK") # 支持爬不同版面...
2.953125
3
explore/viz/kde.py
idc9/explore
0
12792590
import numpy as np import warnings from scipy import stats from six import string_types import matplotlib.pyplot as plt from scipy.integrate import trapz from explore.utils import Proportions try: import statsmodels.nonparametric.api as smnp _has_statsmodels = True except ImportError: _has_statsmodels = ...
2.390625
2
basics/np_vs_torch_comparison.py
s-mostafa-a/a
5
12792591
<reponame>s-mostafa-a/a import numpy as np import torch import time t1 = time.time() for i in range(1000000): x_tensor = torch.empty(5, 3) t2 = time.time() for i in range(1000000): x_ndarr = np.empty((5, 3)) t3 = time.time() print('making empty array comparison:') delta1 = t2 - t1 delta2 = t3 - t1 print(f'torc...
2.4375
2
python/day14/extended_polymerization.py
aesdeef/advent-of-code-2021
2
12792592
from collections import Counter INPUT_FILE = "../../input/14.txt" Ruleset = dict[str, str] def parse_input() -> tuple[str, Ruleset]: """ Parses the input and returns the polymer template and the pair insertion rules """ with open(INPUT_FILE) as f: template, _, *rules = f.read().splitlines() ...
3.828125
4
backend/auth/security.py
restato/bunnybook
131
12792593
from typing import Optional, Dict import jwt import sentry_sdk from fastapi import HTTPException from starlette import status from starlette.requests import Request from auth.models import Role from auth.models import User from config import cfg def get_user(request: Request) -> User: """ Protect route from...
2.28125
2
built-in/ACL_TensorFlow/Official/cv/SSD_Resnet50_FPN_for_ACL/scripts/image_to_imgConf.py
Ascend/modelzoo
12
12792594
<gh_stars>10-100 # Copyright 2021 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/LICENSE-2.0 # # Unless required by applic...
2.265625
2
src/commands/get_ast.py
PranjalPansuriya/JavaScriptEnhancements
690
12792595
import sublime, sublime_plugin import os from ..libs import util from ..libs import NodeJS from ..libs import javaScriptEnhancements from ..libs.global_vars import * class JavascriptEnhancementsGetAstCommand(sublime_plugin.TextCommand): def run(self, edit, **args): view = self.view flow_cli = "flow" is_...
2.0625
2
setup.py
NTBEL/diffusion-fit
0
12792596
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="diffusionfit", version="0.7.0", python_requires=">=3.9", install_requires=[ "numpy", "scipy", "scikit-image", "matplotlib", "seaborn", "pandas",...
1.546875
2
cmepy/lazy_dict.py
hegland/cmepy
6
12792597
""" Dictionary with lazy evaluation on access, via a supplied update function """ import itertools class LazyDict(dict): """ A dictionary type that lazily updates values when they are accessed. All the usual dictionary methods work as expected, with automatic lazy updates occuring behind the scen...
4.28125
4
pyvisdk/enums/entity_reference_entity_type.py
Infinidat/pyvisdk
0
12792598
######################################## # Automatically generated, do not edit. ######################################## from pyvisdk.thirdparty import Enum EntityReferenceEntityType = Enum( 'cluster', 'datacenter', 'datastore', 'host', 'nasMount', 'resourcePool', 'scsiAdapter', 'sc...
1.507813
2
AutoLookdev_Rman_v01_0/RenderMan_AutoLookDev.py
mteillet/AutoLookDev_Rman
0
12792599
<filename>AutoLookdev_Rman_v01_0/RenderMan_AutoLookDev.py<gh_stars>0 import maya.cmds as cmds import os from shutil import copyfile from functools import partial #### Copyright 2019 DUBOIX <NAME> and <NAME> - Licensed under the Apache License, Version 2.0 (the "License"); #### you may not use this file except i...
2.34375
2
pysirix/__init__.py
sirixdb/sirix-python-client
7
12792600
<reponame>sirixdb/sirix-python-client import httpx from pysirix.sirix import Sirix from pysirix.database import Database from pysirix.resource import Resource from pysirix.json_store import JsonStoreSync, JsonStoreAsync from pysirix.constants import Insert, DBType, TimeAxisShift from pysirix.errors import SirixServerE...
2.609375
3
app/utility/answer_forms.py
syth0le/tg_reminder_bot
0
12792601
<gh_stars>0 from typing import Union, Optional from app.utility.schemas import TemporaryReminder, PermanentReminder, Bookmark from app.utility.stickers import stickers_recognize def answer_forms(answer: Optional[Union[TemporaryReminder, PermanentReminder, Bookmark]] = None, adding: Optional[bool] = ...
2.453125
2
src/Bicho.py
victorlujan/Dise-odeSoftwarePatrones
0
12792602
class Bicho: def __init__(self): self.vida=0 self.modo = None self.ataque = 10 self.posicion = None def hablar(self): self.modo.hablar() def dormir(self): self.modo.dormir() def atacar(self): self.modo.atacar() def esPerezoso(self): ...
3.03125
3
scripts/ao3_work_ids.py
lyubadimitrova/ffpopularity
0
12792603
<filename>scripts/ao3_work_ids.py<gh_stars>0 # Retrieve fic ids from an AO3 search # Will return in searched order # Saves ids to a csv for later use e.g. to retrieve fic text # Options: # Only retrieve multichapter fics # Modify search to include a list of tags # (e.g. you want all fics tagged either "romance" o...
2.796875
3
NewGame/room.py
LivOriona/EscapeBoat-le-secret-du-Python-perdu
0
12792604
from exit import Exit class Room: #objet room def __init__(self, id, name, description): #rappel : self est mon objet qui suit le plan Room self.id = id self.name = name self.description = description self.pickables = {} #les objets ramassables (pickables) sont actuellement un dicti...
3.203125
3
region.py
Chandramouli-Das/Lending-Club-Case-Study
0
12792605
def finding_regions(state): north_east = ['CT', 'NY', 'PA', 'NJ', 'RI','MA', 'MD', 'VT', 'NH', 'ME'] south_west = ['AZ', 'TX', 'NM', 'OK'] south_east = ['GA', 'NC', 'VA', 'FL', 'KY', 'SC', 'LA', 'AL', 'WV', 'DC', 'AR', 'DE', 'MS', 'TN' ] west = ['CA', 'OR', 'UT','WA', 'CO', 'NV', 'AK', 'MT', 'HI', '...
3.234375
3
UsefulTools/Classify/scripts/vis.py
CharlesPikachu/CharlesFace
13
12792606
<filename>UsefulTools/Classify/scripts/vis.py<gh_stars>10-100 # Draw network structure from graphviz import Digraph import torch from torch.autograd import Variable from torchviz import make_dot from nets.ResNets import ResNet model = ResNet(resnet='resnet18', num_classes=10575, embeddings_num=128, img_size=224, is_f...
2.40625
2
doodle/views/admin/user.py
keakon/Doodle
38
12792607
<reponame>keakon/Doodle<gh_stars>10-100 # -*- coding: utf-8 -*- from tornado.web import HTTPError from doodle.core.models.comment import Comment from doodle.core.models.user import User from ..base_handler import AdminHandler class BanUserHandler(AdminHandler): def post(self, comment_id): comment = Com...
2.3125
2
uttut/toolkits/tests/test_partition_by_entities.py
Yoctol/uttut
2
12792608
from unittest import TestCase from uttut.elements import Datum, Entity, Intent from ..partition_by_entities import partition_by_entities class PartitionByEntitiesTestCase(TestCase): def setUp(self): self.utterance = '我想訂明天從紐約飛到新加坡的機票' self.entities = [ Entity(label=0, value='明天', sta...
2.78125
3
lib/sunrise_sunset.py
leepenney/ha-pen
0
12792609
<filename>lib/sunrise_sunset.py #from astral import Astral import astral, pytz, os, sys, json import datetime, time from time import mktime from datetime import timedelta def sunset_for_today(): today = datetime.datetime.now() offset = int((mktime(time.localtime())-mktime(time.gmtime()))/60/60) long_lat = ...
2.953125
3
exopy/measurement/monitors/api.py
jerjohste/exopy
16
12792610
<filename>exopy/measurement/monitors/api.py # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distr...
1.578125
2
ProposalDistribution.py
GrzegorzMika/Markov-Chains-Monte-Carlo
0
12792611
from abc import ABCMeta, abstractmethod import numpy as np class ProposalDistribution(metaclass=ABCMeta): @abstractmethod def __init__(self): ... @abstractmethod def sample(self, x: np.ndarray) -> np.ndarray: ... @abstractmethod def pdf(self, x: np.ndarray, cond: np.ndarray)...
3.203125
3
annie_pieces_2.20/plotting_utilities.py
annierak/odor_tracking_sim
0
12792612
def rect(x,y,w,h,c,ax): polygon = plt.Rectangle((x,y),w,h,color=c) ax.add_patch(polygon) def dist_fill(X,Y, cmap,ax): plt.plot(X,Y,lw=0) dx = X[1]-X[0] N = float(X.size) for n, (x,y) in enumerate(zip(X,Y)): color = cmap[n,:] rect(x,0,dx,y,color,ax) ...
3.234375
3
tests/test_topbottominjector.py
minddistrict/fanstatic
6
12792613
<reponame>minddistrict/fanstatic<gh_stars>1-10 import pytest from fanstatic import Library, Resource, init_needed, ConfigurationError from fanstatic.injector import TopBottomInjector def test_bundle_resources_bottomsafe(): foo = Library('foo', '') a = Resource(foo, 'a.css') b = Resource(foo, 'b.css', bo...
2.21875
2
enzian_descriptions.py
Sockeye-Project/decl-power-seq
0
12792614
<gh_stars>0 from sequence_generation import Node, Input, Output, Constraint, Wire, PowerState, Stateful_Node, intersect, State_Space_Error, unite_dict, state_union, SET, empty_intersection import math from functools import partial import z3 class INA226(Node): BUS = Input([{0, 1}], "bus") VS = Input([(0, 6000)...
2.453125
2
textrank4zh/TextRank4Sentence.py
Mumuerr/textrank_test
2
12792615
<reponame>Mumuerr/textrank_test #-*- encoding:utf-8 -*- ''' Created on Dec 1, 2014 @author: letian ''' import networkx as nx from Segmentation import Segmentation import numpy as np import math class TextRank4Sentence(object): def __init__(self, stop_words_file = None, delimiters='?!;?!。;…\n'): ''' ...
2.65625
3
systemcheck/systems/ABAP/models/action_abap_validate_redundant_password_hashes_model.py
team-fasel/SystemCheck
2
12792616
<filename>systemcheck/systems/ABAP/models/action_abap_validate_redundant_password_hashes_model.py from systemcheck.systems.ABAP.models import AbapSpoolParams_BAPIPRIPAR_Mixin, ActionAbapIsNotClientSpecificMixin from systemcheck import models from systemcheck.models.meta import generic_repr from systemcheck.checks.model...
1.96875
2
ComRISB/pyglib/pyglib/estructure/misc/fermi.py
comscope/comsuite
18
12792617
from __future__ import print_function import numpy as np try: from builtins import range, zip except: pass def fermi_dirac(e_fermi, delta, energy): """ Return fermi-dirac distribution weight. """ x = (energy - e_fermi)/delta if x < -200: f = 1. elif x > 200: f = 0. ...
2.8125
3
test/legacy/test_responses.py
mitsuhiko/nameko
3
12792618
from mock import Mock from nameko.legacy import responses def test_iter_rpcresponses(): response_list = [ Mock(payload={'id': 1, 'failure': False, 'ending': False}), Mock(payload={'id': 2, 'failure': False, 'ending': False}), Mock(payload={'id': 3, 'failure': False, 'ending': True}), ...
2.671875
3
functions/load_nag.py
daviddoret/pyxag
1
12792619
from . import * def load_nag(nag, path): """Load a NAG from a file""" with open(path, 'r') as nag_file: nag_json = nag_file.read() nag = convert_json_to_nag(nag_json) return nag
3.21875
3
app/notebook/views/notebook.py
Lontras-e-Preguicas/cnotes-server
1
12792620
<filename>app/notebook/views/notebook.py<gh_stars>1-10 from drf_yasg.openapi import Parameter from drf_yasg.utils import swagger_auto_schema from rest_framework import authentication, permissions, viewsets, mixins from rest_framework.decorators import action from rest_framework.response import Response from core.model...
1.9375
2
cogv3/moderation/Kick.py
XFazze/discordbot
2
12792621
import discord from ..admin.managecommands import perms import json from discord.utils import get from pymongo import MongoClient, collation from discord.ext import commands, tasks import time import os import pymongo as pm import asyncio import random import datetime import copy class Kick(commands.Cog): def __i...
2.5
2
getting_started/hash.py
AoEiuV020/LearningPython
0
12792622
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 反直觉,is 和 hash 没什么关系, """ assert hash(1.00 + 0.01) == hash(1.01) assert id(1.00 + 0.01) != id(1.01) assert 1.00 + 0.01 == 1.01 assert not 1.00 + 0.01 is 1.01 assert type(hash('s')) == int
3.046875
3
src/adobe/pdfservices/operation/internal/api/dto/request/platform/cpf_content_analyzer_req.py
hvntravel/pdfservices-python-sdk
2
12792623
<filename>src/adobe/pdfservices/operation/internal/api/dto/request/platform/cpf_content_analyzer_req.py # Copyright 2021 Adobe. All rights reserved. # This file is licensed to you 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 c...
2.140625
2
tests/test-cases/basic/ssa_case-5.py
SMAT-Lab/Scalpel
102
12792624
# Imports import os import random from collections import Counter, defaultdict import random from nltk.tag import StanfordNERTagger from nltk.tokenize import word_tokenize from nltk import pos_tag from nltk.chunk import conlltags2tree from nltk.tree import Tree import pandas as pd from htrc_features import FeatureReade...
2.4375
2
virtcam/webcam.py
badmonkey/virtual-camera
0
12792625
import cv2 import virtcam.debug as debug from virtcam.base import Frame, FrameSource, Image, Mask, StreamConfig, immutable class Webcam(FrameSource): def __init__(self): super().__init__() self.current_id = -1 self.camera = cv2.VideoCapture("/dev/video0", cv2.CAP_V4L2) c1, c2, c3...
2.421875
2
Toolkits/VCS/repology__repology-api/repology/packageproc.py
roscopecoltran/SniperKit-Core
0
12792626
<filename>Toolkits/VCS/repology__repology-api/repology/packageproc.py # Copyright (C) 2016-2017 <NAME> <<EMAIL>> # # This file is part of repology # # repology is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, e...
1.671875
2
test/afunc.py
jamesljlster/cnn
1
12792627
import numpy as np import math def softmax(src): # Get size of input vector rows, cols = src.shape # Checking if rows > 1: raise Exception("Input rows > 1") # Find softmax expVec = np.exp(src) return expVec / np.sum(expVec) def softmax_derivative(src): # Get size of input vec...
3.265625
3
implementation-contributed/v8/wasm-js/testcfg.py
katemihalikova/test262
1,849
12792628
<reponame>katemihalikova/test262<gh_stars>1000+ # Copyright 2018 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import re from testrunner.local import testsuite from testrunner.objects import testcase ANY_JS...
2.015625
2
test/test_multi_args.py
Planet-AI-GmbH/paiargparse
3
12792629
<filename>test/test_multi_args.py import unittest from paiargparse import PAIArgumentParser, RequiredArgumentError from test.dataclasse_setup import Level1b, Level2, Level1, Level2a class TestPAIParser(unittest.TestCase): def test_three_dc(self): parser = PAIArgumentParser() parser.add_root_argum...
3.09375
3
fdm-devito-notebooks/C_softeng2/src-softeng2/wave1D_oo.py
devitocodes/devito_book
7
12792630
# -*- coding: utf-8 -*- """ Class implementation for solving of the wave equation u_tt = (c**2*u_x)_x + f(x,t) with t in [0,T] and x in (0,L). We have u=U_0 or du/dn=0 on x=0, and u=u_L or du/dn=0 on x = L. For simplicity, we use a constant c here and compare with a known exact solution. """ import time, gl...
3.453125
3
python/readFetiData.py
ostravaTokyo/hfls
0
12792631
import numpy as np from scipy import sparse import scipy.sparse.linalg as spla import pylab as plt from scipy.linalg import block_diag # # nSub = 2 def load_matrix_basic(pathToFile,makeSparse,makeSymmetric, offset): f0 = open(pathToFile).readlines() firstLine = f0.pop(0) #removes the first line tmp = np.z...
2.625
3
grackle/cooling_cell_plot.py
diamondjems016/galaxy_analysis
1
12792632
from galaxy_analysis.plot.plot_styles import * import matplotlib.pyplot as plt import os, sys import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable def bins_from_centers(x): xnew = np.zeros(len(x) + 1) dx = np.zeros(len(x) + 1) dx[1:-1] = x[1:] - x[:-1] dx[0] = dx[1] dx[-1]...
2.34375
2
pybamm/models/submodels/thermal/x_lumped/__init__.py
jedgedrudd/PyBaMM
1
12792633
<gh_stars>1-10 from .base_x_lumped import BaseModel from .x_lumped_no_current_collectors import NoCurrentCollector from .x_lumped_0D_current_collectors import CurrentCollector0D from .x_lumped_1D_current_collectors import CurrentCollector1D from .x_lumped_2D_current_collectors import CurrentCollector2D
1.023438
1
dickserv/modules/weather.py
acidvegas/dickserv
14
12792634
#!/usr/bin/env python # DickServ IRC Bot - Developed by acidvegas in Python (https://acid.vegas/dickserv) # weather.py import httplib import config def lookup(zip_code): api = httplib.get_json('http://api.wunderground.com/api/{0}/conditions/q/{1}.json'.format(config.api.wunderground_api_key, zip_code)) if 'error' ...
2.6875
3
part-3/1-dictionaries/exercise-3.py
boconlonton/python-deep-dive
0
12792635
""" - You have text data spread across multiple servers. Each server is able to analyze this data and return a dictionary that contains words and their frequency. - Your job is to combine this data to create a single dictionary that contains all the words and their combined frequencies from all these data sources - Bon...
3.953125
4
codebuild/create-projects.py
jtojnar/aws-crt-cpp
53
12792636
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. import argparse import boto3 # Parse required options parser = argparse.ArgumentParser(description='Creates all required AWS CodeBuild projects for a repo') parser.add_argument('project', type=str, help='The na...
2.375
2
gen_models/train_attentive_vae.py
yifan-you-37/rl_swiss
56
12792637
# Imports --------------------------------------------------------------------- # Python import argparse import joblib import yaml import os.path as osp from collections import defaultdict import joblib import os # PyTorch import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Va...
1.90625
2
minder_utils/util/decorators/file_func.py
alexcapstick/minder_utils
0
12792638
<filename>minder_utils/util/decorators/file_func.py from functools import wraps from minder_utils.util.util import save_mkdir, save_file, load_file from minder_utils.util.util import reformat_path class load_save: def __init__(self, save_path, save_name=None, verbose=True, refresh=False): self.save_path =...
2.5
2
causal_dcgan/models.py
karhankaan/CausalGAN
0
12792639
<gh_stars>0 import tensorflow as tf import numpy as np slim = tf.contrib.slim import math from causal_dcgan.ops import lrelu,linear,conv_cond_concat,batch_norm,add_minibatch_features from causal_dcgan.ops import conv2d,deconv2d def conv_out_size_same(size, stride): return int(math.ceil(float(size) / float(stride)...
2.046875
2
IBMi-lib-repo.py
barrettotte/IBMi-Lib-Repo
4
12792640
import sys, os, traceback from os import path import utils as utils from IBMi import IBMi CONFIG_PATH="./config.json" def get_configuration(name): for cfg in utils.read_file_json(CONFIG_PATH): if cfg["name"] == name: return cfg return None def append_configuration(new_data): if not path.exists(CO...
2.484375
2
src/squirrel/orders/widgets.py
c3loc/squirrel
1
12792641
""" This is extracted from the unmaintained https://github.com/jazzband/django-floppyforms to provide a datalist widget. It has not been cleaned up yet. """ from django import forms from django.template import Context, loader from django.utils import formats from django.utils.encoding import force_text class DictCon...
2.421875
2
site_creator/network.py
danielbostock/meraki_site_creator
0
12792642
<gh_stars>0 # Start Import Area import meraki, os # End Import Area class orgNetwork: def __init__(self, site_name, serials): self.site_name = site_name self.organization_id = '' #self.timeZone = 'Australia/Brisbane' #Optional - If not assigned Meraki will do their default which is LA time....
2.34375
2
xpath_utils/models/xpath_condition_contains.py
kkristof200/py_xpath_utils
0
12792643
<gh_stars>0 # ------------------------------------------------------ Imports ----------------------------------------------------- # # System from typing import Optional # Local from .xpath_condition import XPathCondition from .enums import XPathConditionType # -------------------------------------------------------...
2.15625
2
backend/tradingbot/migrations/0003_auto_20220108_1759.py
webclinic017/WallStreetBots
4
12792644
<gh_stars>1-10 # Generated by Django 3.2.8 on 2022-01-08 22:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tradingbot', '0002_alter_stockinstance_user'), ] operations = [ migrations.RemoveField( model_name='order', ...
1.75
2
w1data/commands.py
swork/w1-datalogger
0
12792645
<reponame>swork/w1-datalogger #! /usr/bin/env python import argparse, configparser, sys, os from . import common, metadata, observations, rollup, w1datapoint import logging logger = logging.getLogger(__name__) debug_done = False class LocalArgumentParser(argparse.ArgumentParser): def __init__(self, *args, **kwa...
2.09375
2
scripts/test_create_dataloaders.py
qlero/charcoal_recognition
0
12792646
<gh_stars>0 """ Tests the instantiation of PyTorch dataloaders over the cleaned images from the Laboratório Visão Robótica e Imagem charcoal dataset """ # Imports library import os, sys # used to declare ../charcoal as a folder that can be imported currentdir = os.path.dirname(os.path.realpath(__file__)) parentdir ...
2.171875
2
dcbase/tests/unit/__init__.py
tctimmeh/dc-django-base
0
12792647
from dcbase.tests.unit.unitTestCase import UnitTestCase
1.09375
1
password_security/models/__init__.py
juazisco/gestion_rifa
0
12792648
# Copyright 2015 LasLabs Inc. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from . import res_users # noqa from . import res_company # noqa from . import res_users_pass_history # noqa from . import res_config_settings # noqa
0.9375
1
sdk/ml/azure-ai-ml/azure/ai/ml/_schema/compute/aml_compute_node_info.py
dubiety/azure-sdk-for-python
1
12792649
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from marshmallow import fields from azure.ai.ml._schema.core.schema_meta import PatchedSchemaMeta class AmlComputeNodeInfoSchema(metaclass...
1.601563
2
gym-maze/gym_maze/__init__.py
martinzimmermann/RBL-test-programs
0
12792650
<gh_stars>0 from gym.envs.registration import register register( id='maze-v0', entry_point='gym_maze.envs:MazeEnvSample5x5', max_episode_steps=2000, ) register( id='maze-sample-5x5-v0', entry_point='gym_maze.envs:MazeEnvSample5x5', max_episode_steps=10000000000000, ) register( id='maze-e...
1.445313
1