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 |
|---|---|---|---|---|---|---|
791A.py | blurryface92/CodeForces | 1 | 12775351 | <reponame>blurryface92/CodeForces<gh_stars>1-10
n = input()
split =n.split()
limak = int(split[0])
bob = int(split[-1])
years = 0
while True:
limak*=3
bob*=2
years+=1
if limak>bob:
break
print(years)
| 3.0625 | 3 |
tools/homer/makeUCSCfile.py | globusgenomics/galaxy | 1 | 12775352 | #!/usr/bin/python
CHUNK_SIZE = 2**20 #1mb
import argparse, os, shutil, subprocess, sys, tempfile, shlex, vcf, pysam
parser = argparse.ArgumentParser(description='')
parser.add_argument ( '--input', dest='input', help='the bed file')
parser.add_argument ( '-o', dest='output', help='output log file' )
def execute( cm... | 2.390625 | 2 |
ztag/annotations/FtpKebi.py | justinbastress/ztag | 107 | 12775353 | <gh_stars>100-1000
import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag import protocols
import ztag.test
class FtpKebi(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
impl_re = re.compile("^220- Kebi FTP Server", ... | 2.046875 | 2 |
FusionIIIT/applications/online_cms/admin.py | paras11agarwal/FusionIIIT | 0 | 12775354 | from django.contrib import admin
from .models import (Assignment, CourseDocuments, CourseVideo, Forum,
ForumReply, Quiz, QuizQuestion, QuizResult, StudentAnswer,
StudentAssignment)
admin.site.register(CourseDocuments)
admin.site.register(CourseVideo)
admin.site.register(Quiz)... | 1.484375 | 1 |
test.py | puiterwijk/rpm-head-signing | 1 | 12775355 | from tempfile import mkdtemp
import hashlib
from shutil import rmtree, copy
import os
import os.path
import subprocess
import struct
import sys
import unittest
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
from cryptography.hazmat.primiti... | 2.25 | 2 |
notebooks/converted_notebooks/Frederick_ipts.py | mabrahamdevops/python_notebooks | 0 | 12775356 | <gh_stars>0
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# + [markdown] run_control={"frozen": fals... | 1.679688 | 2 |
app/models.py | khiranouchi/Okemowd2 | 0 | 12775357 | <filename>app/models.py<gh_stars>0
from django.db import models
class Genre(models.Model):
# id primary_key [made automatically]
name = models.CharField(max_length=16)
def __str__(self):
return self.name
class KeyLevel(models.Model):
# id primary_key [made automatically]
rank = models.I... | 2.453125 | 2 |
uwhpsc/codes/python/debugdemo1.py | philipwangdk/HPC | 0 | 12775358 | <gh_stars>0
"""
$UWHPSC/codes/python/debugdemo1.py
Debugging demo using pdb. Original code.
"""
x = 3
y = -22.
def f(z):
x = z+10
return x
y = f(x)
print "x = ",x
print "y = ",y
| 2.453125 | 2 |
arduCryoFridgeCLI.py | emilyychenn/arduinoCryoFridge | 0 | 12775359 | """
Usage:
arduCryoFridgeCLI.py [--port=<USBportname>] configure [--ontime=<ontime>] [--offtime=<offtime>]
arduCryoFridgeCLI.py [--port=<USBportname>] switch [--on | --off] [--now | --delay=<delay>]
arduCryoFridgeCLI.py [--port=<USBportname>] (-s | --status)
arduCryoFridgeCLI.py [--port=<USBportname>] -q
ardu... | 3.03125 | 3 |
2019/day11.py | coingraham/adventofcode | 5 | 12775360 | import aoc_common as ac
import numpy as np
from aocd.models import Puzzle
puzzle = Puzzle(year=2019, day=11)
ram = [int(x) for x in puzzle.input_data.split(",")]
pointer = 0
relative_base = 0
painting = {(0, 0): 0}
coord = (0, 0)
color = 0 # Part One
color = 1 # Part Two
direction = "N"
our_computer = ac.full_intco... | 2.875 | 3 |
app.py | jschmidtnj/FizzBuzz | 0 | 12775361 | fizz = 3
buzz = 5
upto = 100
for n in range(1,(upto + 1)):
if n % fizz == 0:
if n % buzz == 0:
print("FizzBuzz")
else:
print("Fizz")
elif n % buzz == 0:
print("Buzz")
else:
print(n)
| 3.875 | 4 |
library/pip_dep_generator.py | DanielOjalvo/execview | 0 | 12775362 | <gh_stars>0
#!/usr/bin/env python3
'''
test script for collecting module dependencies used
'''
import re, os, isoparser
import itertools
import tempfile
import subprocess
def exec_cmd(cmd_str):
stdout_tmp = tempfile.TemporaryFile()
stderr_tmp = tempfile.TemporaryFile()
stdout_str = ""
stderr_str = ""... | 2.5625 | 3 |
main/coin-change/coin-change.py | EliahKagan/old-practice-snapshot | 0 | 12775363 | #!/usr/bin/env python3
def count_combos(coins, total):
len_coins = len(coins)
memo = {}
def count(tot, i):
if tot == 0:
return 1
if i == len_coins:
return 0
subproblem = (tot, i)
try:
return memo[subproblem]
except KeyError:
... | 3.8125 | 4 |
pca-server/src/pca/pca-aws-file-drop-trigger.py | Harsh15021992/amazon-transcribe-post-call-analytics | 8 | 12775364 | """
This python function is triggered when a new audio file is dropped into the S3 bucket that has
been configured for audio ingestion. It will ensure that no Transcribe job already exists for this
filename, and will then trigger the main Step Functions workflow to process this file.
Copyright Amazon.com, Inc. or its... | 2.90625 | 3 |
front_end/load/process_result/BenchmarkResult.py | arnaudsjs/YCSB-1 | 0 | 12775365 | <filename>front_end/load/process_result/BenchmarkResult.py
#!/bin/python
from load.process_result.Measurement import Measurement
class BenchmarkResult:
def __init__(self, pathToFile):
self.throughput = -1;
self.insertResults = Measurement()
self.updateResults = Measurement();
... | 2.53125 | 3 |
python/jimmy_plot/clk_tuner.py | JimmyZhang12/predict-T | 0 | 12775366 | import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import plot_voltage
import pdn_params as pdn
from cython.sim_pdn import sim_throttling_wrapper
TEST_LIST_spec=[
"429.mcf",
"433.milc",
"435.gromacs",
"436.cactusADM",
"437.leslie3d",... | 2.21875 | 2 |
before/0124/11021.py | Kwak-JunYoung/154Algoritm-5weeks | 3 | 12775367 | ans = []
n = int(input())
for i in range(n):
a, b = list(map(int, input().split()))
ans.append(a + b)
for i in range(len(ans)):
print("Case #{}: {}".format(i+1, ans[i])) | 2.921875 | 3 |
era/apps/user/decorators.py | doctorzeb8/django-era | 1 | 12775368 | from django.contrib import auth
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.shortcuts import redirect
from era.utils.functools import unidec, omit
@unidec
def role_required(method, req, *args, **kw):
if req.user.role in kw.get('allow', ... | 1.867188 | 2 |
pageobjects/optionhandler.py | charleshamel73/robot-pageobjects | 1 | 12775369 | from _metaflyweight import MetaFlyWeight
from context import Context
from exceptions import VarFileImportErrorError
from robot.libraries.BuiltIn import BuiltIn
import os
import re
import imp
class OptionHandler(object):
"""
This class is a Flyweight for the options
Example:
OptionHandler(LoginPage... | 2.515625 | 3 |
tests/unittests/commands/test_cmd_cs_beacon.py | f5devcentral/f5-cli | 13 | 12775370 | """ Test Beacon command """
import json
from f5sdk.cs import ManagementClient
from f5sdk.cs.beacon.insights import InsightsClient
from f5sdk.cs.beacon.declare import DeclareClient
from f5sdk.cs.beacon.token import TokenClient
from f5cli.config import AuthConfigurationClient
from f5cli.commands.cmd_cs import cli
fro... | 2.125 | 2 |
phfnbutils/store.py | phfaist/phfnbutils | 0 | 12775371 | import os
import os.path
import sys
import logging
logger = logging.getLogger(__name__)
import numpy as np
import inspect
import datetime
import hashlib
import functools
import h5py
import filelock
import multiprocessing
import itertools
import random
from tqdm.auto import tqdm
#
# utilities for my hdf5 dataset... | 1.945313 | 2 |
world.py | ano0002/Level-One-Again | 0 | 12775372 | from ursina import *
from objects import ThreeD_Button,Laser
class Level(Entity):
def __init__(self,base,next,player):
super().__init__(model = None,position = (0,0,0))
self.base = base
self.base[0].set_level(self)
for elem in self.base :
elem.parent = self
... | 2.5 | 2 |
src/model.py | Awagi/wiki-update-tracker | 0 | 12775373 | from tracker import (
GitFile,
TranslationGitFile,
GitPatch,
TranslationTrack,
ToCreateTranslationTrack,
ToInitTranslationTrack,
ToUpdateTranslationTrack,
UpToDateTranslationTrack,
OrphanTranslationTrack,
Status
)
from pathlib import Path
import os.path
from github_utils import (... | 2.328125 | 2 |
sp_api/auth/credentials.py | lionsdigitalsolutions/python-amazon-sp-api | 213 | 12775374 | import os
class Credentials:
def __init__(self, refresh_token, credentials):
self.client_id = credentials.lwa_app_id
self.client_secret = credentials.lwa_client_secret
self.refresh_token = refresh_token or credentials.refresh_token
| 1.914063 | 2 |
mathproblem/graph_transforms.py | matthewcpp/mathproblem | 0 | 12775375 | from .problem import Problem
from .trig_defs import RightAngleTrigFunction
from enum import Enum
from typing import List
import random
class TransformationType(Enum):
VerticalTranslation = 1
HorizontalTranslation = 2
VerticalStretchCompression = 3
HorizontalStretchCompression = 4
class GraphTransfo... | 2.953125 | 3 |
test/test_website_project_instance_api.py | hyperonecom/h1-client-python | 0 | 12775376 | """
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import unittest
import h1
from h1.api.website_project_instance_api import WebsiteProjectInstanceApi # noqa: E501
class TestWebsiteProjectInstanceApi(unittest.TestCa... | 2.234375 | 2 |
coach/SHL/client.py | LSTM-Kirigaya/NUAA-guandan | 0 | 12775377 | <filename>coach/SHL/client.py
# -*- coding: utf-8 -*-
# @Time : 2020/10/1 16:30
# @Author : <NAME>
# @File : client_pjh3.py
# @Description:
import json
from ws4py.client.threadedclient import WebSocketClient
from clients.state import State
from coach.SHL.action import Action_shl
class Main(WebSocket... | 2.15625 | 2 |
data/rotation/main.py | Wanzaz/projects | 3 | 12775378 | <filename>data/rotation/main.py
from tests import tests, test
"""
You are given list of numbers, obtained by rotating a sorted list an unknown number of times. Write a function to determine the minimum number of times the original sorted list was rotated to obtain the given list. Your function should have the wors... | 4.3125 | 4 |
lambdas/firehose-transform/index.py | craigbailey-dev/aws-codebuild-event-logs | 0 | 12775379 | <reponame>craigbailey-dev/aws-codebuild-event-logs<filename>lambdas/firehose-transform/index.py
import json
import base64
import traceback
from datetime import datetime
def handler(event, context):
output = []
for record in event["records"]:
try:
# Base64 decode record data and JSON parse d... | 2.3125 | 2 |
PythonSolutions/ItertoolsPermutations.py | MohamedMetwalli5/HackerRank_solutions | 37 | 12775380 | <reponame>MohamedMetwalli5/HackerRank_solutions
import itertools as it
x = input()
s = x.split(" ")[0]
k = int(x.split(" ")[1])
temp = list(it.permutations(s,k))
result = []
for item in temp:
result.append("".join(item))
list.sort(result)
for item in result:
print(item)
| 3.65625 | 4 |
tests/run_examples.py | DavidMetzIMT/pyEIT | 0 | 12775381 | import os
import subprocess
folder = r"./examples"
example = [
"eit_dynamic_bp.py",
"eit_dynamic_greit.py",
"eit_dynamic_jac.py",
"eit_dynamic_jac3d.py",
"eit_dynamic_stack.py",
"eit_dynamic_svd.py",
"eit_sensitivity2d.py",
"eit_static_GN_3D.py",
"eit_static_jac.py",
"fem_forwar... | 2.390625 | 2 |
examples/server_delete.py | sulidi-maimaitiming/cyberwatch_api_toolbox | 10 | 12775382 | <filename>examples/server_delete.py<gh_stars>1-10
'''Delete a Server'''
import os
from configparser import ConfigParser
from cbw_api_toolbox.cbw_api import CBWApi
CONF = ConfigParser()
CONF.read(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'api.conf'))
CLIENT = CBWApi(CONF.get('cyberwatch', 'url'), ... | 2.984375 | 3 |
tests.py | qiang123/regal | 432 | 12775383 | from unittest import TestCase
from regal import BaseInfo
from regal.grouping import GroupAlgorithm
from regal.check_interface import AlgorithmABC
# Run Method: python -m unittest -v tests.py
class TestBaseInfoInitial(TestCase):
def test_empty_info(self):
ab = BaseInfo('', '', '')
with self.assert... | 2.546875 | 3 |
core/pandajob/utils.py | kiae-grid/panda-bigmon-core | 0 | 12775384 | <filename>core/pandajob/utils.py
"""
pandajob.utils
"""
import pytz
import re
from datetime import datetime, timedelta
from django.conf import settings
from django.db.models import Q, Count
from ..common.settings import defaultDatetimeFormat
from ..common.models import JediJobRetryHistory
from ..common.models imp... | 1.695313 | 2 |
tests/test_extensions_parser.py | fokion/google_drive_extractor | 2 | 12775385 | <gh_stars>1-10
import os
import unittest
from extensions_parser import ExtensionsParser
class ExtensionsParserTest(unittest.TestCase):
def test_parse(self):
extensions = set()
extensions.update([".json", ".ai"])
parsed_extensions = ExtensionsParser.parse(os.path.join(os.getcwd(), "extensi... | 2.796875 | 3 |
insert.py | emmacunningham/court-reminder | 2 | 12775386 | import sys
from storage.models import Database
if len(sys.argv) != 2:
print("Usage: python insert.py <file> # file should contain one A Number per line.")
sys.exit(1)
alien_numbers = [line.strip().replace('-', '') for line in open(sys.argv[1])]
db = Database()
db.create_table() # checks if already exists
db.... | 2.90625 | 3 |
lwn.py | coderanger/cfp-scraper | 16 | 12775387 | import re
from datetime import date, datetime, time
import dateparser
import pytz
import requests
from bs4 import BeautifulSoup
import sessionize
def get(url):
res = requests.get(url)
return BeautifulSoup(res.text, 'html.parser')
def parse_page(root):
for evt_elm in root.select('.CalMEvent a'):
... | 2.828125 | 3 |
subsystems/elevator.py | FRCTeam279/2019mule | 0 | 12775388 | <reponame>FRCTeam279/2019mule
import math
import wpilib
from wpilib.command.subsystem import Subsystem
from wpilib import SmartDashboard
from commands.elevatormoveup import ElevatorMoveUp
from commands.elevatormovedown import ElevatorMoveDown
from commands.elevatorteleopdefault import ElevatorTeleopDefault
import subs... | 3.03125 | 3 |
python/AmcCarrierCore/AppTop/_TopLevel.py | slaclab/amc-carrier-core | 1 | 12775389 | #-----------------------------------------------------------------------------
# Title : PyRogue AMC Carrier Cryo Demo Board Application
#-----------------------------------------------------------------------------
# File : AppCore.py
# Created : 2017-04-03
#----------------------------------------------... | 1.390625 | 1 |
FASTAExtractPlugin.py | movingpictures83/FASTAExtract | 0 | 12775390 | <gh_stars>0
import PyPluMA
class FASTAExtractPlugin:
def input(self, filename):
params = open(filename, 'r')
self.parameters = dict()
for line in params:
contents = line.strip().split('\t')
self.parameters[contents[0]] = contents[1]
self.fasta = PyPluMA.prefix()+"/"+... | 2.75 | 3 |
textrank.py | VivekPandey0001/TextRank | 0 | 12775391 | '''
import numpy as np
import pandas as pd
import nltk
nltk.download('punkt') # one time execution
import re
we_df = pd.read_hdf('mini.h5', start = 0, stop = 100) # (362891, 300)
pi(we_df.shape)
words = we_df.index
pi(words)
pi(words[50000])
pi(we_df.iloc[50000])
mes = 'This is some demo text,... | 2.609375 | 3 |
inkscape-laser-cutter-engraver-master/makerwelt_raster_mcl1000.py | ilnanny/Inkscape-addons | 3 | 12775392 | <reponame>ilnanny/Inkscape-addons
'''
# ----------------------------------------------------------------------------
# Maintained by Maker-Welt (https://github.com/guiEmotiv/inkscape-laser-cutter-engraver)
# Designed to run on Ramps 1.4 + Marlin firmware on a MCL1000.
# Based on raster2gcode.py gcode inkscape extension... | 1.765625 | 2 |
paaws/cli/instance.py | gkope/paaws | 1 | 12775393 | """
Usage:
paaws instance detail [ --instance-id=<instance_id> ] [ --name=<app_name> --process=<process> --platform=<platform> --env=<env> ] --region=<region>
paaws instance list [ --instance-ids=<instance_ids> ] [ --name=<app_name> ] [ --process=<process> ] [ --platform=<platform> ] [ --env=<env> ] --region=<r... | 2.890625 | 3 |
wagtail_references/migrations/0001_initial.py | cividi/wagtail_references | 4 | 12775394 | <reponame>cividi/wagtail_references
# Generated by Django 2.1.4 on 2018-12-19 11:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.models
import wagtail.search.index
class Migration(migrations.Migration):
initial = True
depende... | 1.710938 | 2 |
constants.py | shamedgh/confine- | 0 | 12775395 | <reponame>shamedgh/confine-
SYSDIGERR = -1
NOPROCESS = -2
NOFUNCS = -3
NOATTACH = -4
CONSTOP = -5
HSTOPS = -6
HLOGLEN = -7
HNOKILL = -8
HNORUN = -9
CACHE = ".cache"
LIBFILENAME = "libs.out"
LANGFILENAME = ".lang.cache"
BINLISTCACHE = ".binlist.cache"
LIBLISTCACHE = ".liblist.cache"
BINTOLIBCACHE = ".binto... | 1.804688 | 2 |
textSmartEditor.py | hydrogen602/betterTextEditor | 3 | 12775396 | import time
import sys
from textEditor import TextEditor
from core import curses
# import completion
raise Exception
class TextSmartEditor(TextEditor):
'''
option-o to write out
option-q to quit
'''
def __init__(self):
super(TextSmartEditor, self).__init__()
self.marginRight = s... | 2.671875 | 3 |
oase-root/libs/commonlibs/mail/mail_common.py | wreathvine/oase-remove-file-test | 9 | 12775397 | # Copyright 2019 NEC Corporation
#
# 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.867188 | 2 |
tests/__init__.py | prajmus/pypi_changes | 24 | 12775398 | <filename>tests/__init__.py
from __future__ import annotations
import sys
from pathlib import Path
from typing import Callable
from unittest.mock import MagicMock
if sys.version_info >= (3, 8): # pragma: no cover (py38+)
from importlib.metadata import PathDistribution
else: # pragma: no cover (<py38)
from i... | 2 | 2 |
Woo2Bing.py | yoelsher/Woo2Bing | 0 | 12775399 | <reponame>yoelsher/Woo2Bing<filename>Woo2Bing.py
__author__ = 'www.yoelsher.com'
# Grab all data from xml
#import xml.etree.ElementTree as etree
from lxml import etree
import csv,re
inputFileName = 'funk120415.xml'
outputFileName = 'funk120415.txt'
dbFileName = 'funkierb_1C.csv'
brand = 'Funkier Bike'
sellerName = '<... | 2.671875 | 3 |
otcextensions/tests/functional/osclient/dcaas/v2/test_connection.py | gtema/python-otcextensions | 10 | 12775400 | <reponame>gtema/python-otcextensions
# 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 ... | 2.046875 | 2 |
memcload/__main__.py | stkrizh/otus | 1 | 12775401 | <gh_stars>1-10
import glob
import gzip
import logging
import multiprocessing as mp
import os
import sys
import time
from collections import Counter
from functools import partial
from optparse import OptionParser
from pathlib import Path
from typing import List
import memcache
from . import appsinstalled_pb2
from .ty... | 2.046875 | 2 |
train.py | mekomlusa/neural-network-genetic-algorithm | 1 | 12775402 | <reponame>mekomlusa/neural-network-genetic-algorithm
"""
Utility used by the Network class to actually train.
Based on:
https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
"""
from keras.datasets import mnist, cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout, Fla... | 3.375 | 3 |
chempy/properties/tests/test_water_density_tanaka_2001.py | matecsaj/chempy | 0 | 12775403 | <filename>chempy/properties/tests/test_water_density_tanaka_2001.py
import warnings
from chempy.units import allclose
from ..water_density_tanaka_2001 import water_density
def test_water_density():
warnings.filterwarnings("error")
assert abs(water_density(273.15 + 0) - 999.8395) < 0.004
assert abs(water_... | 2.359375 | 2 |
program_synthesis/models/modules/attention.py | sunblaze-ucb/SED | 6 | 12775404 | import numpy as np
import torch
import torch.nn.init as init
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from .layer_norm import LayerNorm
def maybe_mask(attn, attn_mask):
if attn_mask is not None:
assert attn_mask.size() == attn.size(), \
'Atten... | 2.453125 | 2 |
BookClub/tests/views/forum_views/test_edit_post_view.py | amir-rahim/BookClubSocialNetwork | 4 | 12775405 | """Unit testing of the Edit Post view"""
from django.test import TestCase, tag
from django.urls import reverse
from BookClub.models import User, ForumPost, Club
from BookClub.tests.helpers import reverse_with_next
@tag('views', 'forum', 'edit_post')
class EditPostViewTestCase(TestCase):
"""Tests of the Edit Post... | 2.890625 | 3 |
avr-libc/tests/simulate/readcore.py | avr-rust/avr-libc | 9 | 12775406 | #! /usr/bin/env python
# Copyright (c) 2008, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of c... | 1.460938 | 1 |
src/music-album.py | elanworld/music-album | 0 | 12775407 | # 根据图片和音乐合成带节奏的相册视频
from typing import Tuple, Union, Any
import moviepy.editor
from moviepy.video.fx.speedx import speedx
import wave
import numpy as np
import re
from progressbar import *
from common import python_box
from common import gui
import psutil
import time
import math
import moviepy.audio.fx.all
class Ffm... | 2.921875 | 3 |
src/dlt/randomizer_utils.py | thepolicylab/DLT-RESEA | 0 | 12775408 | import decimal
import math
import warnings
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from decimal import Decimal, localcontext
from itertools import repeat
from pathlib import Path
from time import time
from typing import List, Optional, Union
import numpy as np
import pandas as pd
from tq... | 2.125 | 2 |
neural_compressor/ux/utils/workload/tuning.py | intel/neural-compressor | 172 | 12775409 | # -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Intel Corporation
#
# 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 app... | 1.984375 | 2 |
src/piglowui.py | deanydean/py-piglow-sys | 1 | 12775410 | #!/usr/bin/python
#
# Copyright 2016 <NAME>
#
# 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 ... | 2.75 | 3 |
cogs/essentials/cog.py | jstan425/Cookie-Bot | 2 | 12775411 | <reponame>jstan425/Cookie-Bot
import disnake
import logging
import os
from disnake.ext import commands
from disnake.ext.commands import Param
class Essential(commands.Cog):
def __init__(self, bot:commands.Bot):
self.bot = bot
@commands.slash_command(description="Ping the bot!")
async def ping(se... | 2.265625 | 2 |
setup.py | adiralashiva8/jmeter-metrics | 12 | 12775412 | <gh_stars>10-100
from setuptools import setup, find_packages
filename = 'jmeter_metrics/version.py'
exec(compile(open(filename, 'rb').read(), filename, 'exec'))
setup(name='jmeter-metrics',
version=__version__,
description='Custom dashboard report for Jmeter',
long_description='Dashboard view of jme... | 1.367188 | 1 |
[5] MATH/1169 - Trigo no Tabuleiro.py | tiago040/URI-SOLUTIONS | 1 | 12775413 | '''
Uma rainha requisitou os serviços de um monge e disse-lhe que pagaria qualquer preço. O monge, necessitando de alimentos, perguntou a rainha se o pagamento poderia ser feito em grãos de trigo dispostos em um tabuleiro de damas, de forma que o primeiro quadrado tivesse apenas um grão, e os quadrados subseqüentes, o ... | 3.3125 | 3 |
threathunter_common_python/threathunter_common/bankcard_info/test.py | threathunterX/python_lib | 2 | 12775414 | <filename>threathunter_common_python/threathunter_common/bankcard_info/test.py
from bankcard_bin import get_issue_bank, get_card_type
if __name__ == "__main__":
fp = open( "data/bank_bin_info.csv", "r" )
lines = fp.readlines()
fp.close()
all_count = 0
matched_count = 0
not_matched_count = 0
... | 3.09375 | 3 |
horseback/chatobjects/chatobject.py | nasfarley88/horseback | 0 | 12775415 | class ChatObject:
def __init__(self, service, json):
"""Base class for objects emmitted from chat services."""
self.json = json
self.service = service
| 2.796875 | 3 |
mkmdtl/md.py | CounterPillow/mb2md | 0 | 12775416 | <reponame>CounterPillow/mb2md
from wcwidth import wcswidth
def get_max_title_len(tracklist):
"""Returns the visual length of the visually longest track in a tracklist.
"""
return max([wcswidth(x['title']) for x in tracklist])
def build_table(tracklist):
"""Takes a list of tracks in the form of {numb... | 3 | 3 |
shiSock-0.3.0/testing.py | AnanyaRamanA/shiSock | 0 | 12775417 | import socket
import base64
from random import sample,shuffle
import pickle
import time
def name_generator(_len_ = 16, onlyText = False):
lower_case = list("abcdefghijklmnopqrstuvwxyz")
upper_case = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
special = list("!@#$%&*?")
number = list("0123456789")
if onlyTe... | 2.5 | 2 |
backend/app/api/v1/dependencies/employee.py | avinash010/qxf2-survey | 1 | 12775418 | <reponame>avinash010/qxf2-survey<filename>backend/app/api/v1/dependencies/employee.py
"""
This module contains the methods related to the nodes with employee label in the database
"""
import os
import sys
from pandas import DataFrame
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(\
... | 2.796875 | 3 |
src/cania/utils/image.py | Cancer-Image-Analysis/cania-core | 0 | 12775419 | <reponame>Cancer-Image-Analysis/cania-core<filename>src/cania/utils/image.py
import tifffile
import cv2
import numpy as np
from cania.utils.vector import Vector
""" read images """
def read_rgb(filename):
return cv2.imread(filename, cv2.IMREAD_COLOR)
def read_gray(filename):
return cv2.imread(filename, cv... | 2.78125 | 3 |
project-euler/548/euler_548_v1.py | zoffixznet/project-euler | 0 | 12775420 | #!/usr/bin/env python
# The Expat License
#
# Copyright (c) 2017, <NAME>
#
# 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 u... | 2.25 | 2 |
benchmark_ofa_stereo.py | blackjack2015/once-for-all | 0 | 12775421 | # Once for All: Train One Network and Specialize it for Efficient Deployment
# <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# International Conference on Learning Representations (ICLR), 2020.
import os
import torch
import argparse
from ofa.stereo_matching.data_providers.stereo import StereoDataProvider
from ofa.stereo_mat... | 2.0625 | 2 |
tests/domain/book/test_book.py | tamanobi/dddpy | 170 | 12775422 | import pytest
from dddpy.domain.book import Book, Isbn
class TestBook:
def test_constructor_should_create_instance(self):
book = Book(
id="book_01",
isbn=Isbn("978-0321125217"),
title="Domain-Driven Design: Tackling Complexity in the Heart of Softwares",
pa... | 2.90625 | 3 |
tests/test_print_commands.py | PackeTsar/meraki-cli | 45 | 12775423 | <gh_stars>10-100
import unittest
from unittest.mock import patch
from io import StringIO
from .ParsedArgs import ParsedArgs
from .Function import Function
from meraki_cli.__main__ import Args, _print_commands
EXPECT = """
meraki organization getOrganizationNetworks --pos1 'positional1' --pos2 \
'positional2' --kwargs... | 2.859375 | 3 |
src/__init__.py | pipspec/pipspec | 0 | 12775424 | __author__ = '<NAME>'
__email__ = '<EMAIL>'
__version__ = '0.0.1'
| 1.023438 | 1 |
Steganography_1.py | zhaoyangding/Compression-with-Constraints-Steganography | 0 | 12775425 | import os
import sys
from PIL import Image
import numpy as np
import random
import matplotlib.pyplot as plt
size_image = (256, 256)
class LSB:
# convert integer to 8-bit binary
def int2bin(self, image):
r, g, b = image
return (f'{r:08b}', f'{g:08b}', f'{b:08b}')
# conve... | 3.265625 | 3 |
util/__init__.py | Str4thus/BraiNN | 0 | 12775426 | <filename>util/__init__.py
from .managers import HtmlManager | 1.226563 | 1 |
bot.py | menlen/jumaa | 0 | 12775427 | import os, sys
from PIL import Image, ImageDraw, ImageFont
import random, time
import telebot
from telebot.types import InlineKeyboardMarkup, InlineKeyboardButton
from telebot import types
TELEGRAM_TOKEN = '<KEY>'
bot = telebot.TeleBot(TELEGRAM_TOKEN)
channelId = -1001390673326
user_dict = {}
msgDict = ... | 2.1875 | 2 |
python/gilded_rose/processors/base.py | guilhermesimas/GildedRose-Refactoring-Kata | 0 | 12775428 | <gh_stars>0
from abc import ABC, abstractmethod
from gilded_rose.entities import Item
class BaseProcessor(ABC):
@abstractmethod
def process_item(self, item: Item, **kwargs):
pass
| 2.359375 | 2 |
cookie_demo/__init__.py | HarperHao/flask_study | 0 | 12775429 | <filename>cookie_demo/__init__.py
"""
Author : HarperHao
TIME : 2020/10/
FUNCTION:
"""
| 0.882813 | 1 |
pwn/decoutils.py | Haabb/pwnfork | 1 | 12775430 | def kwargs_remover(f, kwargs, check_list = None, clone = True):
'''Removes all the keys from a kwargs-list, that a given function does not understand.
The keys removed can optionally be restricted, so only keys from check_list are removed.'''
import inspect
if check_list == None: check_list = kwargs.k... | 3.109375 | 3 |
preferences/tests/test_views.py | rjw57/lecture-capture-preferences-webapp | 1 | 12775431 | import datetime
import itertools
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import dateparse, timezone
from furl import furl
from rest_framework.authtoken.models import Token
from rest_framework.test import APIRequestFactory, force_authenticate
from .. import vie... | 2.359375 | 2 |
invenio_records_presentation/views.py | CESNET/invenio-records-presentation | 0 | 12775432 | <gh_stars>0
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CESNET.
#
# Invenio Records Presentation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Blueprint definitions."""
from __future__ import absolute_import, print_function
i... | 2 | 2 |
src/caracara/rtr/_scripts.py | LaudateCorpus1/caracara | 1 | 12775433 | <reponame>LaudateCorpus1/caracara
"""Script interactions."""
from .._tool import Tool
class Scripts(Tool):
"""Class to represent Script interactions."""
def upload(self: object, script: str, script_name: str):
"""Upload a script."""
self.display(f" Uploading script {script_name}")
up... | 2.578125 | 3 |
test_package/module2.py | BigMountainTiger/p-virtualenv-excercise | 0 | 12775434 | <reponame>BigMountainTiger/p-virtualenv-excercise<filename>test_package/module2.py<gh_stars>0
print('module2.py is initiated')
module2 = { 'name': 'module2' } | 1.632813 | 2 |
pcr_cycle_sweep/count_all_amplicons.py | jackwadden/UltraRapidSeq | 3 | 12775435 | #!/usr/bin/python
import sys
import os
fn = "pileup.txt"
coverage_thresh = 5
if not os.path.isfile(fn):
print("File not found...")
sys.exit()
with open(fn) as fp:
hotspot_count = 0
hotspot_read_count = 0
in_hotspot = False
max_coverage = 0
hotspot_chr = ""
hotspot_start = 0
hot... | 3.09375 | 3 |
models/basicnet.py | jaejun-yoo/TDDIP | 11 | 12775436 | import numpy as np
import torch
import torch.nn as nn
def conv(in_channels, out_channels, kernel_size, bias=True):
return nn.Conv2d(
in_channels, out_channels, kernel_size,
padding=(kernel_size//2), bias=bias)
class MappingNet(nn.Module):
def __init__(self, opt):
super().__init__()
... | 2.328125 | 2 |
pymachine/__init__.py | landrew31/pymachine | 1 | 12775437 | <filename>pymachine/__init__.py
from .condition import Condition
from .exceptions import (
DuplicateCondition,
StateMachineAlreadyFinished,
StateMachineTransitionWithoutNextState,
UnknownInput,
UnknownState,
)
from .state_machine import StateMachine
from .transition_table import TransitionTable
__... | 1.71875 | 2 |
practice_app/migrations/0010_alter_museumapicsv_accessionnumber.py | VinayArora404219/crud-ops-practice-codeops | 0 | 12775438 | # Generated by Django 4.0 on 2021-12-22 04:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('practice_app', '0009_alter_museumapicsv_additionalimages_and_more'),
]
operations = [
migrations.AlterField(
model_name='museumapi... | 1.359375 | 1 |
bcs_server/bcs_server.py | nikhilgarg459/bcs | 0 | 12775439 | #!usr/bin/env python
# -*-coding:utf8-*-
from bank import Bank
from bank import Account
import socket
import time
from server import Server
from server_logger import log
__doc__ = """
* This module provide bcs_server class to access the bcs server.
* This extends the Server class.
"""
class BcsServer(Server... | 2.859375 | 3 |
2018/2018_22a.py | davidxiao93/Advent-of-Code | 0 | 12775440 | <reponame>davidxiao93/Advent-of-Code
from collections import namedtuple
Point = namedtuple("Point", ["x", "y"])
def add_point(p: Point, q: Point):
return Point(p.x + q.x, p.y + q.y)
geologic_index_dict = {}
erosion_level_dict = {}
def get_geologic_index(p: Point, target: Point) -> int:
if p in geologic_i... | 3.75 | 4 |
src/yael_arenarewards_dialogs.py | KnowsCount/money-and-honour | 1 | 12775441 | <gh_stars>1-10
# -*- coding: us-ascii -*-
#### HEADER
from header_common import *
from header_dialogs import *
from header_operations import *
from header_parties import *
from header_item_modifiers import *
from header_skills import *
from header_triggers import *
from ID_troops import *
from ID_party_templates impo... | 1.742188 | 2 |
trunk/Documentacion/Memoria/trozos-codigo/codigo-9-tcp-test-tcp-id.py | MGautier/security-sensor | 2 | 12775442 | def test_tcp_id(self):
"""
Comprobacion de que el puerto (objeto heredado) coincide con el asociado al Protocolos
Returns:
"""
port = Ports.objects.get(Tag="ssh")
tcp = Tcp.objects.get(id=port)
self.assertEqual(tcp.get_id(), port)
| 2.75 | 3 |
upload_ytmusic.py | ashpipe/youtube-music-autouploader | 3 | 12775443 | """ This script uploads created music files in directories to youtube music library """
import time
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from ytmusicapi import YTMusic
import music_tag
from datetime import date
import os
directories = ["D:\Kwan\Desktop", "D:\... | 3.109375 | 3 |
spiketoolkit/validation/quality_metric_classes/noise_overlap.py | teristam/spiketoolk | 55 | 12775444 | import numpy as np
from copy import copy
from .utils.thresholdcurator import ThresholdCurator
from .quality_metric import QualityMetric
import spiketoolkit as st
import spikemetrics.metrics as metrics
from spikemetrics.utils import printProgressBar
from spikemetrics.metrics import find_neighboring_channels
from collect... | 2.375 | 2 |
bot/modules/impacta/timetable.py | bruno-zaccariello/wdm-bot | 0 | 12775445 | from bs4 import BeautifulSoup as bs
from requests import request as req
from requests import Session
from requests import codes as requestCodes
import re
from .session import getSession
base_url = "https://account.impacta.edu.br/"
login_url = base_url + "account/enter.php"
url_timetable_aula = base_url + "aluno/horar... | 3.265625 | 3 |
mwptoolkit/model/Graph2Tree/multiencdec.py | ShubhamAnandJain/MWP-CS229 | 71 | 12775446 | <filename>mwptoolkit/model/Graph2Tree/multiencdec.py
# -*- encoding: utf-8 -*-
# @Author: <NAME>
# @Time: 2021/08/21 04:33:54
# @File: multiencdec.py
import copy
import random
import torch
import numpy as np
from torch import nn
from torch.nn import functional as F
from mwptoolkit.module.Encoder.graph_based_encoder ... | 1.976563 | 2 |
calculation/gmhazard_calc/gmhazard_calc/exceptions.py | ucgmsim/gmhazard | 0 | 12775447 | <gh_stars>0
class GMHazardError(BaseException):
"""Base GMHazard error"""
def __init__(self, message: str):
self.message = message
class ExceedanceOutOfRangeError(GMHazardError):
"""Raised when the specified exceedance value is out of range when
going from exceedance to IM on the hazard curve... | 2.828125 | 3 |
pydzcvr/networkDiscovery/openstack/libvirt/discovery.py | cboling/pydzcvr | 0 | 12775448 | <gh_stars>0
'''
@author: <NAME>
@copyright: 2015 Boling Consulting Solutions. All rights reserved.
@license: Artistic License 2.0, http://opensource.org/licenses/Artistic-2.0
@contact: <EMAIL>
@deffield updated: Updated
Libvirt allows you to access hypervisors running on remote machines through authenticat... | 2.453125 | 2 |
vininfo/common.py | ghilesmeddour/vininfo | 60 | 12775449 | <filename>vininfo/common.py<gh_stars>10-100
from typing import Dict, Any, Type
if False: # pragma: nocover
from .details._base import VinDetails # noqa
class Annotatable:
annotate_titles = {}
def annotate(self) -> Dict[str, Any]:
annotations = {}
no_attr = set()
for attr_nam... | 2.53125 | 3 |
apps/frontend/hotel/views.py | 12roshan12/Hotel-website | 0 | 12775450 | <reponame>12roshan12/Hotel-website
from django.contrib.messages.views import SuccessMessageMixin
from django.db.models.fields import CommaSeparatedIntegerField
from django.http.response import HttpResponse
from django.shortcuts import redirect,render
from django.contrib.auth.views import LoginView, LogoutView
from djan... | 2.125 | 2 |