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
qa327_test/integration/test_integration.py
15vrs/cmpe-327
0
12772651
import pytest from seleniumbase import BaseCase from qa327_test.conftest import base_url from qa327.models import db, User, Ticket import qa327.backend as bn # integration testing: the test case interacts with the # browser, and test the whole system (frontend+backend). test_user = User( email='<EMAIL>', na...
2.484375
2
server/settings.py
AppCraftTeam/appcraft-logs
0
12772652
import os from datetime import timedelta from pathlib import Path from dotenv import load_dotenv BASE_DIR = Path(__file__).resolve().parent.parent load_dotenv(dotenv_path=BASE_DIR / '.env') SECRET_KEY = os.getenv('SECRET_KEY') DEBUG = True if os.getenv('DEBUG') in ['true', 'True', True] else False INSTALLED_APPS ...
1.742188
2
stagesetting/drf.py
kezabelle/django-stagesetting
5
12772653
<reponame>kezabelle/django-stagesetting<filename>stagesetting/drf.py<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from __future__ import division from rest_framework.fields import Field, DictField from rest_fra...
1.90625
2
users/admin.py
vladcalin/konnector
0
12772654
<reponame>vladcalin/konnector from django.contrib import admin from users.models import User # Register your models here. admin.site.register(User)
1.304688
1
FLIRCam/USB_camera.py
johnnewto/FLIRCam
0
12772655
# AUTOGENERATED! DO NOT EDIT! File to edit: dev/52_USB_camera.ipynb (unless otherwise specified). __all__ = ['Camera'] # Cell from FLIRCam.core import * # Cell # Standard imports: from pathlib import Path import logging from logging.handlers import RotatingFileHandler from time import sleep, time as timestamp from ...
2.4375
2
humbledb/errors.py
laiyonghao/humbledb
26
12772656
<reponame>laiyonghao/humbledb """ """ class NoConnection(RuntimeError): """ Raised when a connection is needed. """ class NestedConnection(RuntimeError): """ Raised when trying to nest the same connection within itself. """ class MissingConfig(RuntimeError): """ Raised when configuartion is not configur...
2.65625
3
src/birder/core/queue.py
os4d/birder
0
12772657
# :copyright: Copyright (c) 2018-2020. OS4D Ltd - All Rights Reserved # :license: Commercial # Unauthorized copying of this file, via any medium is strictly prohibited # Written by <NAME> <<EMAIL>>, October 2020 from birder.core.redis import client channel = client.pubsub() channel.subscribe('system') send = lamb...
1.585938
2
old/onsets.py
shlomo-Kallner/coventreiya
0
12772658
<filename>old/onsets.py __name__ = 'onsets' __version__ = '1.5.1' __package__ = 'phonotactics' # imports #some import machinery checking and manipulations... import sys import os from os import path __mod_path = path.dirname(__file__) if __mod_path not in sys.path: sys.path.append(__mod_path) ...
2.40625
2
webapp/conf/__init__.py
buppter/EMS
2
12772659
""" author: buppter datetime: 2020/1/16 9:57 下午 """
1.46875
1
Day 3/setup.py
SSSCodingClub/Jumper
0
12772660
<gh_stars>0 import pygame pygame.init() SCREEN_WIDTH, SCREEN_HEIGHT = 640, 640
1.515625
2
app/support/admin.py
gab98fra/curriculo.page-project
1
12772661
from django.contrib import admin from .models import FAQModel, AssistanceModel, FeedbackModel admin.site.register(FAQModel) admin.site.register(AssistanceModel) admin.site.register(FeedbackModel)
1.21875
1
rstblog/modules/__init__.py
mitsuhiko/rstblog
44
12772662
# -*- coding: utf-8 -*- """ rstblog.modules ~~~~~~~~~~~~~~~ The module interface. :copyright: (c) 2010 by <NAME>. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import def add_module_path(folder): """Adds a new search path to the list of search paths.""" ...
1.539063
2
azure/download_from_blob_legacy.py
michhar/my-azure-and-ml-utils
12
12772663
<gh_stars>10-100 """ Download data from blob storage with legacy package version (tested with legacy Python Azure Blob SDK v2.1) Overwrites any existing folder from this container on local system. Make sure to set the environment variables before running: STORAGE_ACCOUNT_NAME STORAGE_ACCOUNT_KEY Based upon: https://...
2.734375
3
training/dataframe.py
etienne912/FragmentClassifier
0
12772664
import os import sys import cv2 import numpy as np import pandas as pd import os import matplotlib.image as mpimg def file_to_fragment(path, return_path): path = path file_path = [] file_class = [] for subdirectory in os.walk(path): for file in subdirectory[2]: file_path.append(os.path.join(subdirectory[0],...
2.734375
3
create_model.py
jjac111/Stock-Trend-Predictor
0
12772665
<reponame>jjac111/Stock-Trend-Predictor from keras.optimizers import Adam from keras.callbacks import ModelCheckpoint, Callback from keras.models import Model from keras.layers import Dense, Input, Dropout, Activation input_dim = 11 d1 = 2*input_dim d2 = round(input_dim/2) d3 = 1 activation = 'sigmoid' dropout = 0.4 e...
2.515625
3
mysite/mysite/context_processors.py
lirixiang123/question_repo
0
12772666
<gh_stars>0 from . import settings def site_info(request): #站点信息 site = {} # site["SITE_URL"] = settings.SITE_URL site["SITE_NAME"] = settings.SITE_NAME site["SITE_DESC"] = settings.SITE_DESC site["KEYWORDS"]=settings.SITE_KEYWORDS # site["PRO_GIT"] = settings.PRO_GIT # site["PRO_RSS"] ...
1.90625
2
livelayermanager/models.py
parksandwildlife/borgcollector
2
12772667
<gh_stars>1-10 from __future__ import unicode_literals import re import json import logging import shutil import os import hglib from datetime import datetime import requests from django.conf import settings from django.db import models from django.contrib.postgres.fields import HStoreField from django.utils import ti...
1.5625
2
ies/iesutils.py
nickmcdonald/CNDL
0
12772668
<reponame>nickmcdonald/CNDL ######################################################## # # Copyright (C) 2020-2021 <NAME> <<EMAIL>> # # This file is part of CNDL. # # CNDL can not be copied and/or distributed without the express # # permission of <NAME> ######################################################## from enum...
2.59375
3
kolab/kotonoha/__init__.py
roy029/kolab
0
12772669
<reponame>roy029/kolab from kolab.kotonoha.kotonoha import Kotonoha
0.941406
1
roulette.py
CtrlAltDel668/kuroshiro101
0
12772670
import random import threading class RR() : def __init__(self,v): self.v = v def kapoy (self): print('Russian Roulette is starting!!') if self.v == 0 : def random1(): print('Randomizing your punishment...') timer = threading.Timer(1.0, random1) timer.start() def random2(): pr...
3.5625
4
Chapter_4/12.py
sai29/Python-John-Zelle-book
14
12772671
<filename>Chapter_4/12.py def main(): print "This program illustrates a chaotic function" x = input("Enter a number between 0 and 1: ") print "Index",x print "----------" for i in range(10): print i, x = 3.9 * x * (1 - x) print " ",x main()
3.84375
4
get_emails.py
fredsakr/eloqua-python-request
6
12772672
import sys sys.path.append('./lib') from eloqua_request import EloquaRequest request = EloquaRequest('site', 'user', 'password') response = request.get('/assets/emails?search=Demand*&page=1&count=50&depth=minimal', None)
1.828125
2
pusher/aiohttp.py
makingspace/pusher-http-python
0
12772673
<reponame>makingspace/pusher-http-python # -*- coding: utf-8 -*- from __future__ import ( print_function, unicode_literals, absolute_import, division) import aiohttp import asyncio from pusher.http import process_response class AsyncIOBackend: def __init__(self, client): """Adapter for ...
2.859375
3
openproblems/utils.py
bendemeo/SingleCellOpenProblems
134
12772674
<reponame>bendemeo/SingleCellOpenProblems from .version import __version__ import decorator import packaging.version @decorator.decorator def temporary(func, version=None, *args, **kwargs): """Decorate a function as a temporary fix. Parameters ---------- version : str Version after which thi...
2.421875
2
RecoLuminosity/LumiDB/python/normFunctors.py
nistefan/cmssw
0
12772675
<gh_stars>0 import re,ast class normFunctionFactory(object): ''' luminorm and correction functions. The result of the functions are correction factors, not final luminosity all functions take 5 run time parameters, and arbituary named params ''' def fPoly(self,luminonorm,intglumi,nBXs,whatev,wh...
2.46875
2
Multiprocessing/single.py
commoncdp2021/Gun-Gaja-Gun
171
12772676
<filename>Multiprocessing/single.py #!/usr/bin/python from gen_rand import gen_random_data if __name__ == '__main__': gen_random_data() gen_random_data() gen_random_data() gen_random_data()
1.546875
2
examples/app/users/Blueprint.py
hlop3z/basics
0
12772677
<reponame>hlop3z/basics<gh_stars>0 from basics import blueprints name = 'users' blueprint = blueprints.Blueprint( name ) RESPONSE = blueprints.response( name ) @blueprint.route async def custom(model, payload): form = model[ 'users' ].model.form #form.create({}) #form.update({}) return RESPONSE(Fals...
2.53125
3
src/mobile_seg/modules/wrapper.py
murez/mobile-semantic-segmentation
713
12772678
<reponame>murez/mobile-semantic-segmentation import torch import torch.nn as nn from mobile_seg.modules.net import MobileNetV2_unet class Wrapper(nn.Module): def __init__( self, unet: MobileNetV2_unet, scale: float = 255. ): super().__init__() self.unet = u...
2.703125
3
applications/tests/conftest.py
Sukriva/tilavarauspalvelu-core
0
12772679
import datetime import pytest import pytz from applications.models import ( Application, ApplicationEvent, ApplicationEventSchedule, ApplicationRound, ) @pytest.fixture def default_application_round() -> ApplicationRound: return ApplicationRound.objects.create( application_period_begin=d...
2.09375
2
jfk_fling/kernel.py
pelson/jfk-fling
1
12772680
from ipykernel.kernelbase import Kernel import tempfile import os from .realtime_subprocess import RealTimeSubprocess from .fprogram import FortranGatherer class FortranKernel(Kernel): implementation = 'jfk-fling' implementation_version = '0.1' language = 'Fortran' language_version = 'F2008' lang...
2.375
2
summoner.py
cpmoni/sw-enhance
0
12772681
import json from monster import Monster from rune import Rune, Grind, Gem from constant_maps import * class Summoner: def __init__(self,filename): self.data_file = filename print(f'Loading data from {filename}') with open(filename) as fin: data = json.load(fin) ...
3.015625
3
xontrib/mpl.py
jianlingzhong/xonsh
0
12772682
<reponame>jianlingzhong/xonsh<gh_stars>0 """Matplotlib xontribution.""" from xonsh.proc import foreground as foreground __all__ = () @foreground def mpl(args, stdin=None): """Hooks to matplotlib""" from xontrib.mplhooks import show show() aliases['mpl'] = mpl
1.539063
2
devito/core/intel.py
alisiahkoohi/devito
0
12772683
from devito.core.cpu import CPU64Operator, CPU64OpenMPOperator from devito.exceptions import InvalidOperator from devito.passes.clusters import (Blocking, Lift, cire, cse, eliminate_arrays, extract_increments, factorize, fuse, optimize_pows) from devito.tools import timed_pass __all...
1.9375
2
userbot/modules/kinghelper.py
raisnug980/King-Userbot
1
12772684
<gh_stars>1-10 """ Userbot module for other small commands. """ from userbot import CMD_HELP, ALIVE_NAME from userbot.events import register # ================= CONSTANT ================= DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else uname().node # ============================================ @register(outgoing=...
2.1875
2
script/maeplot/datafile.py
Rookfighter/MultiAgentExploration
4
12772685
<gh_stars>1-10 import os class DataFile: def __init__(self): self.reset() def reset(self): self.data_ = [] self.comments_ = [] self.loadedFrom_ = "" def load(self, filepath): assert(os.path.isfile(filepath)) self.reset() self.loadedFrom...
3.171875
3
sdk/yapily/models/payment_status_details.py
DarrahK/yapily-sdk-python
0
12772686
# coding: utf-8 """ Yapily API To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501 The version of the OpenAPI document: 1.157.0 Generated by: https://openapi-generator.tech """ import pprint impor...
2.203125
2
util/tools.py
imzengyang/appiumexample
0
12772687
import os class Tools(object): def getRootPath(self): ''' 获取上级目录的路径 :return: ''' rootpath = os.path.dirname(os.path.abspath(__file__)) while rootpath: if os.path.exists(os.path.join(rootpath, 'readme.md')): break rootpath = ro...
2.90625
3
src/utils.py
EricvanSchaik/opiniondigest
0
12772688
# Copyright 2019 <NAME>, Inc. and the University of Edinburgh. 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 # # Unle...
2.46875
2
covidfaq/converter.py
stanford-oval/covid-faq
0
12772689
<reponame>stanford-oval/covid-faq # # Copyright 2021 The Board of Trustees of the Leland Stanford Junior University # # 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...
2.734375
3
code/model_routines.py
alnebe/caspFilter
0
12772690
from tensorflow.keras import backend as K from tensorflow.keras.metrics import SpecificityAtSensitivity from tensorflow.keras.metrics import Precision from tensorflow.keras.metrics import Recall, FalsePositives, FalseNegatives, TruePositives, TrueNegatives def recall(y_true, y_pred): m = Recall() m.upda...
2.34375
2
parsers/US_TX.py
Gazer75/electricitymap-contrib
1
12772691
<filename>parsers/US_TX.py<gh_stars>1-10 #!/usr/bin/env python3 """Parser for the ERCOT area of the United States. (~85% of Texas)""" import csv import io import logging import zipfile import arrow import requests from lxml import html from .lib.exceptions import ParserException # This xpath gets the second cell i...
2.875
3
CoderPro/day4/solution.py
akashzcoder/coding_discipline
0
12772692
<reponame>akashzcoder/coding_discipline def sortNums(nums): # constant space solution i = 0 j = len(nums) - 1 index = 0 while index <= j: if nums[index] == 1: nums[index], nums[i] = nums[i], nums[index] index += 1 i += 1 if nums[index] == 2: ...
3.796875
4
nanopore-human-transcriptome/scripts/bulk_signal_read_correction/make_reads.py
hasindu2008/NA12878
345
12772693
import sys from pathlib import Path from argparse import ArgumentParser import h5py import pandas as pd import numpy as np from tqdm import tqdm from export import export_read_file def get_args(): parser = ArgumentParser(description="Parse sequencing_summary.txt files and .paf files to find split reads " ...
2.8125
3
frame/process_frame.py
kaf64/csvToolkit
0
12772694
import tkinter as tk from tkinter import ttk import pandas as pd import numpy as np class ProcessFrame(tk.Frame): def __init__(self, parent: tk.Tk) -> None: super().__init__(parent) self.data = None # init widgets frame_delete_nan = tk.LabelFrame(self, text='Delete empty values') ...
2.8125
3
ezgal/utils.py
AfonsoV/easyGalaxy
14
12772695
<gh_stars>10-100 from __future__ import (absolute_import, division, print_function, unicode_literals) import array, os, re import numpy as np import math # some useful constants c = 299792458 # speed of light (m/sec) m_per_au = 1.49598e11 # meters per astronomical unit au_per_pc = 3600 * 180...
3.03125
3
adjutant-plugin/mfa_actions/serializers.py
catalyst-cloud/adjutant-mfa
2
12772696
from adjutant.actions.v1.serializers import BaseUserIdSerializer from rest_framework import serializers class EditMFASerializer(BaseUserIdSerializer): delete = serializers.BooleanField(default=False)
1.609375
2
concepts/matrices.py
ymizoguchi/concepts
0
12772697
# matrices.py - boolean matrices as row bitsets and column bitsets """Boolean matrices as collections of row and column vectors.""" import bitsets from ._compat import zip __all__ = ['Relation'] Vector = bitsets.bases.MemberBits """Single row or column of a boolean matrix as bit vector.""" class Vectors(bitsets...
3.375
3
src/chapter-4/conftest.py
luizyao/pytest-chinese-doc
283
12772698
#!/usr/bin/env python3 # -*- coding:utf-8 -*- ''' Author: <NAME> (<EMAIL>) Created Date: 2019-09-19 5:35:12 ----- Last Modified: 2019-10-07 8:27:16 Modified By: <NAME> (<EMAIL>) ----- THIS PROGRAM IS FREE SOFTWARE, IS LICENSED UNDER MIT. A short and simple permissive license with conditions only requiring preservation...
2.40625
2
kubeflow/components/data/validation/run.py
WillianFuks/pySearchML
27
12772699
<gh_stars>10-100 import sys import os import argparse import pathlib import uuid from shutil import rmtree from google.cloud import storage, bigquery PATH = pathlib.Path(__file__).parent def main(validation_init_date, validation_end_date, bucket, destination): # Remove everything and deletes destination folder...
2.140625
2
tests/test_clj.py
papaver/pyfn
3
12772700
<reponame>papaver/pyfn<gh_stars>1-10 #------------------------------------------------------------------------------ # test_clj.py #------------------------------------------------------------------------------ # BSD 3-Clause License # # Copyright (c) 2018, Affirm # Copyright (c) 2018, <NAME> # All rights reserved. # #...
1.257813
1
shipment_management/provider_fedex.py
vishdha/shipment_management
2
12772701
<reponame>vishdha/shipment_management<filename>shipment_management/provider_fedex.py # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import binascii import datetime import json import frappe from fr...
1.625
2
identifyneeds/repository.py
robinstauntoncollins/identifyneeds
0
12772702
from typing import List, Dict from identifyneeds.entities import Condition class MemRepo(): def __init__(self, condition_dicts): self.conditions = {} self.put(condition_dicts) def get(self, filters: Dict = None): condition_objects = [Condition.from_dict(i) for i in self.conditions.v...
2.796875
3
biblib/algo.py
jonasteuwen/biblib
0
12772703
<filename>biblib/algo.py """Algorithms for manipulating BibTeX data. This module implements various algorithms supplied by BibTeX to style files, as well as some algorithms to make BibTeX data more accessible to Python. """ __all__ = ( "Name parse_names " + "parse_month " + "title_case " + "TeXProcess...
2.953125
3
mapscript/python/mapscript/__init__.py
tomkralidis/MapServer
0
12772704
<gh_stars>0 import sys import platform import os import inspect # As of Python 3.8 PATH can no longer be used to resolve the MapServer # DLLs on Windows. Instead users will be required to set a new MAPSERVER_DLL_PATH # environment variable. # See https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-python-api ...
2.3125
2
src/zif/sedna/tests.py
bitkeeper/zif.sedna
0
12772705
<filename>src/zif/sedna/tests.py import doctest import unittest def doTests(): doctest.testfile('README.txt') doctest.testfile('README_sednaobject.txt') def test_suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocFileSuite('README.txt')) suite.addTest(doctest.DocFileSuite('README_sedn...
1.929688
2
BetterBolus.py
crsullivan/BetterBolus
0
12772706
import requests import tkinter as tk from tkinter import filedialog, Text import main as main from sortedcontainers import SortedSet # This file runs the main program def raise_frame(frame): frame.tkraise() root=tk.Tk() root.title("Better Bolus V2.0") # root.iconbitmap("../favicon.ico") f1 = tk.Frame(root) f2 ...
3.078125
3
prog_praxis/kaprekar_169.py
genos/online_problems
1
12772707
#!/usr/bin/env python def num_digits(k): c = 0 while k > 0: c += 1 k /= 10 return c def is_kaprekar(k): k2 = pow(k, 2) p10ndk = pow(10, num_digits(k)) if k == (k2 // p10ndk) + (k2 % p10ndk): return True else: return False if __name__ == '__main__': for ...
3.796875
4
clan_blog/routes.py
Claire-Clan/clan-site
0
12772708
<reponame>Claire-Clan/clan-site<filename>clan_blog/routes.py """ Set default routes for app """ from flask import current_app as app, db from flask import render_template, url_for @app.route('/') def home(): return render_template('index.html') @app.route('/login', methods=['GET']) def login(): return render_...
2.3125
2
hathor/conf/testnet.py
khengleng/khathor
0
12772709
from hathor.conf.settings import HathorSettings SETTINGS = HathorSettings( P2PKH_VERSION_BYTE=b'\x49', MULTISIG_VERSION_BYTE=b'\x87', NETWORK_NAME='testnet-foxtrot', BOOTSTRAP_DNS=['foxtrot.testnet.hathor.network'], # Genesis stuff GENESIS_OUTPUT_SCRIPT=bytes.fromhex('76a914a584cf48b161e4a49223...
1.539063
2
sample_register/sample_register/page/jobboard/jobboard.py
TRUFIL/sampreg
0
12772710
<reponame>TRUFIL/sampreg from __future__ import unicode_literals import frappe from frappe.utils import cstr,now,add_days import json import datetime @frappe.whitelist() def get_items(sales_order): print "\n\nser_____",sales_order dl = frappe.db.sql("""select sales_order from `tabService Request` where name='{0}'"""...
2.28125
2
autumn/projects/covid_19/vaccine_optimisation/sample_code.py
emmamcbryde/AuTuMN-1
14
12772711
from autumn.projects.covid_19.vaccine_optimisation.vaccine_opti import ( get_decision_vars_names, initialise_opti_object, ) import numpy as np import yaml COUNTRY = "malaysia" # should use "malaysia" or "philippines" def run_sample_code(): # Initialisation of the optimisation object. This needs to be r...
2.78125
3
core/auth/viewsets.py
bharathjinka09/django-react-auth-backend
0
12772712
from rest_framework.response import Response from rest_framework_simplejwt.views import TokenObtainPairView from rest_framework.viewsets import ModelViewSet from rest_framework.permissions import AllowAny from rest_framework import status from rest_framework_simplejwt.tokens import RefreshToken from rest_framework_simp...
2.09375
2
toil/script/toil_config.py
dhutty/toil-py
0
12772713
#! python import logging import os.path import sys import traceback import toil.config import toil.parm import toil.parm.parse import toil.framework import toil.util.decorator from toil.batch.base import BaseBatch logging.basicConfig(format='%(asctime)s %(levelname)s: %(name)s %(message)s', level=logging.E...
2.1875
2
app/dashboard/migrations/0016_auto_20201119_1901.py
pnsn/squac_api
6
12772714
<gh_stars>1-10 # Generated by Django 3.1.2 on 2020-11-19 19:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0015_widget_color_palet'), ] operations = [ migrations.RemoveField( model_name='widget', ...
1.765625
2
citerate/citerate.py
markmelnic/citerate
0
12772715
<filename>citerate/citerate.py def citerator(data: list, x: int, y: int, layer = False) -> list: """Bi-dimensional matrix iterator starting from any point (i, j), iterating layer by layer around the starting coordinates. Args: data (list): Data set to iterate over. x (int): X starting coord...
3.484375
3
src/nitpick/plugins/info.py
finswimmer/nitpick
4
12772716
"""Info needed by the plugins.""" from dataclasses import dataclass, field from typing import Set from identify import identify from nitpick.constants import DOT from nitpick.exceptions import Deprecation from nitpick.project import Project @dataclass class FileInfo: """File information needed by the plugin."""...
2.28125
2
program/client/net_client.py
Addision/ProtoExcelTool
0
12772717
<reponame>Addision/ProtoExcelTool #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : client.py @Time : 2022/03/08 22:05:10 @Author : felix @Version : 1.0 @Contact : <EMAIL> @License : (C)Copyright 2021-2025, felix&lai @Desc : 协议测试客户端 ''' # here put the import lib from time import slee...
2.140625
2
src/go/Google_gcj_tools/lib/code_jam_login.py
veltzerdoron/GCJ
0
12772718
<filename>src/go/Google_gcj_tools/lib/code_jam_login.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2011 Google 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 # # ...
2.59375
3
tests/python/frontend/mxnet/model_zoo/squeezenet.py
XiaoSong9905/tvm
4,640
12772719
<reponame>XiaoSong9905/tvm # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the ...
1.726563
2
kube/volume.py
Stability-AI/kube
0
12772720
# 1. kubectl create -k "github.com/kubernetes-sigs/aws-fsx-csi-driver/deploy/kubernetes/overlays/stable/?ref=master" # 2. python get_security_group.py # 3. kubectl apply -f specs/eks/fsx.yml import os import sys import tempfile import time from typing import List import boto3 from kube2.types import Volume from kub...
1.9375
2
src/qimpy/electrons/__init__.py
shankar1729/qimpy
3
12772721
"""Electronic sub-system""" # List exported symbols for doc generation __all__ = [ "Electrons", "Kpoints", "Kmesh", "Kpath", "Fillings", "Basis", "Wavefunction", "Davidson", "CheFSI", "SCF", "LCAO", "xc", ] from ._electrons import Electrons from ._kpoints import Kpoints,...
1.210938
1
tests/test_secondary_rvs.py
sblunt/orbitize
60
12772722
import numpy as np import os from astropy.time import Time from pandas import DataFrame from orbitize.kepler import calc_orbit from orbitize import read_input, system, sampler def test_secondary_rv_lnlike_calc(): """ Generates fake secondary RV data and asserts that the log(likelihood) of the true paramet...
2.28125
2
evolvability.py
jal278/mazerobot-python
5
12772723
<gh_stars>1-10 import mazepy #a function to map a robot's behavior into a grid of niches def map_into_grid(robot,grid_sz): x=mazepy.feature_detector.endx(robot) y=mazepy.feature_detector.endy(robot) x_grid=int(x*(grid_sz-1)) y_grid=int(y*(grid_sz-1)) return (x_grid,y_grid) #function to calculate evolvability via...
3.0625
3
scripts/region_annotation_tools/util/blob_widget.py
Flipajs/FERDA
1
12772724
<gh_stars>1-10 import logging from PyQt4 import QtCore from PyQt4 import QtGui import sys from core.graph.region_chunk import RegionChunk from core.project.project import Project import numpy as np from gui.gui_utils import cvimg2qtpixmap from gui.segmentation.my_scene import MyScene from gui.segmentation.my_view imp...
2.125
2
msspeak/msspeak.py
afkmamunbd/python-msspeak
0
12772725
<gh_stars>0 # -*- coding: utf-8 -*- import requests import datetime import os from voices import find_voice import sys reload(sys) sys.setdefaultencoding('utf-8') class AccessError(Exception): def __init__(self, response): self.status_code = response.status_code data = response.json() sup...
2.1875
2
auxiclean/unittests/test_excel_manager.py
physumasso/auxiclean
1
12772726
<filename>auxiclean/unittests/test_excel_manager.py from .test_selector import TestBase from openpyxl import load_workbook from auxiclean import Selector from auxiclean.exceptions import ExcelError from collections import OrderedDict class TestExcelManager(TestBase): # two different courses courses = OrderedD...
2.734375
3
Chapter 02/PieGame.py
smartdong/PythonPractise
0
12772727
import math import pygame import sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode((600,500)) pygame.display.set_caption("The Pie Game - Press 1,2,3,4") myfont = pygame.font.Font(None, 60) color = 200, 80, 60 width = 4 x = 300 y = 250 radius = 200 position = x-radius, y-radius, radius*2, ...
3.28125
3
tests/classification/test_hamming_distance.py
awaelchli/metrics
1
12772728
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
2.109375
2
General_Laplace.py
Blue-Giant/SubspaceDNN_tf1Class
1
12772729
import tensorflow as tf import numpy as np def get_infos2Laplace_1D(input_dim=1, out_dim=1, intervalL=0.0, intervalR=1.0, equa_name=None): # -uxx = f if equa_name == 'PDE1': # u=sin(pi*x), f=-pi*pi*sin(pi*x) fside = lambda x: -(np.pi)*(np.pi)*tf.sin(np.pi*x) utrue = lambda x: ...
2.65625
3
decorator_test/test.py
ehddn5252/dw_test
0
12772730
<filename>decorator_test/test.py def decorating_fun(func): def wrapping_function(): print("this is wrapping function and get func start") func() print("func end") return wrapping_function @decorating_fun def decorated_func(): print("i`m decoraed") decorated_func()
3.203125
3
Chapter06_code/Ch06_R06/some_model_ch06r06/models.py
PacktPublishing/Odoo-Development-Cookbook
55
12772731
<reponame>PacktPublishing/Odoo-Development-Cookbook # coding: utf-8 from openerp import models, api, fields class LibraryMember(models.Model): _name = 'library.member' @api.multi def return_all_books(self): self.ensure_one wizard = self.env['library.returns.wizard'] values = {'me...
1.960938
2
examples/Parabola/genParabolaData.py
DomiDre/modelexp
0
12772732
import modelexp from modelexp.experiments import Generic from modelexp.models.Generic import Parabola import numpy as np import random app = modelexp.App() app.setExperiment(Generic) modelRef = app.setModel(Parabola) modelRef.defineDomain(np.linspace(-3, 3, 100)) modelRef.setParam('a', 1.3) modelRef.setParam('x0', 0...
2.59375
3
bandcamp_radio/bandcamp.py
richardmalone/bandcamp-radio
1
12772733
<reponame>richardmalone/bandcamp-radio<filename>bandcamp_radio/bandcamp.py import requests import json from html.parser import HTMLParser import time class _FanIdParser(HTMLParser): def error(self, message): pass fan_id = "" def handle_starttag(self, tag, attrs): for attr in attrs: ...
2.96875
3
sample_table.py
stko/pyvotab
0
12772734
<filename>sample_table.py from pprint import pprint from pyvotab import Pyvotab, PyvoStyles t1 = [ ['Hans', 'Mueller', 'Hamburg', 'Postweg', 8], ['Klaus', 'Meier', 'Hamburg', 'Feldplatz', 5], ['Klaus', 'Meier', 'Berlin', 'Burgallee', 4], ['Klaus', 'Schulze', 'Berlin', 'Burgallee', 3], ] t2 = [ ['Hin...
1.851563
2
league/migrations/0001_initial.py
klauck/mettliga
1
12772735
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-05-09 08:19 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
1.65625
2
exprimo/profilers/flops_profiler.py
Lagostra/exprimo
3
12772736
from paleo.profilers.flops_profiler import FlopsProfiler as PaleoFlopsProfiler from paleo.profilers.base import ProfilerOptions class FlopsProfiler: @staticmethod def profile(layer_spec, device, backward=False, batch_size=None, comm_penalization=1, comp_penalization=1): layer = layer_spec.operation ...
2.265625
2
pytorch2keras/linear_layers.py
ShuangLiu1992/pytorch2keras
2
12772737
import keras.layers import numpy as np import random import string import tensorflow as tf from .common import random_string def convert_gemm(params, w_name, scope_name, inputs, layers, weights, names): """ Convert Linear. Args: params: dictionary with layer parameters w_name: name prefix...
2.59375
3
oxe-api/exception/cannot_assign_value_from_parent_category.py
CybersecurityLuxembourg/openxeco
0
12772738
<filename>oxe-api/exception/cannot_assign_value_from_parent_category.py class CannotAssignValueFromParentCategory(Exception): def __init__(self): super().__init__("422 Cannot assign value from parent category")
2.140625
2
perforce/p4clean.py
nlfiedler/devscripts
0
12772739
<reponame>nlfiedler/devscripts #!/usr/bin/env python3 """Clean up shelved or pending changes. Python script to clean up old shelved and/or pending Perforce changes owned by the current user. Use -h to display usage information. This script requires the P4Python library to be installed. See http://www.perforce.com/prod...
2.796875
3
Program's_Contributed_By_Contributors/AI-Summer-Course/py-master/Basics/Hindi/12_read_write_file/12_read_write_file.py
SDGraph/Hacktoberfest2k21
0
12772740
# read file f=open("funny.txt","r") for line in f: print(line) f.close() # readlines() f=open("funny.txt","r") lines = f.readlines() print(lines) # write file f=open("love.txt","w") f.write("I love python") f.close() # same file when you write i love javascript the previous line goes away f=open("love.txt","w") ...
3.78125
4
django-web-parser/keywords/exceptions.py
sterenczak-marek/django-web-parser
0
12772741
<reponame>sterenczak-marek/django-web-parser class NoKeywordsException(Exception): """Website does not contains any keywords in <meta> tag""" pass class BadURLException(Exception): """Website does not exists in a given URL""" pass
2.296875
2
Src/Lego/PluginBase/PluginBase.py
capaximperii/PyPlugin
0
12772742
""" The base for all plugins to derive from. It also implements an auto registering pattern so that the plugins do not have to explicitly register. """ import abc from marshmallow_jsonschema import JSONSchema from Lego.Datatypes import InputParams from .decorators import check_chart_configuration from .decorators im...
2.90625
3
get_unused_macros.py
1ethanhansen/unused-c-finder
0
12772743
<filename>get_unused_macros.py #!/usr/bin/env python # Author: <NAME> <<EMAIL>> # For finding unused macros in c code # # Assumptions: # cscope and ctags installed # cscope has been used to generate cscope.out for your project # cscope.out exists in the current directory # # Usage: # enter the full pa...
2.546875
3
tests/test_app.py
simba999/dawdle
0
12772744
<filename>tests/test_app.py from tests.test_base import TestBase class TestApp(TestBase): def test_404(self): response = self.client.get('/this/page/does/not/exist') assert response.status_code == 404 assert b'Not Found' in response.data
2.734375
3
monitor_xfconf_changes/xfconf.py
jamescherti/monitor-xfconf-changes
3
12772745
#!/usr/bin/env python # # Copyright (c) 2021 <NAME> # URL: https://github.com/jamescherti/monitor-xfconf-changes/ # # Distributed under terms of the MIT license. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
1.367188
1
state_manager/event_processors/aiogram.py
Bloodielie/state_manager
4
12772746
<gh_stars>1-10 from typing import Optional from aiogram import Dispatcher from aiogram.dispatcher.middlewares import BaseMiddleware from aiogram.types import CallbackQuery, Message from aiogram.types.base import TelegramObject from state_manager import BaseStorage, BaseStateManager from pyject import DependencyNotFou...
2.0625
2
gizmo_bringup/nodes/arm_driver.py
peterheim1/gizmo
0
12772747
<filename>gizmo_bringup/nodes/arm_driver.py<gh_stars>0 #!/usr/bin/env python ''' Created March, 2017 @author: <NAME> arm_driver.py - gateway to Arduino based arm controller Copyright (c) 2011 <NAME>. All right reserved. Borrowed heavily from M<NAME>uson's ArbotiX base_controller.py code. Redistribution and...
1.734375
2
FromUser.py
emportent/ToxWitter
1
12772748
# ========================================================================================================================================================== #import the libraries # ====================================================================...
1.851563
2
calc.py
rixwhite/calculator
0
12772749
import pygame, sys from pygame.locals import * from math import cos, sin, sqrt, tan, pi # Initialize pygame pygame.init() pygame.display.set_caption('Calculator') clock = pygame.time.Clock() SURF = pygame.display.set_mode((450, 550)) font = pygame.font.SysFont(None, 30) calc = pygame.font.SysFont('ocraextended', 25) ...
2.921875
3
reserved/forms.py
Strangemother/coffee
0
12772750
from django import forms from django.forms import ModelForm from models import Venue, Location from django.forms.models import inlineformset_factory class VenueForm(ModelForm): def clean(self): super(VenueForm, self).clean() #I would always do this for forms. return self.cleaned_data full_add...
2.40625
2