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/test_examples.py
fizmat/ef_python
1
12792351
<filename>tests/test_examples.py import os import subprocess from shutil import copytree import inject import pytest from ef.config.config import Config from ef.runner import Runner from ef.util.testing import assert_dataclass_eq _examples_conf = [("examples/axially_symmetric_beam_contour/contour.conf", pytest.mark....
2.15625
2
build/lib.macosx-10.9-x86_64-3.9/gators/encoders/tests/test_base_encoder.py
Aditya-Kapadiya/gators
4
12792352
# License: Apache-2.0 from gators.encoders import WOEEncoder import pytest def test_init(): with pytest.raises(TypeError): WOEEncoder(dtype=str)
1.734375
2
python/regex_and_parsing/validating_and_parsing_email_addresses.py
avenet/hackerrank
0
12792353
from email.utils import formataddr, parseaddr import re emails_to_validate = int(input()) EMAIL_RE = re.compile( r'^[a-zA-Z][a-zA-Z0-9._-]*@[a-zA-Z]+\.[a-zA-Z]{1,3}$' ) def validate_email(email_guess): return bool(EMAIL_RE.match(email_guess)) for i in range(emails_to_validate): real_name, email_addre...
3.71875
4
migrations/versions/78ac40739c16_model_post_title_add.py
Renzf2015/myblog
0
12792354
<reponame>Renzf2015/myblog """model-post-title add Revision ID: 78ac40739c16 Revises: <PASSWORD> Create Date: 2016-09-05 17:54:40.327821 """ # revision identifiers, used by Alembic. revision = '78ac40739c16' down_revision = '<PASSWORD>' from alembic import op import sqlalchemy as sa def upgrade(): ### command...
1.101563
1
item_59/waste_memory.py
nickaigi/effective_python_tips
0
12792355
<filename>item_59/waste_memory.py import os import hashlib class MyObject(object): def __init__(self): self.x = os.urandom(100) self.y = hashlib.sha1(self.x).hexdigest() def get_data(): values = [] for _ in range(100): obj = MyObject() values.append(obj) return values...
2.921875
3
data/process_data.py
ranjeetraj2005/Disaster_Response_System
0
12792356
import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """loads the specified message and category data Args: messages_filepath (string): The file path of the messages csv categories_filepath (string): The file path of the cate...
3.296875
3
bartender/mongo_pruner.py
TheFoxAtWork/bartender
0
12792357
<filename>bartender/mongo_pruner.py<gh_stars>0 import logging from datetime import datetime, timedelta from mongoengine import Q from brewtils.stoppable_thread import StoppableThread class MongoPruner(StoppableThread): def __init__(self, tasks=None, run_every=timedelta(minutes=15)): self.logger = loggin...
2.375
2
Nifty Data/server.py
gautam7-github/Thrifty-Nifty
1
12792358
from flask import Flask, jsonify from flask.templating import render_template from threading import Thread from data import * # config app = Flask(__name__) app.config["JSON_SORT_KEYS"] = False app.config["JSONIFY_PRETTYPRINT_REGULAR"] = True # home route @app.route("/") def home(): return render_t...
2.703125
3
test_pytube.py
Tom-Niesytto/YouTubeDownload
0
12792359
from pytube import YouTube YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams[0].download()
2.21875
2
pyforchange/egg/__init__.py
PythonForChange/pyforchange
1
12792360
from pyforchange.egg.resources.modules import * from pyforchange.egg.resources.console import * from pyforchange.egg.resources.constants import * from pyforchange.egg.resources.extensions import * from pyforchange.egg.app import *
1.085938
1
src/scripts/apply_json_metadata.py
charlottestanton/covid-19-open-data
430
12792361
<filename>src/scripts/apply_json_metadata.py # Copyright 2020 Google LLC # # 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 require...
2.578125
3
run.py
talos-org/server
1
12792362
from app import app app.run(host='0.0.0.0', port="5000")
1.507813
2
quad9_plot.py
lindsayad/python
0
12792363
<filename>quad9_plot.py import yt ds = yt.load("/home/lindsayad/projects/moose/modules/navier_stokes/tests/ins/lid_driven/gold/lid_driven_out.e", step=-1) slc = yt.SlicePlot(ds, 'z', ('connect1', 'vel_y')) slc.set_log(('connect1','vel_y'), False) slc.set_width((1, 1)) slc.save()
1.921875
2
mandrill_logger/utils.py
willandskill/mandrill_logger
0
12792364
from django.contrib.auth import get_user_model from .enums import LogReason, LogStatus from .models import Log class MandrillLogger(): REASON_TRANSLATOR = { 'hard-bounce': LogReason.HARD_BOUNCE, 'soft-bounce': LogReason.SOFT_BOUNCE, 'spam': LogReason.SPAM, 'unsub': LogReason.UNSUB...
2.078125
2
utils/scripts/OOOlevelGen/src/sprites/ABTargetScrollFocusSprite.py
fullscreennl/bullettime
0
12792365
<reponame>fullscreennl/bullettime import PhysicsMixin import ID BODIES = """ <dict> <key>body</key> <dict> <key>x</key> <integer>%(x)s</integer> <key>y</key> <integer>%(y)s</integer> <key>width</key> <integer>10</integer> <key>height</key> <integer>10</integer> <...
2.34375
2
project/s2dataprocess.py
4theKnowledge/literaturesieve
0
12792366
<gh_stars>0 """ @author: <NAME> """ from tqdm import tqdm import gzip import json from langdetect import detect import time from pprint import pprint import concurrent.futures import codecs import re def timeit(method): def timed(*args, **kw): ts = time.time() result = method(*args, **kw) ...
2.375
2
apps/linux/vim/plugins/ultisnips/markdown_snippets.py
ma-anwar/knausj_talon
1
12792367
from talon import Context ctx = Context() ctx.matches = r""" tag: user.vim_ultisnips mode: user.markdown mode: command and code.language: markdown """ # spoken name -> ultisnips snippet name ctx.lists["user.snippets"] = { # Sections and Paragraphs # "section": "sec", "sub section": "ssec", "sub sub sec...
2.078125
2
helper.py
tangtai/2D_ICON_Generation_with_DCGAN_DEMO
0
12792368
<filename>helper.py<gh_stars>0 import numpy as np from PIL import Image import math def get_image(image_path, width, height, mode): """ Read image :param image_path: path of image :param width: width of image :param height: height of image :param mode: image mode :return Image data ""...
2.625
3
bonus2/collateral/PYLINT_EX/ncclient2.py
ksannedhi/pyplus_course
39
12792369
<reponame>ksannedhi/pyplus_course import ipdb from ncclient import manager from getpass import getpass from ncclient.xml_ import new_ele conn = manager.connect( host="srx2.lasthop.io", username="pyclass", password=getpass(), device_params={"name": "junos"}, hostkey_verify=False, allow_agent=Fal...
2.25
2
appserver/subscription/models.py
sinag/SWE574-Horuscope
0
12792370
from django.db import models from community.models import Community from root import settings """ Subscription object model """ class Subscription(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, blank=False, null=False, db_index=True) community = models.ForeignKey...
2.359375
2
moontamer/four_wheel_steering_teleop/scripts/teleop_four_wheel_steering_joy.py
cagrikilic/simulation-environment
1
12792371
<reponame>cagrikilic/simulation-environment<gh_stars>1-10 #!/usr/bin/env python import rospy from math import pi from four_wheel_steering_msgs.msg import FourWheelSteering from sensor_msgs.msg import Joy class TeleopFourWheelSteeringJoy(): def __init__(self): self.axis_dead_zone = 0.05 self.axis_li...
2.640625
3
backend/StudentVillage/serializer.py
henrikhorluck/tdt4140-washlists
0
12792372
from rest_framework import serializers from SIFUser.serializer import UserSerializer from .models import StudentVillage class StudentVillageSerializer(serializers.ModelSerializer): managers = UserSerializer(many=True) dormrooms = serializers.PrimaryKeyRelatedField(many=True, read_only=True) class Meta:...
2.03125
2
vulncat/__main__.py
techtimeflies/vulncat_scrapper
1
12792373
import argparse import vulncat import logging import os loglevel='DEBUG' logpath=f'{os.getcwd()}/log' # create the log directory if it does not exist if os.path.exists(logpath) == False: os.mkdir(logpath) logging.basicConfig( level=loglevel, filename=f'{logpath}/app.log', format='%(asctime)s - %(levelna...
2.53125
3
pair_sne.py
jcorbettfrank/find_pisne
0
12792374
<filename>pair_sne.py #%% from lightCurve import lightCurve import pandas as pd import numpy as np import os class pairSNE(lightCurve): def __init__(self, name): lightCurve.__init__(self, name) def loadData(self, dir): fn = [f for f in os.listdir(dir) if f[-4:]=='spec'] ...
2.59375
3
main.py
CypherToad/seed_print
6
12792375
#!/usr/bin/env python3 import json import base64 import random from io import BytesIO import socket from binascii import unhexlify, hexlify # Trusting SeedSigner's embit library # https://github.com/SeedSigner/embit from embit import bip32 from embit import bip39 from embit import wordlists from embit import script f...
2.578125
3
registrations/migrations/0001_initial.py
IFRCGo/ifrcgo-api
11
12792376
# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2018-02-07 21:09 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth',...
1.648438
2
tools/testerize.py
alex65536/contest-template
0
12792377
#!/usr/bin/env python3 import os import sys import json in_fmt = '%d.in' out_fmt = '%d.out' def get_test(path, test_num, test_fmt): return os.path.join(path, 'tests', test_fmt % test_num) def testerize(path): src_prob = json.loads(open(os.path.join(path, 'problem.json'), 'r').read())['problem'] dst_prob...
2.59375
3
uncertainty_baselines/datasets/clinc_intent_test.py
gmum/uncertainty-baselines
1
12792378
<gh_stars>1-10 # coding=utf-8 # Copyright 2020 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
2.109375
2
setup.py
luckygadfy/birthdayrate
0
12792379
#!/usr/bin/env python #-*- coding:utf-8 -*- """ File Name: setup.py Author: gadfy """ from setuptools import setup, find_packages #这个包没有的可以pip一下 with open("README.md", "r", encoding="utf-8") as f: long_description = f.read() setup( name = "samebirthdayrate", #这里是pip项目发布的名称 version = "1.0...
1.742188
2
test/programytest/storage/stores/sql/store/test_braintree.py
motazsaad/fit-bot-fb-clt
5
12792380
<gh_stars>1-10 import unittest import unittest from programy.storage.stores.sql.engine import SQLStorageEngine from programy.storage.stores.sql.config import SQLStorageConfiguration import programytest.storage.engines as Engines class SQLBraintreeStoreTests(unittest.TestCase): @unittest.skipIf(Engines.sql is ...
2.25
2
Methods/Machine/Magnet/comp_volume.py
Superomeg4/pyleecan
2
12792381
# -*- coding: utf-8 -*- """@package Methods.Machine.MagnetType10.comp_volume Compute the Magnet volume method @date Created on Wed Dec 17 14:56:19 2014 @copyright (C) 2014-2015 EOMYS ENGINEERING. @author pierre_b """ def comp_volume(self): """Compute the Magnet volume (by analytical computation) Parameters ...
3.25
3
server/app/database.py
MozammilKhan/tdsb-project
12
12792382
<filename>server/app/database.py<gh_stars>10-100 import pymongo from pymongo import MongoClient from bson.objectid import ObjectId from gridfs import GridFS class DB(object): URI = "mongodb+srv://TDSB301:<EMAIL>/test?retryWrites=true&w=majority" @staticmethod def init(): client = MongoClient(D...
2.578125
3
example.py
amaargiru/pylogger
0
12792383
<filename>example.py import pathlib from pylogger import PyLogger # Path to logs log_file_path = "logs//example.log" # Max file size log_max_file_size = 1024 ** 2 # Max number of files log_max_file_count = 10 if __name__ == '__main__': # Create a path to the log file if it doesn't exist path = pathlib.Path(l...
2.96875
3
listeler.py
bekirglr/Python_Temelleri
0
12792384
meyveler = ["Alma","Armut","Üzüm","Çilek","Karpuz","Muz"] print(meyveler) #bunu listeye dökmek için; print(meyveler[0]) print(meyveler[1]) print(meyveler[2]) print(meyveler[3]) #python da dizileri saymak sıfırdan başlanır. #dizide kaç tane eleman bulunduğunu öğrenmek içinde "len" komutunu kullanırız. print(len(meyv...
4.03125
4
tests/tests_context.py
theatlantic/v8-cffi
39
12792385
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from unittest.mock import patch, Mock except ImportError: from mock import patch, Mock import unittest import logging import os import tempfile from contextlib import contextmanager import six from v8cffi.platform import platform from v8c...
2.671875
3
ch09/fig09-04_format-logging-temperature.py
ricelee-com/pico-starter-kit
0
12792386
#!/usr/bin/python3 #+-+-+-+-+-+-+-+-+-+-+-+ #|R|i|c|e|L|e|e|.|c|o|m| #+-+-+-+-+-+-+-+-+-+-+-+ # Copyright (c) 2021, <EMAIL> # All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # Origin: p111 at https://hackspace.raspberrypi.org/books/micropython...
3.078125
3
meal_app/migrations/0001_initial.py
praveen868686/meals_myproject
0
12792387
# Generated by Django 3.2 on 2021-04-18 06:36 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Meal', fields=[ ('id', models.BigAutoField(au...
1.875
2
annotations/gen_json.py
EricJoraskie/evidence-inference
42
12792388
# -*- coding: utf-8 -*- """ Created on Mon Dec 10 11:32:52 2018 @author: Eric """ import glob import pandas as pd files = glob.glob("./split_files/*.csv") for file_name in files: new_name = file_name.split(".csv")[0] + '.json' df = pd.read_csv(file_name, engine = 'python', encoding = 'utf-8') ...
2.921875
3
lldb/test/API/symbol_ondemand/shared_library/TestSharedLibOnDemand.py
ornata/llvm-project
0
12792389
"""Test that types defined in shared libraries work correctly.""" import lldb import unittest2 from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class SharedLibTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self...
2.109375
2
test/runtests.py
hwjsnc/SenSchema
3
12792390
import os import pathlib import platform import subprocess import unittest # Ensure we're running in the correct folder so we don't destroy anything important cwd = pathlib.Path(os.getcwd()) if cwd.name == "SenSchema": os.chdir("test") cwd = pathlib.Path(os.getcwd()) assert cwd.name == "test" assert cwd.paren...
2.40625
2
message_type.py
VladislavKorecky/pylogs
0
12792391
from abc import ABC class MessageType(ABC): """ Interface for message types. """ def get_name(self): """ Return the name of the message type. Returns: str: The name of the message type. """ pass def get_color_code(self): """ R...
3.609375
4
backend/SIFUser/migrations/0006_auto_20200229_1420.py
henrikhorluck/tdt4140-washlists
0
12792392
# Generated by Django 3.0.3 on 2020-02-29 14:20 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("Dormroom", "0004_auto_20200229_1420"), ("SIFUser", "0005_merge_20200228_1005"), ] operations = [ mi...
1.6875
2
services/showcase/api/db/models/sandbox.py
Open-Earth-Foundation/traction
0
12792393
import uuid from datetime import datetime from typing import Optional, List import pydantic from sqlalchemy import Column, JSON from sqlmodel import Field, Relationship from api.db.models.base import BaseModel, BaseTable class SchemaDef(pydantic.BaseModel): id: Optional[str] = None name: Optional[str] = Non...
2.515625
3
magic_missile.py
forthedice/magic-missile
0
12792394
import random class MagicMissile: def __init__(self, spell_slot_lvl, spell_mode): try: self.lvl = int(spell_slot_lvl) except: raise TypeError("spell_slot_level should be an integer") if spell_mode == "roll_die" or spell_mode == "roll_dice": self...
3.40625
3
code/Gibbs_sampling_horseshoe_prior.py
MariosNT/ML_Extreme_Climate_Events
0
12792395
<gh_stars>0 """ Improved sampling code, with horseshoe prior """ import copy from scipy.stats import invgamma as invgamma import numpy as np from scipy.stats import gamma, multivariate_normal import pylab as plt from Sampler import EllipticalSliceSampling from timeseries_cp import cptimeseries from timeseries_cp_extre...
1.976563
2
leetcode/70/70.climbing-stairs.py
Yu-Ren-NEU/Leetcode
1
12792396
# # @lc app=leetcode id=70 lang=python3 # # [70] Climbing Stairs # # @lc code=start class Solution: def climbStairs(self, n: int) -> int: # 不管是走几个台阶. # 要么走1步, 要么走2步 # 那么对于n级台阶, 只有两种情况 # 从n-1级走1步, 或者, 从n-2级台阶走2步 # 第 n 阶的情况只能是上面两种情况之和 # 类似汉诺塔问题 # x=1 -> 1 ...
3.359375
3
payments/migrations/0001_initial.py
fcurella/checkout
0
12792397
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime import markupfield.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] ...
1.804688
2
nei/server.py
pyviz/nei
13
12792398
#!/usr/bin/env python import logging import tornado import tornado.web from tornado import httpserver from tornado import ioloop from tornado import websocket import os import sys import json import webbrowser import nbformat from queue import Queue from .execute import ThreadedExecutor from .cells import Executable...
2.453125
2
correios/__init__.py
rennancockles/rastreio-correios
2
12792399
<reponame>rennancockles/rastreio-correios from correios.entities import Objeto from correios.main import Correios __version__ = "0.1.4" __all__ = ["Objeto", "Correios"]
1.023438
1
fline/losses/research/connections.py
asromahin/fline
5
12792400
import torch class BboxLoss(torch.nn.Module): def __init__(self, device): super(BboxLoss, self).__init__() self.loss = IouDotsLoss(device) def forward( self, pred_vectors: torch.Tensor, target_bboxes: torch.Tensor, ): pred_count = pred_bboxes.sh...
2.4375
2
points/migrations/0007_alter_spend_receipt.py
JXIong15/fetch-points
0
12792401
<gh_stars>0 # Generated by Django 4.0.1 on 2022-01-13 17:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('points', '0006_alter_spend_receipt'), ] operations = [ migrations.AlterField( model_name='spend', name='...
1.25
1
main/cifar_10_resnet.py
xiaonanQua/experiment
0
12792402
import torch import torch.nn as nn from torchvision.datasets import CIFAR10 from torch.optim import Adam from torchvision.models import resnet50 from torch.utils.data import DataLoader import torchvision.transforms as transforms from torch.utils.tensorboard import SummaryWriter import torch.nn.functional as F import os...
2
2
src/cogs/owner/owner.py
m1ten/sentry-py
0
12792403
import discord from discord import app_commands from discord.ext import commands class owner(commands.Cog): def __init__(self, bot: commands.Bot) -> None: self.bot = bot @app_commands.command(name='eval', description='evaluate') async def eval(self, interaction: discord.Interaction, code: str) ->...
2.421875
2
autogalaxy/analysis/analysis.py
jonathanfrawley/PyAutoGalaxy
0
12792404
from astropy import cosmology as cosmo import autofit as af from autoarray import preloads as pload from autoarray.exc import PixelizationException, InversionException, GridException from autoarray.inversion import pixelizations as pix, inversions as inv from autofit.exc import FitException from autogalaxy.anal...
2.109375
2
example.py
KostyaKow/PyWebKitGtk-wrapper
0
12792405
<reponame>KostyaKow/PyWebKitGtk-wrapper<gh_stars>0 #!/usr/bin/env python import sys, time sys.path.append('..') import pwkg def setupElectron(index_path, on_event): w = pwkg.Window(100, 100, "PWKG Window", debug=True) w.load(index_path) w.on_gui_event += on_event return w def sleep(x): time.sleep(x) ...
1.820313
2
customer/views.py
RFNshare/StraightIntLtd
0
12792406
from django.shortcuts import render from django.urls import reverse_lazy from customer.owner import * from .filters import * from .forms import * # class CustomerIndexView(LoginRequiredMixin, View): # login_url = '/login/' # redirect_field_name = 'redirect_to' class CustomerCreateView(OwnerCreateView): ...
2.203125
2
testcases/footers_test.py
praveenpj29/selenium_test
0
12792407
from selenium import webdriver from selenium.webdriver.common.by import By from pageObjects.footer import Footer from utilities.customLogger import LogGen from utilities.siteConfig import siteconfig from selenium.common.exceptions import ElementNotInteractableException import pandas as pd import time class Test_1: ...
2.59375
3
pyega3/libs/data_file.py
lvarin/ega-download-client
47
12792408
import concurrent.futures import logging import logging.handlers import os import re import shutil import sys import time import urllib import htsget import psutil from tqdm import tqdm from pyega3.libs import utils DOWNLOAD_FILE_MEMORY_BUFFER_SIZE = 32 * 1024 class DataFile: DEFAULT_SLICE_SIZE = 100 * 1024 * ...
2.265625
2
bot/utils/__init__.py
famaxth/Russian-Qiwi-Bot
0
12792409
<filename>bot/utils/__init__.py from . import db_api from . import misc from .notify_admins import on_startup_notify
1.257813
1
subtitle_sync.py
apiad/sublime-subtitle-sync
4
12792410
import sublime_plugin import sublime SUB_RE = '\d\d:\d\d:\d\d,\d\d\d' def find_subtitles(view): subs = [] sel = view.sel() for match in view.find_all(SUB_RE): if sel.contains(match): subs.append(match) # sel.clear() # sel.add_all(subs) return subs def convert_to_time(s...
2.8125
3
tool/run.py
David-Loibl/gistemp
1
12792411
#!/usr/local/bin/python3.4 # # run.cgi -- run steps of the GISTEMP algorithm # # <NAME>, 2009-12-08 # <NAME>, Revision 2016-01-06 """run.cgi [options] -- run steps of the GISTEMP algorithm. Options: --help Print this text. --steps=STEPS Specify which steps to run, as a comma-separated list of ...
2.734375
3
MSE430Funcs/CrysStrucFuncs.py
KCMak653/MSE430Notebooks
0
12792412
<reponame>KCMak653/MSE430Notebooks<filename>MSE430Funcs/CrysStrucFuncs.py<gh_stars>0 def make_supercell(cell, diff_species): """Append all sites in a unit cell to a structure - must have cubic lattice""" #diff_species: Boolean, if true, make different species diff colors. If false, make one basis group one...
2.953125
3
research/pyqtConfig/util.py
FXTD-ODYSSEY/QBinder
13
12792413
# coding:utf-8 from __future__ import print_function __author__ = 'timmyliang' __email__ = '<EMAIL>' __date__ = '2019-12-12 20:09:01' """ 调用库 """ from Qt import QtGui from Qt import QtCore from Qt import QtWidgets # NOTE replaceWidget ---------------------------------------------------------------------------- d...
2.296875
2
Heap/TestCircularDoublyLinkedList.py
kopok2/DataStructures
0
12792414
<filename>Heap/TestCircularDoublyLinkedList.py # encoding-utf-8 import unittest from CircularDoublyLinkedList import CircularDoublyLinkedList class TestCircularDoublyLinkedList(unittest.TestCase): def test_simple_list(self): cdll = CircularDoublyLinkedList(17) cdll.insert_new_node(24) cdll...
3.25
3
sw/3rd_party/VTK-7.1.0/Imaging/Hybrid/Testing/Python/shepards.py
esean/stl_voro_fill
4
12792415
<reponame>esean/stl_voro_fill<gh_stars>1-10 #!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Create the RenderWindow, Renderer and both Actors # ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(...
1.96875
2
soe/python/checkClientWaitState.py
nicksstuff/sample.voice.gateway
0
12792416
# ------------------------------------------------ # IMPORTS ---------------------------------------- # ------------------------------------------------ ##### # Python dist and 3rd party libraries ##### import os, requests, json, string, datetime, logging, time from os.path import join, dirname from weblogger import ad...
2.53125
3
swarm_cli/cli_swarm.py
sungazer-io/swarm-cli
0
12792417
<gh_stars>0 from typing import List import click from swarm_cli.lib import SwarmModeState, load_env_files, run_cmd @click.group() @click.option('--environment', '-e', multiple=True, required=False) @click.pass_context def swarm(ctx: click.Context, environment: List[str]): load_env_files(environment) state =...
2.203125
2
b3j0f/schema/lang/python.py
b3j0f/schema
0
12792418
# -*- coding: utf-8 -*- # -------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2016 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
1.28125
1
tests/test_statefulset_partitioner.py
Qotto/tonga
1
12792419
#!/usr/bin/env python # coding: utf-8 # Copyright (c) Qotto, 2019 import uuid import pytest from tonga.services.coordinator.partitioner.statefulset_partitioner import StatefulsetPartitioner from tonga.errors import OutsideInstanceNumber def test_statefulset_partitioner_with_str_uuid_key(): statefulset_partition...
2.3125
2
reprlearn/data/__init__.py
cocoaaa/ReprLearn
0
12792420
<reponame>cocoaaa/ReprLearn<gh_stars>0 def data_fn(): print("src.data.__init__.py") # data_fn()
1.21875
1
eris/decorators/__init__.py
xesxen/eris
1
12792421
<filename>eris/decorators/__init__.py """ Decorator module. Contains various decorators for hook callbacks. """ class BaseDecorator: """ Base class for decorators in Eris. """ # The interface for hooks means that events will always be the first argument, anything else # will be passed as payloads for t...
2.015625
2
tempoMAGE.py
pkhoueiry/TempoMAGE
1
12792422
#!/usr/bin/python """ TempMAGE model architecture """ import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.layers import Conv2D,MaxPool2D,Flatten,Conv1D,MaxPooling1D,Dense,Dropout def set_metrics(): """ metrics used to evaluate the model's perfromance ""...
2.59375
3
geoloc-server/test.py
muzammilar/passport
1
12792423
# -*- coding: utf-8 -*- """ test.py ~~~~~~~~~~~ Internal file for dummy function checking. :author: <NAME> :copyright: Northeastern University © 2018. :license: Custom BSD, see LICENSE for more details. :email: <EMAIL> """ import time import configs.system print configs.system.PROJECT_R...
1.132813
1
tests/run_test_Recommenders.py
damicoedoardo/NNMF
2
12792424
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 22/11/2018 @author: XXX """ import unittest import os, shutil from RecSysFramework.Recommender.NonPersonalized import TopPop, Random, GlobalEffects from RecSysFramework.Recommender.KNN import UserKNNCF from RecSysFramework.Recommender.KNN import ItemKNNC...
1.84375
2
attributes/continuous_integration/__init__.py
Lufedi/reaper
106
12792425
<reponame>Lufedi/reaper class CiService(object): @staticmethod def is_enabled(path): raise NotImplementedError()
1.484375
1
scts/__init__.py
deniscapeto/SimpleCorreiosTrackingService
0
12792426
from django import setup setup() from scts.factory.build_app import build_app # noqa app = build_app()
1.304688
1
bc_website/__main__.py
beginner-codes/website
1
12792427
import uvicorn uvicorn.run("bc_website.app:app", host="localhost", port=5000, reload=True)
1.679688
2
web_wrapper/context_processors.py
musicmetadata/web-wrapper
1
12792428
<filename>web_wrapper/context_processors.py from django.conf import settings def features(request): return { 'CWR2_AVAILABLE': settings.CWR2_AVAILABLE, 'CWR3_AVAILABLE': settings.CWR3_AVAILABLE, }
1.671875
2
src/__main__.py
andreimaximov/course-planner
0
12792429
import argparse import list import depth VERSION = '1.0.2' def main(): parser = argparse.ArgumentParser() parser.add_argument('--version', action='version', version=VERSION) subparsers = parser.add_subparsers() list.init(subparsers) depth.init(subparsers) args = parser.parse_args() arg...
2.671875
3
Python3/HTTPRequests/first_request.py
norbertosanchezdichi/TIL
0
12792430
<reponame>norbertosanchezdichi/TIL import requests url = "http://www.google.com" response = requests.get(url) print(f"your request to {url} came back w/ status code {response.status_code}") print(response.text)
3.125
3
compositional-zs/compose_data.py
ZhihaoAIRobotic/tafe-net
56
12792431
<filename>compositional-zs/compose_data.py import torch import torch.utils.data as data from os.path import join, exists def load_word_embeddings(emb_file, vocab): vocab = [v.lower() for v in vocab] embeds = {} for line in open(emb_file, 'r'): line = line.strip().split(' ') wvec = torch.F...
2.375
2
breadp/benchmarks/example.py
tgweber/breadp
0
12792432
<filename>breadp/benchmarks/example.py ################################################################################ # Copyright: <NAME> 2020 # # Apache 2.0 License # # This file contains code related to the DataCite best practice guide benchmark # # Basis for this benchmark: 10.5281/zenodo.3559800 # ###############...
1.515625
2
oreilly_python1/final.py
myleneh/code
0
12792433
#!/usr/local/bin/python3 """ This program takes a filename as input and displays the count for each word length, ignoring punctuation and non-alphanumeric characters. """ import re, sys word_table = {} with open(sys.argv[1]) as f: for line in f: for word in line.split(): stripped = re.sub("[...
4.3125
4
test_damm.py
jdmacleod/damm
0
12792434
<reponame>jdmacleod/damm<filename>test_damm.py from damm import encode, check import unittest class GeneralTest(unittest.TestCase): def test_some_known_numbers(self): self.assertEqual(encode(572), 4) self.assertTrue(check(5724)) self.assertEqual(encode('43881234567'), 9) self.asser...
3
3
nemo/collections/nlp/models/glue_benchmark/metrics_for_glue.py
vinayphadnis/NeMo
4,145
12792435
# Copyright 2018 The Google AI Language Team Authors and # The HuggingFace Inc. team. # Copyright (c) 2020, <NAME>. 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 # # ...
2.1875
2
tests/test_populate.py
bio2bel/drugbank
6
12792436
<reponame>bio2bel/drugbank # -*- coding: utf-8 -*- """Suites for testing the populated database.""" from pybel import BELGraph from pybel.constants import CITATION, CITATION_REFERENCE, CITATION_TYPE, CITATION_TYPE_PUBMED from tests.constants import PopulatedTemporaryCacheClassMixin class TestPopulation(PopulatedTem...
2.578125
3
Correlation_Coefficient.py
Priority-At-Next-Intersection/Corner_Detection
5
12792437
""" There are two useful functions: 1. correlationCoef will tell you the coreelation coefficient of two patches of same size the greater this coefficient is, the similar this two patches are. 2. matchTemplate will automatically go through the whole input 'img' with a sliding window and implement corre...
3.171875
3
opentapioca/tagger.py
heathersherry/opentapioca
191
12792438
<reponame>heathersherry/opentapioca<filename>opentapioca/tagger.py import json import requests import logging import re from math import log from .languagemodel import BOWLanguageModel from .wikidatagraph import WikidataGraph from .tag import Tag from .mention import Mention # solr_collection = 'wd_multilingual' logg...
2.625
3
other/q2.py
pengfei-chen/algorithm_qa
79
12792439
<filename>other/q2.py """ 问题描述:给定两个不等于0的整数M和N,求M和N的最大公约数. """ def get_bigest_public_num(m, n): if n == 0: return m else: return get_bigest_public_num(n, m % n) if __name__ == '__main__': print(get_bigest_public_num(10, 23))
2.828125
3
codes/20200209_person_reid/src/optimize_params.py
ryoichiro3816/testpy
4
12792440
'''Train CIFAR10 with PyTorch.''' import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import os import argparse from sklearn.metrics import classification_report import pandas ...
2.765625
3
src/cogs/image.py
Alone-ankush/Credo
0
12792441
import discord from discord.ext import commands import aiohttp import requests class Image(commands.Cog, name='Image'): def __init__(self, bot): self.bot = bot @commands.command() @commands.cooldown(1, 10, commands.BucketType.user) async def cat(self, ctx): """Gives You Random Image O...
2.75
3
mlmo/interfaces/base_i_prod.py
prashantlv/mltoolkit
1
12792442
class BaseIProd(object): pass
1.117188
1
oss_client/fileobj.py
olivetree123/oss-client
0
12792443
import os from oss_client.utils import content_md5 class FileObject(object): def __init__(self, name="", obj=None, hash_value=None, storage=None): if not (obj or hash_value): raise ValueError("obj and hash_value both are None") self.obj = obj self.name = name self.suffi...
2.796875
3
bot/utils/utils.py
BANanaD3V/kuzaku
0
12792444
<filename>bot/utils/utils.py from disnake.ext.commands.cooldowns import BucketType, Cooldown, CooldownMapping from disnake.ext.commands import Command def cooldoown(rate, per, type=BucketType.default, premium: bool = False): def decorator(func): if isinstance(func, Command): func._buckets = Co...
2.453125
2
cloudbutton_geospatial/io_utils/plot.py
berkevaroll/geospatial-usecase
0
12792445
from matplotlib import pyplot as plt from ibm_botocore.client import Config, ClientError import rasterio import random import ibm_boto3 def plot_random_blocks(bucket, item, num): """ Plot num random blocks from IBM COS item located at bucket """ fig, axs = plt.subplots(num, figsize=(20,30)) co...
2.65625
3
tests/test_graindist.py
eblur/newdust
4
12792446
import pytest import numpy as np from scipy.integrate import trapz from newdust.graindist import * from . import percent_diff MD = 1.e-5 # g cm^-2 RHO = 3.0 # g c^-3 SDEFAULT = 'Powerlaw' CDEFAULT = 'Silicate' ALLOWED_SIZES = ['Grain','Powerlaw','ExpCutoff'] ALLOWED_COMPS = ['Drude','Silicate','Graphite'] # T...
2.125
2
allauth/socialaccount/providers/noa/views.py
Supratix/django-allauth
0
12792447
<filename>allauth/socialaccount/providers/noa/views.py import requests import jwt from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import NoaProvider # {"issuer":"https://noaidentitydev.azurewebsites.net/authorization", # "jw...
1.875
2
Day 3/IntegerToBinary.py
RajShashwat/100daysofcode
0
12792448
#imported the Stack.py from Stack import Stack def intToBinary(num: int) -> str : stack = Stack() while num > 0: remender = num % 2 stack.push(remender) num = num // 2 binary = "" while not stack.is_empty(): binary += str(stack.pop()) return binary num = int(inp...
3.9375
4
lesson01/monkey/t1.py
herrywen-nanj/51reboot
0
12792449
x1 = 1.5 x2 = 3 x3 = "123" x4 = True x5 = False ################################################## xx1 = int(x1) xx3 = int(x3) xx4 = int(x4) xx5 = int(x5) print(type(xx1)) print(type(xx3)) print(type(xx4), xx4) print(type(xx5), xx5) xx2 = float(x2) print(type(xx2), xx2) # x3 = "123" xxx3 = float(x3) print(ty...
3.5625
4
lambda/write_id_index_lambda.py
jhuapl-boss/boss-tools
1
12792450
<reponame>jhuapl-boss/boss-tools # Lambda to write the morton index of a cuboid object key to the id in the # DynamoDB id index table. # # If there are failures, uses decorrelatd jitter backoff algorithm described in: # https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/ # # It expects to get from...
1.828125
2