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 |
|---|---|---|---|---|---|---|
setup.py | jaj42/infupy | 0 | 12766751 | from setuptools import setup
setup(name = 'infupy',
version = '2022.1.11',
description = 'Syringe pump infusion',
url = 'https://github.com/jaj42/infupy',
author = '<NAME>',
author_email = '<EMAIL>',
license = 'ISC',
packages = ['infupy', ... | 0.894531 | 1 |
0x11-python-network_1/0-hbtn_status.py | ricardo1470/holbertonschool-higher_level_programming | 0 | 12766752 | <gh_stars>0
#!/usr/bin/python3
""" script that fetches https://intranet.hbtn.io/status
-You must use the package urllib
-You must use a with statement """
import urllib.request
if __name__ == '__main__':
url = 'https://intranet.hbtn.io/status'
with urllib.request.urlopen(url) as response:
req_... | 3.234375 | 3 |
pyt/__main__.py | jayvdb/pyt | 1 | 12766753 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, print_function, absolute_import
import sys
import platform
import argparse
import os
from pyt import tester, __version__, main
from pyt.compat import *
def console():
# ripped from unittest.__main__.py
if sys.arg... | 2.421875 | 2 |
password_validator/tests/test_input_validator.py | sglavoie/dev-helpers | 5 | 12766754 | <gh_stars>1-10
# Standard library imports
from decimal import Decimal
from typing import Any
# Third-party libraries
import pytest
# Local imports
from pcs.input_validator import InputValidator
def test_input_is_set_to_value_passed_as_argument():
"""
The `input` class attribute of InputValidator should be s... | 2.78125 | 3 |
showcase1/com/aaron/sysexample.py | qsunny/python | 0 | 12766755 | <reponame>qsunny/python
# -*- coding: utf-8 -*-
#from sys import argv,path,modules,exec_prefix
from sys import *
def printCommandParam():
"""打印命令行参数"""
print(type(argv))
for commandParam in argv:
print(commandParam)
def printModuleSearchPath():
"""打印模块搜索路径"""
print(type(path))
for subp... | 2.28125 | 2 |
scripts/capacity.py | edwardoughton/uk_digital_networks | 0 | 12766756 | """
Capacity estimation method.
Written by <NAME>
December 12th 2019
This method can be used for any spatially aggregated unit, such as
postcode sectors or local authority districts. First, a points in
polygon analysis needs to provide the total number of 4G or 5G sites
in an area, in order to then get the density o... | 3.390625 | 3 |
examples/fangcloud/apiserver.py | zjuchenyuan/EasyLogin | 33 | 12766757 | <reponame>zjuchenyuan/EasyLogin
#coding:utf-8
"""
使用fangcloud.py提供的download函数提供网页服务
Example:
https://api.chenyuan.me/fangcloud/448eb45f0d08cbf37c33f35419
"""
from cyserver import CYServer
from fangcloud import download
def do_GET(self):
path = self.path.split("/")
if path[1]=="fangcloud":
... | 2.328125 | 2 |
Desafio Python/Aula 10 des29.py | ayresmajor/Curso-python | 0 | 12766758 | <reponame>ayresmajor/Curso-python<filename>Desafio Python/Aula 10 des29.py
print('\033[1:33m = \033[m'*20)
velocidade = float(input('Qual foi a velocidade atingida pelo seu carro? '))
print('\033[1:33m - \033[m'*20)
multa = ( (velocidade - 80) * 7)
if velocidade<= 80:
print('Parabéns vc não ultrapassou o limite de... | 3.890625 | 4 |
tests/test_client.py | pryds/dataserv-client | 1 | 12766759 | <reponame>pryds/dataserv-client<filename>tests/test_client.py
import unittest
import datetime
import time
from dataserv_client import common
from dataserv_client import cli
from dataserv_client import api
from dataserv_client import exceptions
url = "http://127.0.0.1:5000"
address_alpha = "<KEY>"
address_beta = "<KE... | 2.125 | 2 |
boggle/boggle_types.py | RacingTadpole/boggle | 0 | 12766760 | <gh_stars>0
from typing import Tuple, Sequence
Position = Tuple[int, int, str]
Board = Sequence[str] | 2.234375 | 2 |
confusionflow/logging/run.py | HendrikStrobelt/confusionflow | 2 | 12766761 | <reponame>HendrikStrobelt/confusionflow<filename>confusionflow/logging/run.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
from confusionflow.logging.utils import (
check_folderpath,
update_runindex,
update_datasetindex,... | 2.265625 | 2 |
music_dl.py | tylors1/musicDownloader | 0 | 12766762 | import sys
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import spotipy.util as util
import codecs
import help_us
import get_spotify
import get_wikipedia
import fix_tags
import get_youtube
# client_credentials_manager = SpotifyClientCredentials(client_id='60e52fd7ef4849568a7c057416d33554', client... | 2.734375 | 3 |
rf_command.py | glzjin/eventbridge-client-for-consumer | 0 | 12766763 | import serial
import struct
rf_channel_list = [b"\x01", b"\x02", b"\x03", b"\x04"]
def send_rf_command(config_class, channel, is_study = False):
ser = serial.Serial(
port = config_class.tty,
baudrate = 9600,
parity = serial.PARITY_NONE,
stopbits = serial.STOPBITS_ONE,
bytes... | 2.640625 | 3 |
tests.py | ranocha/nodepy | 41 | 12766764 | <reponame>ranocha/nodepy<filename>tests.py
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import doctest
import nodepy
import unittest
import os
import subprocess
import tempfile
import sys
import nbformat
if sys.version_info >= (3,0):
kernel = 'python3'
else:
kernel = 'python2'
def _notebook_... | 2.25 | 2 |
test_evocraft_py/minecraft_pb2_grpc.py | shyamsn97/test-evocraft-py | 1 | 12766765 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
import test_evocraft_py.minecraft_pb2 as minecraft__pb2
class MinecraftServiceStub(... | 2.171875 | 2 |
python/ray/experimental/sgd/tfbench/model_config.py | cumttang/ray | 3 | 12766766 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1.820313 | 2 |
Curso em Video/ex020.py | CamilliCerutti/Exercicios-de-Python-curso-em-video | 0 | 12766767 | # SORTEANDO UMA ORDEM NA LISTA
# O mesmo professor do ex 19 quer sortear a ordem de apresentação de trabalhos dos alunos. Faça um programa que leia o nome dos quatro alunos e mostre a ordem sorteada.
from random import sample, choice
a1 = input('Digite o nome do primeiro aluno: ')
a2 = input('Digite o nome do segund... | 3.765625 | 4 |
lib/cros_test_lib.py | khromiumos/chromiumos-chromite | 0 | 12766768 | <reponame>khromiumos/chromiumos-chromite
# -*- coding: utf-8 -*-
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Cros unit test library, with utility functions."""
from __future__ import print_f... | 1.90625 | 2 |
colorize.py | sergekatzmann/batch_colorize | 2 | 12766769 | <gh_stars>1-10
#!/usr/bin/python
import os
os.environ['GLOG_minloglevel'] = '2'
import time
import numpy as np
import caffe
import skimage.color as color
import scipy
import scipy.ndimage.interpolation as sni
from os import listdir
from os.path import isfile, join
import sys, getopt
class bcolors:
HEADER = '\033... | 1.992188 | 2 |
src/pinyiniser/main.py | mldelaney94/pinyiniser | 0 | 12766770 | <filename>src/pinyiniser/main.py
import jieba
import pinyiniser
import os
from pathlib import Path
curr_dir = '\\'.join(pinyiniser.__file__.split('\\')[0:-1])
numeric_dict = os.path.join(curr_dir, Path('./data/cedict_ts_no_space_numerals.u8'))
diacritic_dict = os.path.join(curr_dir, Path('./data/cedict_ts_pinyin.u8'))... | 3.09375 | 3 |
test.py | yuvraj9/key-value-store | 2 | 12766771 | from tests.cli import commands
from click.testing import CliRunner
def test_get_not_found():
"""
Executes the kv get <key> command. The key does not exist yet so it
returns the Key Doesn't exist message and status_code. It validates
the output.
"""
runner = CliRunner()
result = runner.invo... | 2.90625 | 3 |
3DmFV-Net-master/models/voxnet_3dmfv.py | wangzihaoyt36/PointnetEnhanced | 0 | 12766772 | <reponame>wangzihaoyt36/PointnetEnhanced<filename>3DmFV-Net-master/models/voxnet_3dmfv.py
import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from t... | 1.96875 | 2 |
app/wrapper/models.py | Sirius-social/TMTM | 0 | 12766773 | import os
import hashlib
import secrets
from django.db import models
from django.core.cache import cache
from django.db.models.signals import pre_save, pre_delete, post_migrate
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField, ArrayField
... | 1.992188 | 2 |
is_blinkee_nearby.py | terenaa/is-blinkee-nearby | 1 | 12766774 | <reponame>terenaa/is-blinkee-nearby
# -*- coding: utf-8 -*-
from Notifier import Discord
from Blinkee import Blinkee, BlinkeeApi
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
exclusive_group = parser.add_mutually_exclusive_group(required=True)
exclusive_group.add_argument... | 2.625 | 3 |
lib/python/treadmill/tests/keytabs_test.py | krcooke/treadmill | 133 | 12766775 | """Unit test for keytabs
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import os
import shutil
import tempfile
import unittest
import mock
from treadmill import keytabs
class KeytabsTest(unittest.T... | 2.4375 | 2 |
scrapper.py | macbuse/twitter_bots | 0 | 12766776 | <gh_stars>0
import re
import requests
url = 'https://www.brainyquote.com/topics/problems-quotes'
url = 'https://www.brainyquote.com/topics/science-quotes'
pp = re.compile('<a href="/quotes/(.*?)_\d+.*?>(.*?)</a>',re.DOTALL)
r = requests.get(url)
def clean(x):
author, quote = x
bits = [x[0].upper() + x[1:]... | 2.859375 | 3 |
misc/j3.py | dk00/old-stuff | 0 | 12766777 | #!/usr/bin/env python
import sys
import time
print sys.stdin.readline()
time.sleep(3)
exit(99)
| 1.765625 | 2 |
tests/conftest.py | mikedingjan/python-param-store | 10 | 12766778 | <reponame>mikedingjan/python-param-store<gh_stars>1-10
import boto3
def pytest_configure():
boto3.setup_default_session(region_name="eu-west-1")
| 1.53125 | 2 |
catkin_ws/src/vehicle_follow/scripts/following_node.py | championway/DuckietownPi2 | 1 | 12766779 | <reponame>championway/DuckietownPi2
#!/usr/bin/env python
import rospy
import numpy as np
import math
import time
from std_msgs.msg import Bool, Float32
from duckietown_msgs.msg import Twist2DStamped, VehiclePose, AprilTags, BoolStamped
from sensor_msgs.msg import Joy
class Follow(object):
def __init__(self):
... | 2.34375 | 2 |
project/get-project.py | Akaito/codesaru-environ | 1 | 12766780 | """
The MIT License (MIT)
Copyright (c) 2015 <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 use, copy, modify, merge, publi... | 2.171875 | 2 |
tests/flatpages_tests/urls.py | ni-ning/django | 61,676 | 12766781 | <gh_stars>1000+
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.sitemaps import views
from django.urls import include, path
urlpatterns = [
path(
'flatpages/sitemap.xml', views.sitemap,
{'sitemaps': {'flatpages': FlatPageSitemap}},
name='django.contrib.site... | 1.382813 | 1 |
netbox/payment/admin.py | cbipoe3ka/new-netbox-2.9 | 0 | 12766782 | from django.contrib import admin
# Register your models here.
from .models import Payment, ContractFile, Company, Contractor
@admin.register(Company)
class Company(admin.ModelAdmin):
list_display = (
'name',
)
@admin.register(Contractor)
class Contractor(admin.ModelAdmin):
list_display = (
... | 1.742188 | 2 |
0x0B-python-input_output/0-read_file.py | Rmolimock/holbertonschool-higher_level_programming | 1 | 12766783 | <filename>0x0B-python-input_output/0-read_file.py
#!/usr/bin/python3
def read_file(filename=""):
'''open a given file'''
with open(filename, 'r') as f:
print("{}".format(f.read()), end="")
| 3.421875 | 3 |
code_execution/execution_base.py | gbleaney/python_security | 31 | 12766784 | import asyncio
import inspect
import logging
from abc import ABC, abstractclassmethod
from collections import defaultdict
from typing import Callable, Set, Type, Dict, List, Union
from json import JSONEncoder
class Exploit(ABC):
@abstractclassmethod
def generate_payload(command: str) -> Union[str, List[str]]:... | 2.4375 | 2 |
Search.py | ShowLove/GoogleSearchWebcrawler | 0 | 12766785 | import os
from google_search import GoogleCustomSearch
#set variables
os.environ["SEARCH_ENGINE_ID"] = "000839040200690289140:u2lurwk5tko"
os.environ["GOOGLE_CLOUD_API_KEY"] = "<KEY>"
SEARCH_ENGINE_ID = os.environ['SEARCH_ENGINE_ID']
API_KEY = os.environ['GOOGLE_CLOUD_API_KEY']
api = Googl... | 2.953125 | 3 |
utils/compute_stock_features.py | nivilo/Chase | 68 | 12766786 | <reponame>nivilo/Chase<filename>utils/compute_stock_features.py
import pandas as pd
SMA_ROLLING_WINDOW = 5
EMA_ALPHA = 0.5
def sma(data: pd.DataFrame, feature):
return data[feature].rolling(SMA_ROLLING_WINDOW).mean()
def daily_returns(data, feature):
return data[feature]/data[feature].shift() - 1
def min... | 2.859375 | 3 |
advertise/forms/__init__.py | sadagatasgarov1/sahibinden | 2 | 12766787 | from advertise.forms.auth import CustomSignupForm
from advertise.forms.user import UpdateUserForm
| 1.085938 | 1 |
build/cls/tp/tpwt1.py | amunoz1/mines | 1 | 12766788 | # well ties
# @author <NAME>, Colorado School of Mines
# @version 01.21.2014
from dtw import *
from tputils import *
from wtutils import *
from imports import *
# Params:
fp = 35
q = 100
dz = getDz()
# Image warping
dr1 = 0.02 # 2D smoothness vertically
dr2 = 0.50 # 2D smoothness vertically
dr3 = 0.50 # 2D s... | 1.875 | 2 |
tfn/tools/loaders/__init__.py | UPEIChemistry/TFN_Layers | 2 | 12766789 | <filename>tfn/tools/loaders/__init__.py
"""
Sub-package containg all loader classes
"""
from .data_loader import DataLoader
from .qm9_loader import QM9DataDataLoader
from .iso17_loader import ISO17DataLoader
from .ts_loader import TSLoader
from .sn2_loader import SN2Loader
from .isom_loader import IsomLoader
| 1.109375 | 1 |
functions.py | StoneMasons4106/sleeper-ffl-discordbot | 1 | 12766790 | # Import needed libraries
import discord
import os
import pymongo
import pendulum
import requests
import re
if os.path.exists("env.py"):
import env
# Define Environment Variables
MONGO_DBNAME = os.environ.get("MONGO_DBNAME")
MONGO_URI = os.environ.get("MONGO_URI")
MONGO_CONN = pymongo.MongoClient(MONGO_URI)
MON... | 2.46875 | 2 |
data_process/setup.py | Fifi-Huo/Digital_Appendix_C | 0 | 12766791 | import os, shutil
from setuptools import setup, find_packages
#
CUR_PATH = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(CUR_PATH, 'build')
if os.path.isdir(path):
print('INFO del dir ', path)
shutil.rmtree(path)
setup(
name = 'pipeline',
# Author details
author='JiejunHuo',
... | 1.75 | 2 |
handlers/postpage.py | caasted/multi-user-blog | 0 | 12766792 | <reponame>caasted/multi-user-blog
import webapp2
import os
import jinja2
import hmac
import hashlib
import random
import string
import time
from google.appengine.ext import db
from models import *
from . import handler
class PostPageHandler(handler.Handler):
def render_post(self, post, content="", error=""):
userna... | 2.46875 | 2 |
reports/report_iota_snapshot.py | andrasfe/iota-research | 0 | 12766793 | import matplotlib.pyplot as plt
import pandas as pd
from scipy.interpolate import make_interp_spline, BSpline
import numpy as np
def plot_results(title, csv_name):
df = pd.read_csv('../' + csv_name + '.csv')
ax = plt.gca()
df.columns = ['V', 'E', 'Time']
df = df[['V', 'Time']]
df = pd.DataFrame(df.groupby('V').m... | 3 | 3 |
hackathon/scrapers/adia.py | Addepar/vizceral-example | 0 | 12766794 | <gh_stars>0
from hackathon.scrapers.base import BaseScraper
class AdiaScraper(BaseScraper):
def __init__(self, host_regex):
BaseScraper.__init__(self)
self.__regex = host_regex
def get_good_query_in(self):
return self.__regex + ' AND log_class=*NotificationDataService | parse "fetched ... | 2.53125 | 3 |
oneRing/urls/timeslot.py | TylerRudie/narvi | 1 | 12766795 | <filename>oneRing/urls/timeslot.py
from django.conf.urls import url, include
from oneRing.restInterface.timeSlot.validate_v1 import timeSlot_validate_interface
urlpatterns = [
url(r'^v1/validate/(?P<oneTimeCode>[0-9a-zA-Z_-]+)$',
timeSlot_validate_interface.as_view(),
name= 'timeSlot_validate'
... | 1.742188 | 2 |
fastapi_mvc/commands/__init__.py | rszamszur/fastapi-mvc | 98 | 12766796 | """Command design pattern.
The ``fastapi-mvc.commands`` submodule implements command design pattern.
Resources:
1. https://refactoring.guru/design-patterns/command
"""
from fastapi_mvc.commands.base import Command
from fastapi_mvc.commands.invoker import Invoker
from fastapi_mvc.commands.run_generator import Run... | 1.492188 | 1 |
test.py | simonmeister/pytorch-mono-depth | 56 | 12766797 | import argparse
import os
import shutil
import json
import numpy as np
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
from dense_estimation.resnet import resnet50
from dense_estimation.output import GaussianScaleMixtureOutput, PowerExponentialOutput
from dense_estimation.losses import (BerHuLoss, ... | 2.046875 | 2 |
models/beta/vss.py | YorkSu/hat | 1 | 12766798 | """
VGG-Swish-SE
For Cifar10
本模型默认总参数量[参考基准:cifar10]:
Total params: 16,402,790
Trainable params: 16,390,246
Non-trainable params: 12,544
"""
from hat.models.advance import AdvNet
class vss(AdvNet):
"""
VSS
"""
def args(self):
self.CONV_KI = 'he_normal'
self.CONV... | 2.265625 | 2 |
little_scripts_testing/test_mse_pfbinv.py | dcxSt/pfb-mod | 1 | 12766799 | import sys, os
sys.path.append("..")
import helper as h
from constants import SINC
import numpy as np
import matplotlib.pyplot as plt
eigengrid = h.r_window_to_matrix_eig(SINC) # h.window_pad_to_box_rfft(SINC,pad_factor=10.0)
eigengrid_hann = h.r_window_to_matrix_eig(SINC * np.hanning(len(SINC)))
eigengrid_hamm = h.r_... | 2.25 | 2 |
tilfa.py | jwbensley/pyFRR | 2 | 12766800 |
import networkx as nx
import os
from diagram import Diagram
from spf import spf
class tilfa:
"""This class provides draft-ietf-rtgwg-segment-routing-ti-lfa TI-LFA calculations"""
def __init__(self, debug=0, ep_space=True, trombone=False):
"""
Init the TI-LFA class.
:param int debug:... | 2.8125 | 3 |
fuse/ext/__init__.py | hanslovsky/gunpowder-nodes | 1 | 12766801 | from __future__ import print_function
import logging
import traceback
import sys
logger = logging.getLogger(__name__)
class NoSuchModule(object):
def __init__(self, name):
self.__name = name
self.__traceback_str = traceback.format_tb(sys.exc_info()[2])
errtype, value = sys.exc_info()[:2]... | 2.421875 | 2 |
2015/day04/solution.py | loisaidasam/adventofcode | 0 | 12766802 |
import hashlib
import sys
def solve(secret_key, starts_with):
result = 1
while True:
hash_input = "%s%s" % (secret_key, result)
hash_result = hashlib.md5(hash_input).hexdigest()
if hash_result.startswith(starts_with):
return result
result += 1
if __name__ == '__m... | 3.859375 | 4 |
stocks.py | hjwp/datascience-from-scratch | 1 | 12766803 | <filename>stocks.py
import csv
from dataclasses import dataclass
from typing import Any, List, Dict, NamedTuple
NUMBER_COLUMNS = ["Open", "Close", "High", "Low", "Adj Close", "Volume"]
@dataclass(frozen=True)
class Stock:
name: str
opening_price: float
closing_price: float
def fix_row(raw_row: Dict[str... | 3.546875 | 4 |
e3d/model_management/ModelInstanceClass.py | jr-garcia/Engendro3D | 8 | 12766804 | from .MaterialClass import Material
# from ..SoundClass import Sound
from ..Base3DObjectClass import Base3DObject
from ..physics_management.physicsModule import bodyShapesEnum
class ModelInstance(Base3DObject):
def __init__(self, baseMats, modelID, engine, ID, animationQuality, position, rotation, uniformScale,
... | 2.296875 | 2 |
main.py | sukreshmanda/paillier-image-processing | 2 | 12766805 | import numpy as np
from PIL import Image
from paillier import *
import sys
from matplotlib import pyplot as plt
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
cl... | 2.59375 | 3 |
xgb_train.py | 03pie/SMPCUP2017 | 25 | 12766806 | <reponame>03pie/SMPCUP2017
from collections import Counter
import pandas as pd
from sklearn import linear_model
from sklearn.linear_model import LogisticRegression
import xgboost as xgb
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.cross_validation import train_te... | 2.234375 | 2 |
tf.py | ca7869/tensorflow | 0 | 12766807 | import os
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from t... | 2.640625 | 3 |
src/intvalidate.py | vinceshores/tkvalidate | 0 | 12766808 | import tkinter as tk
def int_validate(entry_widget, from_=None, to=None):
"""
Validates an entry_widget so that only integers within a specified range may be entered
:param entry_widget: The tkinter.Entry widget to validate
:param from_: The start limit of the integer
:param to: The end limit of ... | 4.09375 | 4 |
youtuatools/extractor/ciscolive.py | Pagasis/YouTua | 47 | 12766809 | <filename>youtuatools/extractor/ciscolive.py
# coding: utf-8
from __future__ import unicode_literals
import itertools
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
clean_html,
float_or_none,
int_or_none,
try_get,... | 1.953125 | 2 |
rendering/back_tracer.py | optas/geo_tool | 6 | 12766810 | '''
Created on Jul 25, 2016
@author: <NAME>
@contact: <EMAIL>
@copyright: You are free to use, change, or redistribute this code in any way
you want for non-commercial purposes.
'''
import glob
import os
import os.path as osp
from subprocess import call as sys_call
from .. in_out import soup as io
class Back_Trace... | 2.1875 | 2 |
vendor/packages/logilab-astng/test/unittest_scoped_nodes.py | jgmize/kitsune | 2 | 12766811 | <reponame>jgmize/kitsune
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:<EMAIL>
# copyright 2003-2010 <NAME>, all rights reserved.
# contact mailto:<EMAIL>
#
# This file is part of logilab-astng.
#
# logilab-astng is free software: you can redistribut... | 1.664063 | 2 |
sprint/commands/clear.py | ii-Python/Sprint | 0 | 12766812 | # Modules
import subprocess
from os import name
from ..utils.bases import BaseCommand
# Command class
class Clear(BaseCommand):
def __init__(self, core):
self.core = core
def clear(self, arguments):
# Locate our command
command = "clear"
if name == "nt":
command =... | 2.625 | 3 |
tests/spring_cloud/ribbon/spring_client_factory_test.py | haribo0915/Spring-Cloud-in-Python | 5 | 12766813 | # -*- coding: utf-8 -*-
# standard library
from unittest.mock import Mock
__author__ = "Ssu-Tsen"
__license__ = "Apache 2.0"
# standard library
# scip plugin
from ribbon.client.config.client_config import ClientConfig
from spring_cloud.ribbon.spring_client_factory import DynamicServerListLoadBalancer, SpringClientFa... | 2.171875 | 2 |
eqDataVisLib/mapGen.py | coolgauss/usgsEarthquakeDataVis | 0 | 12766814 | import hou
class MapBoxHandler(object):
CAM_NAME = 'map_cam'
MAPBOX_TOKEN_FILE_PARMNAME = 'mapbox_token_file'
USE_PICKLED_TOKEN_PARMNAME = 'use_pickled_token'
MAPBOX_TOKEN_STR_PARMNAME = 'mapbox_token_string'
LAT_CENTER_PARMNAME = 'lat_center'
LON_CENTER_PARMNAME = 'lon_center'
... | 2.515625 | 3 |
python/rich/richprogress2.py | jdurbin/sandbox | 0 | 12766815 | #!/usr/bin/env python
from rich.progress import track
from rich import print
from rich.progress import Progress
from rich.table import Column
from rich.progress import Progress, BarColumn, TextColumn,TimeRemainingColumn,SpinnerColumn,TimeElapsedColumn
from rich.console import Console
filename="big.fa"
seqCount=0
num_... | 2.59375 | 3 |
data/migrations/0115_message_pending_delivery.py | SIXMON/peps | 5 | 12766816 | <filename>data/migrations/0115_message_pending_delivery.py
# Generated by Django 3.1.1 on 2020-11-19 09:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0114_farmer_can_send_messages'),
]
operations = [
migrations.AddField(
... | 1.476563 | 1 |
find_outlier/find_the_outlier.py | yesblogger/Codewar | 0 | 12766817 | <filename>find_outlier/find_the_outlier.py
"""
created on 16/04/2017
author: <NAME>
"""
from collections import Counter as C
def find_outlier(integers):
tag = ['e', 'o']
result = [tag[i % 2] for i in integers]
count_result = C(result)
index_result = [i for i in count_result if count_result[i] == 1]
... | 3.421875 | 3 |
examples/plugin_example/plugin.py | pfnet/pysen | 423 | 12766818 | import dataclasses
import pathlib
import subprocess
from typing import DefaultDict, List, Sequence
import dacite
from pysen.command import CommandBase
from pysen.component import ComponentBase, RunOptions
from pysen.path import change_dir
from pysen.plugin import PluginBase
from pysen.pyproject_model import Config, P... | 2 | 2 |
Node.py | ihartb/AStar | 0 | 12766819 | class Node:
def __init__(self, x, y):
self.g = 0
self.h = 0
self.f = 0
self.parent = None
self.cost = 1
self.x = x
self.y = y
self.left_child = None
self.right_child = None
self.top_child = None
self.down_child = None
def u... | 3.765625 | 4 |
thop/utils.py | zxytim/Grid-Anchor-based-Image-Cropping-Pytorch | 0 | 12766820 | <reponame>zxytim/Grid-Anchor-based-Image-Cropping-Pytorch
def clever_format(num, format="%.2f"):
if num > 1e12:
return format % (num / 1e12) + "T"
if num > 1e9:
return format % (num / 1e9) + "G"
if num > 1e6:
return format % (num / 1e6) + "M"
if num > 1e3:
return format %... | 2.921875 | 3 |
nightson/managers/events_user_manager.py | vswamy/nightson | 0 | 12766821 | from __future__ import absolute_import
from nightson.managers.base_entity_manager import BaseEntityManager
from tornado import gen
class EventUsersManager(BaseEntityManager):
def __init__(self):
pass
def __init__(self, request):
super(EventUsersManager, self).__init__(request)
@gen.cor... | 2.265625 | 2 |
docs/tutorials/tmp.py | jbkinney/mave-nn | 3 | 12766822 | <reponame>jbkinney/mave-nn<gh_stars>1-10
## PACKAGE THIS FUNCTION INTO MAVENN
def split_dataset(data_df,
set_col='set',
train_set_name='training',
val_set_name='validation',
test_set_name='test'):
"""
Splits dataset into
(1) `trainv... | 2.9375 | 3 |
python/dataset/forumposts.py | anysql/sling | 0 | 12766823 | <filename>python/dataset/forumposts.py
# Copyright 2021 Ringgaard Research ApS
#
# 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 req... | 1.898438 | 2 |
CHIMERA/optimization_utils.py | aoyandong/CHIMERA | 2 | 12766824 | """
###########################################################################
# @file optimization_utils.py
# @brief Functions for optimizing transformations and parameters.
#
# @author <NAME>
#
# @Link: https://www.cbica.upenn.edu/sbia/software/
#
# @Contact: <EMAIL>
#################################################... | 2.71875 | 3 |
buuctf/97-baby_rop_2/exp.py | RoderickChan/ctf_tasks | 0 | 12766825 | from pwn import *
from LibcSearcher import LibcSearcher
############################
#********修改文件名**********
############################
file_name = 'babyrop2'
port = 27150
io = -1
###########修改宏###########
DEBUG = 1
LOG_PRINT = 1
TMUX = 0
def LOG_ADDR_SUCCESS(name:str, addr:int):
'''
打印地址
name: 变量名,str... | 2.109375 | 2 |
API/v1/leaks/__init__.py | FortniteFevers/peely-api | 5 | 12766826 | import io
import json
import math
import random
import time
import traceback
from datetime import datetime
import aiofiles
import discord
import sanic
import sanic.response
from PIL import Image
from discord.ext import commands
from modules import leaks
async def handler(req):
return sanic.response.json(json.lo... | 2.359375 | 2 |
tests/test_bad_sys_use.py | timgates42/dlint | 0 | 12766827 | #!/usr/bin/env python
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import unittest
import dlint
class TestBadSysUse(dlint.test.base.BaseTest):
def test_bad_sys_usage(self):
python_string = self.get_ast_node(
"""
import ... | 2.328125 | 2 |
lsf/esub.py | mcopik/python-lsf | 12 | 12766828 | #!/usr/bin/env python
"""Wrapper script with bsub functionality."""
from __future__ import print_function
import sys
import os
import shlex
import argparse
from submitjob import submitjob
from utility import color
def esub(args, bsubargs, jobscript):
"""Wrapper script with bsub functionality."""
data = {"c... | 3.078125 | 3 |
snippets/findtag.py | chengdagong/kdplus | 0 | 12766829 | from pykd import *
from sys import argv
nt = module("nt")
LDR_DATA_TABLE_ENTRY = nt.type("_LDR_DATA_TABLE_ENTRY")
def getModuleList():
ldrLst = typedVarList( nt.PsLoadedModuleList, LDR_DATA_TABLE_ENTRY, "InLoadOrderLinks.Flink")
return [ module(m.DllBase) for m in ldrLst ]
def findTagInModule(mod,... | 2.515625 | 3 |
or_suite/envs/general_test.py | JasmineSamadi/ORSuite | 4 | 12766830 | <reponame>JasmineSamadi/ORSuite
import gym
import numpy as np
import sys
from scipy.stats import poisson
import env_configs
import pytest
from stable_baselines3.common.env_checker import check_env
import general_test_helpers
def test_ambulance_metric():
general_test_helpers.test_env(
'Ambulance-v0', env... | 1.75 | 2 |
code/arc101_a_01.py | KoyanagiHitoshi/AtCoder | 3 | 12766831 | <gh_stars>1-10
n,k=map(int,input().split())
x=sorted(list(map(int,input().split())))
a=[]
for i in range(n-k+1):
l=x[i]
r=x[i+k-1]
a.append(min(abs(l)+abs(r-l),abs(r)+abs(l-r)))
print(min(a)) | 2.296875 | 2 |
isup.py | chpwssn/isitupbot | 1 | 12766832 | from specifics import *
import urllib
import urllib2
import json
import praw
import time
urltocheck = "b-15.net http://google.com http://172.16.17.32 https://172.16.17.32"
def runcheck(url):
serverstried = 0
httpup = 0
dnsresolve = 0
serverconnected = 0
serverids = ""
servercities = ""
reso... | 3.09375 | 3 |
python/life/cell.py | PJSoftware/game-of-life | 0 | 12766833 | class Cell:
def __init__(self, alive = False):
self.currentState = alive
self.futureState = alive
def updateState(self, state):
self.futureState = state
def refresh(self):
self.currentState = self.futureState
def isAlive(self):
return self.cur... | 3.171875 | 3 |
tpDcc/tools/renamer/plugins/letter.py | tpRigToolkit/tpRigToolkit-tools-renamer | 3 | 12766834 | <gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains letter renamer plugin implementation
"""
from __future__ import print_function, division, absolute_import
from Qt.QtCore import QObject
from Qt.QtWidgets import QWidget
from tpDcc.managers import resources
from tpDcc.libs.qt.widge... | 2.234375 | 2 |
HackerRank/Problem Solving/Algorithms/Strings/Making Anagrams.py | anubhab-code/Competitive-Programming | 0 | 12766835 | str1 = input()
str2 = input()
a = [0 for i in range(0,27)]
for i in str1:
a[ord(i)-ord('a')] += 1
for i in str2:
a[ord(i)-ord('a')] -= 1
ans = 0
for i in a:
if ( i < 0 ):
ans += -i
else:
ans += i
print(ans) | 3.25 | 3 |
src/solorunner/submit.py | marchete/RN_Explorer | 1 | 12766836 | <reponame>marchete/RN_Explorer
#!/usr/bin/env python3
import sys
import time
import string
import random
import glob
import re
import traceback
import zlib
import base64
program_name=sys.argv[1]
try:
threads=int(sys.argv[2])
except:
threads=2
try:
reset_seconds=int(sys.argv[3])
except:
reset_seconds=39
try:
lFa=i... | 2.375 | 2 |
information/urls.py | encrypted-fox/students_performance_monitoring | 0 | 12766837 | <reponame>encrypted-fox/students_performance_monitoring
from rest_framework import routers
from .views import *
from . import views
router = routers.DefaultRouter()
router.register('start_years', StartYearsViewSet)
router.register('terms', TermsViewSet)... | 2.03125 | 2 |
check_model_params.py | mlvc-lab/ILKP | 1 | 12766838 | import argparse
import numpy as np
import models
from utils import set_arch_name
model_names = sorted(name for name in models.__dict__
if name.islower() and not name.startswith("__")
and callable(models.__dict__[name]))
def config():
r"""configuration settings
"""
parser = argparse.ArgumentParser... | 2.328125 | 2 |
tests/test_circle_ci.py | dhermes/ci-diff-helper | 5 | 12766839 | <filename>tests/test_circle_ci.py<gh_stars>1-10
# 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 agree... | 2.484375 | 2 |
cmsplugin_contact_form/models.py | cesarrdz999/djangocms-contact-form | 2 | 12766840 | <reponame>cesarrdz999/djangocms-contact-form<filename>cmsplugin_contact_form/models.py<gh_stars>1-10
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from cms.models import CMSPlugin
@python_2_unicode_compatible
class ContactFormCMS(CMSPlugin):
smtp_server = models.CharF... | 2.078125 | 2 |
infopages/views.py | OhmGeek/TechSite | 0 | 12766841 | from django.shortcuts import render
from .models import InfoPage
# Create your views here.
def view_page(request, slug):
# Look up the slug.
page = InfoPage.objects.get(slug=slug)
page_data = {
"page": page
}
return render(request, 'infopages/view_page.html', page_data)
| 2.15625 | 2 |
custom_components/batch_prediction_vertex.py | taocao/Continuous-Adaptation-for-Machine-Learning-System-to-Data-Changes | 15 | 12766842 | """
This component launches a Batch Prediction job on Vertex AI.
Know more about Vertex AI Batch Predictions jobs, go here:
https://cloud.google.com/vertex-ai/docs/predictions/batch-predictions.
"""
from google.cloud import storage
from tfx.dsl.component.experimental.annotations import Parameter, InputArtifact
from t... | 2.5625 | 3 |
sam/datasets/__init__.py | junj2ejj/sam-textvqa | 48 | 12766843 | <reponame>junj2ejj/sam-textvqa
from .stvqa_dataset import STVQADataset
from .textvqa_dataset import TextVQADataset
DatasetMapTrain = {
"textvqa": TextVQADataset,
"stvqa": STVQADataset,
}
| 1.375 | 1 |
sdk/python/core/tests/compare.py | ygorelik/pydk | 0 | 12766844 | # ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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/LICENS... | 2.0625 | 2 |
iml_common/blockdevices/blockdevice_linux.py | intel-hpdd/iml-common | 1 | 12766845 | <reponame>intel-hpdd/iml-common
# Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import re
import os
import subprocess
from collections import defaultdict
from tempfile import mktemp
from blockdevice import BlockDevic... | 2.15625 | 2 |
py/pv.py | wulffern/aic2022 | 0 | 12766846 | #!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
m = 1e-3
i_load = np.logspace(-5,-3)
i_load = np.linspace(1e-5,1e-3,200)
i_s = 1e-12
i_ph = 1e-3
V_T = 1.38e-23*300/1.6e-19
V_D = V_T*np.log((i_ph - i_load)/(i_s) + 1)
P_load = V_D*i_load
plt.subplot(2,1,1)
plt.plot(i_load/m,V_D)
plt.yl... | 2.578125 | 3 |
python/gameinfo.py | pason-systems/battle-tanks-client-stubs | 2 | 12766847 | <reponame>pason-systems/battle-tanks-client-stubs
class GameInfo(object):
"""
holds player information for the current game
"""
def __init__(self, team_name, match_token, team_password, client_token = ''):
self.client_token = client_token
self.team_name = team_name
self.match_to... | 2.6875 | 3 |
ntcli.py | ALMSIVI/novel_tools | 1 | 12766848 | import argparse
from pathlib import Path
from novel_tools.toolkit import analyze, docgen
from novel_tools.utils import get_config
def do_analyze(args):
config_filename = args.toolkit + '_config.json'
input_path = Path(args.input)
output_path = Path(args.output) if args.output is not None else None
if ... | 2.796875 | 3 |
2020/09/day9.py | jscpeterson/advent-of-code-2020 | 0 | 12766849 | from itertools import combinations
def get_data(filepath):
return [int(line) for line in open(filepath).readlines()]
def solve1(filepath, preamble):
inputs = get_data(filepath)
for i, line in enumerate(inputs):
if i <= preamble:
continue
sums = set(sum(comb) for comb in combina... | 3.15625 | 3 |
rcpy/__init__.py | BrendanSimon/rcpy | 0 | 12766850 | import warnings
import signal
import sys, os, time
from rcpy._rcpy import initialize, cleanup, get_state
from rcpy._rcpy import set_state as _set_state
from rcpy._rcpy import cleanup as _cleanup
#from hanging_threads import start_monitoring
#monitoring_thread = start_monitoring()
# constants
IDLE = 0
RUNNING = 1
PAU... | 2.25 | 2 |