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
Src/models/model2_3L.py
OferMon/Covid19-DeepLearning-XAI
2
30800
from sklearn.model_selection import train_test_split import pandas as pd import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation, Flatten from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import f1_score from sklearn.metrics import accuracy_score, confusi...
2.671875
3
models/FSSD_SE.py
cenchaojun/TDFSSD
0
30801
''' Micro Object Detector Net the author:Luis date : 11.25 ''' import os import torch import torch.nn as nn import torch.nn.functional as F from layers import * from models.base_models import vgg, vgg_base from ptflops import get_model_complexity_info class BasicConv(nn.Module): def __init__(self, in_planes, ou...
1.992188
2
__init__.py
yuta-hi/chainer_extensions
1
30802
from . import extensions
1.148438
1
change_wall.py
masoodmomin/Python
0
30803
<reponame>masoodmomin/Python import os import ctypes import time PATH = 'C:/Users/acer/Downloads/wall/' SPI=20 def changeBG(path): """Change background depending on bit size""" count=0 for x in os.listdir(PATH): while True: ctypes.windll.user32.SystemParametersInfoW(SPI, ...
2.75
3
rump/rule.py
bninja/rump
6
30804
<filename>rump/rule.py<gh_stars>1-10 import collections import logging import StringIO from . import exc, Request, Expression logger = logging.getLogger(__name__) class CompiledRule(object): """ Compiled version of a routing rule. `symbols` A `rump.fields.Symbols` table used to store symbolic ...
2.734375
3
tests/__init__.py
adelosa/cardutil
0
30805
import binascii def print_stream(stream, description): stream.seek(0) data = stream.read() print('***' + description + '***') print(data) stream.seek(0) def test_message(encoding='ascii', hex_bitmap=False): binary_bitmap = b'\xF0\x10\x05\x42\x84\x61\x80\x02\x02\x00\x00\x04\x00\x00\x00\x00' ...
2.78125
3
bot/discordbot.py
DuckMcFuddle/forum-sweats
2
30806
<filename>bot/discordbot.py from .betterbot import BetterBot from . import commands from datetime import datetime, timedelta import importlib import discord import asyncio import modbot import forums import base64 import json import time import os import db intents = discord.Intents.default() intents.members = True in...
2.421875
2
management/commands/start_taskforce.py
mallipeddi/django-taskforce
3
30807
<gh_stars>1-10 import sys from optparse import make_option from django.core.management.base import BaseCommand from django.conf import settings import taskforce class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--verbose', action='store_true', dest='verbose', ...
2.078125
2
profiles/migrations/0004_profile_smapply_user_data.py
umarmughal824/bootcamp-ecommerce
2
30808
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-09-13 18:42 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [("profiles", "0003_profile_smapply_id")] operations = [ ...
1.765625
2
Lists/list_of_beggars.py
petel3/Softuni_education
2
30809
string = input().split(", ") beggars = int(input()) beggars_list = [] for x in range(0, beggars): temp = string[x::beggars] for j in range(0, len(temp)): temp[j] = int(temp[j]) beggars_list.append(sum(temp)) print(beggars_list)
3.390625
3
python/locate_2D_array1.py
leewalter/coding
0
30810
<filename>python/locate_2D_array1.py # python to locate 1 in a 2D array #below save it into a dictionary # python to locate 1 in a 2D array def check_zero(array1): d = {} print("array index zeros at:") for i in range(len(array1)): index = [k for k, v in enumerate(array1[i]) if v == 0] d[i...
4.1875
4
tests/__init__.py
RonenTRA/faster-than-requests
857
30811
# Allow tests/ directory to see faster_than_requests/ package on PYTHONPATH import sys from pathlib import Path sys.path.append(str(Path(__file__).parent.parent))
1.5
2
fib_optimizer/fib_optimizer.py
dbarrosop/sir_tools
9
30812
<filename>fib_optimizer/fib_optimizer.py #!/usr/bin/env python from pySIR.pySIR import pySIR import argparse import datetime import json import os import shlex import subprocess import sys import time import logging logger = logging.getLogger('fib_optimizer') log_format = '%(asctime)s - %(name)s - %(levelname)s - %...
2.359375
2
Py_Print_Function_With_Loop.py
ZeroHero77/PythonChallenges
0
30813
import re n = int(input()) def loopai(n): x = [i+1 for i in range(n)] z = x print(re.sub(' ','',re.sub('\,','',re.sub('\]','',re.sub('\[','',str(z)))))) def main(): loopai(n) if __name__ == '__main__': main()
3.734375
4
good_spot/common/views.py
jasmine92122/NightClubBackend
0
30814
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from django.conf import settings from django.http.response import HttpResponse from django.views.generic import View class HealthCheckView(View): def get(self, request, *args, **kwargs): return HttpResponse(settings.HEALTH_C...
1.820313
2
year2020/day21/test_reader.py
Sebaestschjin/advent-of-code
0
30815
from assertpy import assert_that import year2020.day21.reader as reader def test_example(): lines = ['mxmxvkd kfcds sqjhc nhms (contains dairy, fish)\n', 'trh fvjkl sbzzf mxmxvkd (contains dairy)\n', 'sqjhc fvjkl (contains soy)\n', 'sqjhc mxmxvkd sbzzf (contains fish)\n'] ...
2.796875
3
realtime_hand_3d/segmentation/utils/data_utils.py
NeelayS/realtime_hand
0
30816
<reponame>NeelayS/realtime_hand<filename>realtime_hand_3d/segmentation/utils/data_utils.py import cv2 as cv import numpy as np import os import shutil import torch from torchvision import io def resize_image( image, expected_size, pad_value, ret_params=True, mode=cv.INTER_LINEAR ): """ image (ndarray) wi...
2.703125
3
intro/hello.py
ANU-WALD/acawsi
1
30817
<filename>intro/hello.py name = "Sharalanda" age = 10 hobbies = ["draw", "swim", "dance"] address = {"city": "Sebastopol", "Post Code": 1234, "country": "Enchantia"} print("My name is", name) print("I am", age, "years old") print("My favourite hobbie is", hobbies[0]) print("I live in", address["city"])
3.390625
3
python/array/1550_three_consecutive_odds.py
linshaoyong/leetcode
6
30818
class Solution(object): def threeConsecutiveOdds(self, arr): """ :type arr: List[int] :rtype: bool """ odds = 0 for a in arr: if a % 2 == 1: odds += 1 if odds >= 3: return True else: ...
3.78125
4
src/third_party/wiredtiger/tools/wtperf_stats/3rdparty/nvd3/NVD3Chart.py
rueckstiess/mongo
0
30819
<filename>src/third_party/wiredtiger/tools/wtperf_stats/3rdparty/nvd3/NVD3Chart.py #!/usr/bin/python # -*- coding: utf-8 -*- """ Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Proje...
2.453125
2
pycaz/lib/s3_objects.py
jmunhoz/pycaz
0
30820
# Copyright (c) 2018 <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 # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, di...
1.804688
2
mmdet/models/losses/dice_loss.py
liuyanyi/mmdetection
0
30821
<filename>mmdet/models/losses/dice_loss.py import torch import torch.nn as nn import torch.nn.functional as F from ..builder import LOSSES @LOSSES.register_module() class DiceLoss(nn.Module): def __init__(self, use_sigmoid=True, loss_weight=1.0): """`Dice Loss <https://arxiv.org/abs/1912.04488>` ...
2.921875
3
model/contact.py
Keith234/python_training
0
30822
<reponame>Keith234/python_training from sys import maxsize class Contact: def __init__(self, first_name=None, middlename=None, lastname=None, nicknam=None, title=None, company=None, address=None, home=None, mobile=None, work=None, fax=None, email=None, email2=None, email3=None, ...
3.296875
3
test/manager_drmaa_test.py
jmchilton/pulsar
0
30823
from .test_utils import ( BaseManagerTestCase, skip_unless_module ) from pulsar.managers.queued_drmaa import DrmaaQueueManager class DrmaaManagerTest(BaseManagerTestCase): def setUp(self): super(DrmaaManagerTest, self).setUp() self._set_manager() def tearDown(self): super(Dr...
1.914063
2
nerddiary/user/user.py
mishamsk/nerddiary
0
30824
<filename>nerddiary/user/user.py """ User model """ from __future__ import annotations from datetime import tzinfo import pytz from pydantic import BaseModel, PrivateAttr, validator from pydantic.fields import Field from ..poll.poll import Poll from ..primitive.timezone import TimeZone from ..report.report import R...
2.3125
2
Testes/Trabalho/album.py
matheusmenezs/com220
0
30825
<filename>Testes/Trabalho/album.py import tkinter as tk from tkinter import ttk from tkinter import simpledialog, messagebox import os.path import pickle class Album(): def __init__(self, nome, artista, ano, faixas): self.__nome = nome self.__artista = artista self.__ano = ano self...
3.28125
3
src/otest/aus/app.py
rohe/otest
2
30826
<reponame>rohe/otest import logging import os from oic.utils.http_util import BadRequest from oic.utils.http_util import SeeOther from otest.events import EV_HTTP_ARGS from otest.result import safe_url __author__ = 'roland' logger = logging.getLogger(__name__) class WebApplication(object): def __init__(self, ...
2.28125
2
my_weather_api/handlers.py
swingthrough/weather-api-task-django
0
30827
<reponame>swingthrough/weather-api-task-django<gh_stars>0 from .serializers import WeatherForecastDaySerializer from .models import WeatherForecastDay from datetime import datetime, timedelta import requests from decouple import config import json DATE_FORMAT = '%Y-%m-%d' COUNTRY_CODES_TO_CAPITAL = { 'CZ': 'Prague...
2.765625
3
app/blueprints/printing/__init__.py
OrigamiCranes/PrintingPortal
0
30828
<gh_stars>0 from flask import Blueprint, url_for bp = Blueprint('printing', __name__,template_folder='templates') from . import routes, forms
1.570313
2
csbiginteger/BigIntegerNet.py
NeoResearch/csBigInteger.py
2
30829
<gh_stars>1-10 #!/usr/bin/python3 from csbiginteger.BigInteger import BigInteger from functools import total_ordering # requires: pip install msl-loadlib pycparser pythonnet from msl.loadlib import LoadLibrary # remember to execute first: cd csbiginteger/dotnet && dotnet build -c Release net = LoadLibrary('csbigin...
2.25
2
cdci_spiacs_plugin/spiacs_lightcurve_query.py
andreatramacere/cdci_spiacs_plugin
0
30830
<reponame>andreatramacere/cdci_spiacs_plugin """ Overview -------- general info about this module Classes and Inheritance Structure ---------------------------------------------- .. inheritance-diagram:: Summary --------- .. autosummary:: list of the module you want Module API ---------- """ from __future__ im...
2
2
addons/basic.py
dico-api/dicobot
1
30831
import dico_command class Basic(dico_command.Addon): @dico_command.command("ping") async def ping(self, ctx: dico_command.Context): await ctx.reply(f"Pong! {round(self.bot.ping*1000)}ms") def load(bot: dico_command.Bot): bot.load_addons(Basic) def unload(bot: dico_command.Bot): bot.unload_...
2.34375
2
lambda_code/lambda_function.py
ReadingPlus/aurora-gfs-snapshot-tool
2
30832
#!/usr/bin/env python3 from datetime import datetime, timezone, date import os import sys import boto3 import logging import json #setup global logger logger = logging.getLogger("SnapTool") #set log level LOGLEVEL = os.environ['LogLevel'].strip() logger.setLevel(LOGLEVEL.upper()) logging.getLogger("botocore").setLeve...
2.3125
2
bench/models.py
jareddk/bench
0
30833
import torch from fielder import FieldClass import yaml class ModelBase(FieldClass, torch.nn.Module): """Base Model Class""" class FCNet(ModelBase): d_in: int = 10 H: int = 100 n_hidden: int = 1 D_out: int = 1 def __post_init__(self): super().__post_init__() self.input_linea...
2.4375
2
pytope/demo.py
XuShenLZ/pytope
0
30834
import numpy as np from pytope import Polytope import matplotlib.pyplot as plt np.random.seed(1) # Create a polytope in R^2 with -1 <= x1 <= 4, -2 <= x2 <= 3 lower_bound1 = (-1, -2) # [-1, -2]' <= x upper_bound1 = (4, 3) # x <= [4, 3]' P1 = Polytope(lb=lower_bound1, ub=upper_bound1) # Print the halfspace represen...
3.5625
4
apetools/commands/ifconfig.py
rsnakamura/oldape
0
30835
#python libraries import re import os # this package from apetools.baseclass import BaseClass from apetools.commons import enumerations from apetools.commons import expressions from apetools.commons.errors import ConfigurationError MAC_UNAVAILABLE = "MAC Unavailable (use `netcfg`)" class IfconfigError(Configuration...
2.6875
3
neat-paralle-sonic.py
healthpotionstudios/MarioWorldAI-NEAT
7
30836
import retro # pip install gym-retro import numpy as np # pip install numpy import cv2 # pip install opencv-python import neat # pip install neat-python import pickle # pip install cloudpickle class Worker(object): def __init__(self, genome, config): self.genome = genome ...
2.421875
2
shapespace/eval_shapespace.py
Chumbyte/DiGS
0
30837
<filename>shapespace/eval_shapespace.py # <NAME> (Itzik) <<EMAIL>> # <NAME> <<EMAIL>> import os, sys, time sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from shapespace.dfaust_dataset import DFaustDataSet import torch import utils.visualizations as vis import numpy as np import models.DiG...
1.976563
2
html/semantics/scripting-1/the-script-element/module/resources/delayed-modulescript.py
meyerweb/wpt
14,668
30838
<filename>html/semantics/scripting-1/the-script-element/module/resources/delayed-modulescript.py<gh_stars>1000+ import time def main(request, response): delay = float(request.GET.first(b"ms", 500)) time.sleep(delay / 1E3) return [(b"Content-type", b"text/javascript")], u"export let delayedLoaded = true;"
2.15625
2
ingestion/src/metadata/utils/sql_lineage.py
TeddyCr/OpenMetadata
0
30839
<gh_stars>0 # Copyright 2021 Collate # 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 in writi...
1.789063
2
dcgan/utils/train.py
Ontheway361/ak47GAN
0
30840
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import time import torch import numpy as np import torchvision import torch.nn as nn import torch.optim as optim import matplotlib.pyplot as plt from torch.utils.data import DataLoader from utils import * from IPython import embed class DCGAN(o...
2.28125
2
testscripts/RDKB/component/sysutil/TS_SANITY_CheckLanMode_AfterReboot.py
cablelabs/tools-tdkb
0
30841
########################################################################## # If not stated otherwise in this file or this component's Licenses.txt # file the following copyright and licenses apply: # # Copyright 2018 RDK Management # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
1.359375
1
fsrobo_r_driver/fsrobo_r_controller/info_catch_client.py
FUJISOFT-Robotics/fsrobo_r
4
30842
#!/usr/bin/env python # -*- coding: utf-8 -*- # FSRobo-R Package BSDL # --------- # Copyright (C) 2019 FUJISOFT. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributions of source code...
1.390625
1
src/models/spikeconvnet.py
k-timy/snn_pytorch
0
30843
<filename>src/models/spikeconvnet.py<gh_stars>0 """ Author: <NAME> April 2021 """ import torch import torch.nn as nn import torch.nn.functional as F from .convnet import ConvNet from .spikingconv2D import SpikingConv2D from .spikingpool2D import SpikingAveragePool2D from .spikinglinear import SpikingLinear class Spike...
2.703125
3
test/test_linked_list.py
kessler-oliveira/linkedlist
0
30844
import unittest from random import randint from model.node import Node from model.linked_list import LinkedList SIZE = 5 class TestLinkedList(unittest.TestCase): def test_copy(self): nodes = [] for i in range(SIZE): nodes.append(Node(i)) if i: nodes[i - 1...
3.234375
3
res/pygments/ptx.py
wilwxk/GPUCompiler.jl
68
30845
from pygments.lexer import RegexLexer, include, words from pygments.token import * # https://docs.nvidia.com/cuda/parallel-thread-execution/index.html class CustomLexer(RegexLexer): string = r'"[^"]*?"' followsym = r'[a-zA-Z0-9_$]*' identifier = r'(?:[a-zA-Z]' + followsym + r'| [_$%]' + followsym + r')' ...
2.453125
2
tests/test_dork_erd.py
msudenvercs/Dork
1
30846
# -*- coding: utf-8 -*- """Basic tests for state and entity relationships in dork """ import dork.types from tests.utils import has_many, is_a def test_items_exist(): """the dork module should define an Item """ assert "Item" in vars(dork.types) is_a(dork.types.Item, type) def test_holders_exist(): ...
2.640625
3
woffle/data/parse.py
Finnkauski/woffle
0
30847
<reponame>Finnkauski/woffle """ text cleaning """ #-- Imports --------------------------------------------------------------------- # base import functools import re # third party import toml # project from woffle.functions.compose import compose #-- Definitions ----------------------------------------------------...
2.53125
3
tpRigToolkit/libs/ziva/core/utils.py
tpRigToolkit/tpRigToolkit-libs-ziva
0
30848
<reponame>tpRigToolkit/tpRigToolkit-libs-ziva<gh_stars>0 #! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains utils functions related with Ziva plugin """ from __future__ import print_function, division, absolute_import from tpDcc import dcc PLUGIN_NAME = 'ziva' def load_ziva_plugin(): if n...
1.679688
2
algolearn/coderunner.py
gda2048/algo_deep
8
30849
<reponame>gda2048/algo_deep import json import sys import io import time from wrapt_timeout_decorator import * from contextlib import redirect_stdout class Checker: def __init__(self, questions, answers, user_answers): self.questions = questions['questions'] self.answers = answers["answers"] ...
2.5625
3
scaffold/iam/cf_builder.py
mccormickmichael/laurel
1
30850
<reponame>mccormickmichael/laurel from datetime import datetime from .cf_template import IAMTemplate from scaffold.cf.stack.builder import StackBuilder class IAMBuilder(StackBuilder): def __init__(self, args, session, is_update): super(IAMBuilder, self).__init__(args.stack_name, session, is_update) ...
1.875
2
editor/scheduler/__init__.py
iamsayem/smart-editor
0
30851
""" Created by Sayem on 14 March, 2021 All rights reserved. Copyright © 2020. """ from .celery import app as celery_app __author__ = "Sayem" __all__ = ["celery_app"]
0.988281
1
sippy/thrift_stub_dir/thrift/ttypes.py
devatsrs/neon.service
0
30852
<gh_stars>0 # # Autogenerated by Thrift Compiler (1.0.0-dev) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style1 # #from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.Thrift import TType, TMessageType, TException...
1.71875
2
Chapter 4 - Lists & Tuples/01_list.py
alex-dsouza777/Python-Basics
0
30853
<filename>Chapter 4 - Lists & Tuples/01_list.py #Create a list using [] a = [1,2,3,7,66] #print the list using print() function print(a) #Access using index using a[0], a[1], .... print(a[2]) #Changing the value of the list a[0] = 777 print(a) #We can create a list with items of different type b = [77,"Root",False,...
4.34375
4
lab_1/orthograph/errors1.py
etzinis/speech_nlp_labs
0
30854
<gh_stars>0 import math fco = open('train_co.txt', 'r') fwr =open('train_wr.txt', 'r') fcoal = open('train_co_al.txt', 'w') fwral =open('train_wr_al.txt', 'w') #first we align the two files colines = fco.readlines() wrlines = fwr.readlines() for i in colines: cols = i.split() for j in cols: fcoal.write(j+'\n') f...
2.78125
3
examples/basic/src/events/__init__.py
boosterl/rabbitmq-pika-flask
17
30855
__all__ = ['PingEvents']
1.101563
1
snowy_version_python2.py
cclauss/flake8_for_ow
0
30856
#!/usr/bin/env python2 # coding: utf-8 import sys def main(): s = ' '.join((u'❄ ☃ ❄', sys.version.split()[0], u'❄ ☃ ❄')) print(type(s)) return {'snowy_version': s} if __name__ == '__main__': main()
2.96875
3
scripts/ai.py
MaxReimann/Troen
0
30857
<filename>scripts/ai.py #AI is imported by default #this is only a test for now print "hello from aipy"
1.242188
1
answers/old/python/fizzBuzz.py
mschultz4/practice
0
30858
# Fizzbuzz.py import sys with open(sys.argv[1], 'r') as file: for line in file: nums = line.split() i = int(nums[2]) n = 1 output = "" while n <= i: if n % int(nums[0]) == 0 and n % int(nums[1]) == 0: output += "FB " elif n % int(nums...
3.21875
3
2parser/word_lists.py
formalabstracts/CNL-CIC
14
30859
singular = [ 'this','as','is','thesis','hypothesis','less','obvious','us','yes','cos', 'always','perhaps','alias','plus','apropos', 'was','its','bus','his','is','us', 'this','thus','axis','bias','minus','basis', 'praxis','status','modulus','analysis', 'aparatus' ] invariable = [ #frozen_li...
2.078125
2
tests/test_cue.py
philipdexter/pycue
6
30860
import pytest import cue def test_basic(): cue.compile('') assert '1' == str(cue.compile('1')) assert ['1', '2', '3', '{\n\ta: 1\n}'] == [str(v) for v in cue.compile('[1,2,3,{a:1}]')] assert [('a', '1'), ('b', '2')] == [(str(k), str(v)) for k, v in cue.compile('{a: 1, b: 2}')] with pytest.raises(cue.CueErr...
2.59375
3
control/tests/xferfcn_input_test.py
samlaf/python-control
1
30861
<reponame>samlaf/python-control<gh_stars>1-10 #!/usr/bin/env python # # xferfcn_input_test.py - test inputs to TransferFunction class # jed-frey, 18 Feb 2017 (based on xferfcn_test.py) import unittest import numpy as np from numpy import int, int8, int16, int32, int64 from numpy import float, float16, float32, float6...
2.90625
3
annodize/__init__.py
NowanIlfideme/annodize
0
30862
<gh_stars>0 """Python Annotations that are shockingly useful.""" __all__ = ["__version__", "Field", "FunctionFields", "NamespaceFields"] from .field import Field, FunctionFields, NamespaceFields from .version import __version__
1.34375
1
answers/leetcode/Summary Ranges/Summary Ranges.py
FeiZhan/Algo-Collection
3
30863
<filename>answers/leetcode/Summary Ranges/Summary Ranges.py class Solution(object): def summaryRanges(self, nums): """ :type nums: List[int] :rtype: List[str] """ range_list = [] for i in range(len(nums)): if i > 0 and nums[i - 1] + 1 == nums[i]: ...
3.375
3
tests/test_Policy.py
christophevg/py-mqfactory
0
30864
from mqfactory.tools import Policy, Rule, CATCH_ALL def test_empty_policy(): p = Policy() assert p.match({"something": "something"}) == CATCH_ALL assert p.match({}) == CATCH_ALL def test_policy(): p = Policy([ Rule({ "a": 1, "b": 1, "c": 1 }, "a=1,b=1,c=1" ), Rule({ "a": 1, "b": 1, ...
2.53125
3
test/test_request.py
Ryuno-Ki/webmention-tools
26
30865
<gh_stars>10-100 import unittest import pytest import requests import webmentiontools from webmentiontools.request import ( is_successful_response, request_get_url, request_head_url, request_post_url, USER_AGENT ) from .endpoints import WEBMENTION_ROCKS_TESTS class RequestTestCase(unittest.Test...
2.53125
3
sleep_utils.py
skjerns/NT1-HRV
1
30866
<filename>sleep_utils.py # -*- coding: utf-8 -*- """ Created on Thu Nov 21 20:19:26 2019 @author: skjerns """ from pyedflib.highlevel import * import os import gc import warnings import ospath #pip install https://github.com/skjerns/skjerns-utils import numpy as np import pyedflib #pip install https://github.com/skjer...
2.3125
2
amplpy/tests/TestBase.py
dish59742/amplpy
0
30867
<reponame>dish59742/amplpy<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from builtins import map, range, object, zip, sorted from .context import amplpy import unittest import tempfile import shutil import os class TestBase(unittest.TestCas...
2.265625
2
lib/MetaboliteAtlasImpl.py
kbaseIncubator/metabolite_atlas
0
30868
#BEGIN_HEADER #END_HEADER ''' Module Name: MetaboliteAtlas Module Description: A web-based atlas to liquid chromatography–mass spectrometry (LCMS) data ''' class MetaboliteAtlas: #BEGIN_CLASS_HEADER #END_CLASS_HEADER def __init__(self, config): #config contains contents of config file in hash or ...
2.265625
2
instance/config.py
Alexotieno1717/News-API
0
30869
class Config: """ General configuration parent class """ pass api_key = 'a493e30f11b147d0ba67b15ca60c5e4c' SECRET_KEY = '1234567890' class ProdConfig(Config): """ Production """ pass class DevConfig(Config): """ development """ DEBUG = True
1.789063
2
week2/decrypt.py
vtnil/Cryptography-I-Homework
0
30870
<filename>week2/decrypt.py # vtnil write for Cryptography1 week2 homework # ppt https://crypto.stanford.edu/~dabo/cs255/lectures/PRP-PRF.pdf from Crypto.Cipher import AES from binascii import a2b_hex from math import ceil questions = [ {"key": "140b41b22a29beb4061bda66b6747e14", "ct": "4ca00ff4c898d61e1ed...
3.578125
4
fastreid/modeling/meta_arch/AFF.py
SZLSP/reid2020NAIC
2
30871
<filename>fastreid/modeling/meta_arch/AFF.py import torch from torch import nn class MS_CAM(nn.Module): def __init__(self, C, H, W, r): """ MS_CAM is a module of AFF. Args: C: Channel H: Height W: Width r: channel reduction ratio. The channel ...
2.03125
2
17_process_thread/30_3_multithread_rlock.py
hemuke/python
0
30872
from threading import Thread num = 0 def do_sth(): global num for i in range(1000000): num += 1 adda() addb() def adda(): global num num += 1 def addb(): global num num += 1 t1 = Thread(target=do_sth) t2 = Thread(target=do_sth) t1.start() t2.start() t1.join() t2.join()...
3.546875
4
fn_aws_iam/fn_aws_iam/components/fn_aws_iam_deactivate_mfa_devices.py
nickpartner-goahead/resilient-community-apps
65
30873
<reponame>nickpartner-goahead/resilient-community-apps<filename>fn_aws_iam/fn_aws_iam/components/fn_aws_iam_deactivate_mfa_devices.py # -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved. # pragma pylint: disable=unused-argument, no-self-use """Function implementation""" import logging imp...
2.21875
2
bluebottle/clients/management/commands/new_tenant.py
terrameijar/bluebottle
10
30874
# coding=utf-8 from builtins import input from optparse import make_option from django.core import exceptions from django.utils.encoding import force_str from django.conf import settings from django.db.utils import IntegrityError from django.core.management import call_command from tenant_schemas.utils import get_ten...
2.140625
2
tests/util_image.py
parmarsuraj99/objax
2
30875
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.40625
2
alpyro_msgs/actionlib/testrequestresult.py
rho2/alpyro_msgs
1
30876
from alpyro_msgs import RosMessage, boolean, int32 class TestRequestResult(RosMessage): __msg_typ__ = "actionlib/TestRequestResult" __msg_def__ = "aW50MzIgdGhlX3Jlc3VsdApib29sIGlzX3NpbXBsZV9zZXJ2ZXIKCg==" __md5_sum__ = "61c2364524499c7c5017e2f3fce7ba06" the_result: int32 is_simple_server: boolean
2.0625
2
tests/test_pycolor.py
edonyzpc/toolkitem
3
30877
from __future__ import print_function import sys sys.path.append('./') from colorprinter.pycolor import PyColor from colorprinter.pycolor import cprint @PyColor('ured') def printer(string): a = 1 b = 2 print(str((a + b)**4) + string) class TestClass(object): def test_pycolor(self): printer('ed...
2.796875
3
app/main/views.py
chushijituan/job_analysis
45
30878
<gh_stars>10-100 # coding: utf-8 from . import main from flask import render_template, jsonify, flash, request, current_app, url_for, Response, g, abort @main.route('/') def index(): return render_template('index.html') @main.route('/about') def about_page(): return render_template('about.html')
2.28125
2
da4py/main/conformanceChecking/antiAlignmentBetweenNets.py
BoltMaud/da4py
2
30879
import itertools from pm4py.objects.petri.petrinet import PetriNet from da4py.main.objects.pnToFormulas import petri_net_to_SAT from da4py.main.utils import variablesGenerator as vg, formulas from da4py.main.utils.formulas import Or, And from da4py.main.utils.unSat2qbfReader import writeQDimacs, cadetOutputQDimacs, r...
2.09375
2
projects-import.py
kprussing/resume
0
30880
<gh_stars>0 #!/usr/bin/env python3 __doc__ = """Process a dump from the 'Charge Activity Report by Employee - Project Detail Information' report from Webwise. We only need the table view because we simply want to extract the fields. For this to work, we _must_ have the table headers. Those are used as the keys in th...
2.5
2
jenkins/docker_diff.py
smarterclayton/test-infra
0
30881
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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 required by appli...
2.390625
2
crawler/libs/extractors.py
riszkymf/pricefinder_full
1
30882
<filename>crawler/libs/extractors.py from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from s...
2.640625
3
bo/files/applicant/registulang/fileupload/pdf2txt/main.py
isoneday/KMS
0
30883
from src import mining from tkinter import filedialog from PyQt4 import QtGui dir=filedialog.askdirectory() direcciones, nomArchivo = mining.path(dir) cont=mining.coincidencias(direcciones,nomArchivo) for i in range(len(nomArchivo)): print(nomArchivo[i],cont[i])
2.328125
2
src/platform/jboss/fingerprints/JBoss71Manage.py
0x27/clusterd
539
30884
<filename>src/platform/jboss/fingerprints/JBoss71Manage.py from src.platform.jboss.interfaces import JINTERFACES from cprint import FingerPrint class FPrint(FingerPrint): def __init__(self): self.platform = "jboss" self.version = "7.1" self.title = JINTERFACES.MM self.uri = "/...
1.75
2
ip_system/models.py
9dev/django-ip-system
0
30885
from django.db import models from .utils import get_ip_from_request class Ip(models.Model): address = models.GenericIPAddressField(unique=True, db_index=True) @classmethod def get_or_create(cls, request): raw_ip = get_ip_from_request(request) if not raw_ip: return None ...
2.609375
3
qs_backend/qs_backend/backend.py
Praneesh/quickstocks
2
30886
#! /usr/bin/env python3 # __author__ = "<NAME>" # __credits__ = [] # __version__ = "0.2.1" # __maintainer__ = "<NAME>" # __email__ = "<EMAIL>" # __status__ = "Prototype" # # Responsible for starting the required number of processes and threads import threading import time from qs_backend.workers....
2.734375
3
binary_tree/tests/m_create_from_pre_in_test.py
dhrubach/python-code-recipes
0
30887
<filename>binary_tree/tests/m_create_from_pre_in_test.py from binary_tree.m_create_from_pre_in import BinaryTree class TestBinaryTree: def test_lc_data_1(self): bt = BinaryTree() preorder = [3, 9, 20, 15, 7] inorder = [9, 3, 15, 20, 7] ans = bt.buildFromPreInOrder(preorder=preorde...
3.015625
3
3/part_1.py
szabolcs-dekany/advent-of-code-2021
0
30888
from collections import Counter from utils import read_bits def run_part_one(): print("--------------------------------") print("Advent of Code 2021 - 3 - Part 1") bits = read_bits('input.txt') gamma_rate = "" epsilon_rate = "" for x in range(len(bits[0])): relevant_bits = get_relevan...
3.671875
4
zhaquirks/xiaomi/aqara/plug.py
danielbrunt57/zha-device-handlers
0
30889
<filename>zhaquirks/xiaomi/aqara/plug.py """Xiaomi lumi.plug plug.""" import logging from zigpy.profiles import zha from zigpy.zcl.clusters.general import ( AnalogInput, Basic, BinaryOutput, DeviceTemperature, Groups, Identify, OnOff, Ota, PowerConfiguration, Scenes, Time, )...
2
2
learners/fully_observed_learner.py
Aaron-Jin-Xu/probabilistic-semantic-image-inpainting
1
30890
import os import sys import json import time import numpy as np import tensorflow as tf from blocks.helpers import Monitor from blocks.helpers import visualize_samples, get_nonlinearity, int_shape, get_trainable_variables, broadcast_masks_np from blocks.optimizers import adam_updates import data.load_data as load_data ...
2.125
2
tests/unit/test_source/test_sourcebase.py
rbogdanoff/reactiveaws
0
30891
from nose.tools import * from unittest.mock import patch, Mock from rxaws.source.sourcebase import SourceBase from botocore.client import BaseClient class BaseClient(Mock): """ mock boto BaseClient, won't really do anything""" class TestSourceBase: # inject the mock BaseClient @patch('boto3.client', retu...
2.5625
3
tests/events/events_client_test.py
riaz-bordie-cko/checkout-sdk-python
0
30892
import pytest from checkout_sdk.events.events import RetrieveEventsRequest from checkout_sdk.events.events_client import EventsClient @pytest.fixture(scope='class') def client(mock_sdk_configuration, mock_api_client): return EventsClient(api_client=mock_api_client, configuration=mock_sdk_configuration) class T...
1.976563
2
vectornet/trainer.py
chickenfingerwu/pytorch-CycleGAN-and-pix2pix
0
30893
from __future__ import print_function import os import numpy as np from tqdm import trange from models import * from utils import save_image class Trainer(object): def __init__(self, config, batch_manager): tf.compat.v1.set_random_seed(config.random_seed) self.config = config self.batch_m...
2.203125
2
Exercicios/010.py
sleepinhoo/Python
0
30894
grana = float(input("Informe a quantidade de dinherio: R$")) dolar = 5.4 print(f" Dá pra comprar USS${grana / dolar} com o valor atual na sua carteira") print(f"Cotação usada: {dolar}")
3.78125
4
src/11/zero_copy_sending_and_receiving_of_large_arrays/server.py
tuanavu/python-gitbook
14
30895
from zerocopy import send_from from socket import * s = socket(AF_INET, SOCK_STREAM) s.bind(('', 25000)) s.listen(1) c,a = s.accept() import numpy a = numpy.arange(0.0, 50000000.0) send_from(a, c) c.close()
1.859375
2
YNet/stage2/Model.py
cancertech/-cancer_diagnosis
126
30896
<gh_stars>100-1000 # # author: <NAME> # Project Description: This repository contains source code for semantically segmenting WSIs; however, it could be easily # adapted for other domains such as natural image segmentation # File Description: This file contains the CNN models # =======================...
2.421875
2
src/ast/socps/__init__.py
cvxgrp/qcml
26
30897
<reponame>cvxgrp/qcml<gh_stars>10-100 """ Technically, a every problem is a program; but not every program is a problem. This distinction only really matters if we introduce nodes for For loops and whatnot. Then the problem has 'program-like' constructs. """
1.28125
1
touchdown/goals/snapshot.py
yaybu/touchdown
14
30898
<reponame>yaybu/touchdown<gh_stars>10-100 # Copyright 2015 Isotoma Limited # # 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...
2.0625
2
crawler_main.py
yangwenke2010/template_crawler
4
30899
<reponame>yangwenke2010/template_crawler #!/bin/bash # -*- coding: utf-8 -*- # Crawler Main # # Author : <NAME> # Date : 2018-07-19 from do.crawler import Do from sys import argv if __name__ == "__main__": '''Crawler Main Start crawl websites with appointed config. ''' # You will get appointe...
2.40625
2