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
SNR20db/meteostat2
0
12785551
from setuptools import setup from os import path from codecs import open here = path.abspath( path.dirname( __file__ ) ) with open( path.join( here, 'README.md' ), encoding='utf-8' ) as file : long_description = file.read() for line in open( path.join( 'meteostat', '__init__.py' ) ) : if line.startswith( '_...
1.765625
2
tests/test_parameters.py
thomasjpfan/skvalid
2
12785552
import pytest from numpy.random import RandomState from skvalid.parameters import TypeOf from skvalid.parameters import Enum from skvalid.parameters import Union from skvalid.parameters import Interval from skvalid.parameters import Const import typing @pytest.mark.parametrize('type_of,value', ...
2.140625
2
hello.py
sokjc/BuildWeekGitDemo
0
12785553
<gh_stars>0 """ Prints Hello World """ def say_hi(name): return f'Hello {name}!' def say_bye(name): return f'Bye {name}' if __name__ == 'main': say_hi("World!") say_bye("World!")
2.703125
3
kwep.py
sumitgo/ram22
0
12785554
import os os.system("chmod 777 /content/xorta/Miners/ethminer/v0.11.0_Nvidia_Optimized/Linux/ethminer")
1.171875
1
wmt21-multi-low-res/euro_low_res_multiling/data/wiki/remove_short.py
ufal/bergamot
0
12785555
<gh_stars>0 import sys for line in sys.stdin: if len(line.split(' '))>6: print(line.strip())
2.46875
2
dragoncord-bot/test.py
Dragoncord-for-discord/dragoncord
0
12785556
@bot.command() async def help1(ctx): cpage = discord.Embed( title = 'Команды бота | Версия бота: 2.5', description = f"say - Повторяет что Вы говорите.\nban - Банит участника.\nmute - Мутит участника.\ninfobot - Тут инфы о боте и создателя.\nuser - Информация о участника.\navatar - Аватарка у уч...
2.375
2
denverapi/tools/__main__.py
xcodz-dot/denver
4
12785557
<reponame>xcodz-dot/denver """ Prints a list of all available tools """ import os from denverapi import beautiful_cli cli = beautiful_cli.new_cli() def tool(path): p = os.path.basename(path) p = os.path.splitext(p)[0] return p if __name__ == "__main__": directory = os.path.dirna...
2.796875
3
alipay/aop/api/domain/MedicalHospitalDeptInfo.py
snowxmas/alipay-sdk-python-all
213
12785558
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class MedicalHospitalDeptInfo(object): def __init__(self): self._code = None self._location = None self._name = None self._parent_name = None self._partner_code ...
2.21875
2
idaes/power_generation/costing/power_plant_costing.py
carldlaird/idaes-pse
112
12785559
<gh_stars>100-1000 ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-20...
1.890625
2
WeatherStation/rtcds1307.py
flashypepo/myMicropython-Examples
3
12785560
# RTC clock with DS1307 # # 2017-0225 various tests, since micropython 1.8.7 changes RTC interface # Sources: # ESP8266 - connection to RTC, I2C-connection with NodeMCU # MicroPython class RTC: https://micropython.org/resources/docs/en/latest/wipy/library/machine.RTC.html # class RTC is only for WiPy board, but als...
3.234375
3
src/masonite/commands/__init__.py
cercos/masonite
1,816
12785561
<reponame>cercos/masonite<filename>src/masonite/commands/__init__.py from .CommandCapsule import CommandCapsule from .AuthCommand import AuthCommand from .TinkerCommand import TinkerCommand from .KeyCommand import KeyCommand from .ServeCommand import ServeCommand from .QueueWorkCommand import QueueWorkCommand from .Que...
1.34375
1
app/utils/dbutils.py
saowu/FigureBed
1
12785562
<filename>app/utils/dbutils.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- ' a test module ' __author__ = 'saowu' import pymysql from DBUtils.PooledDB import PooledDB class DBUtil(object): __instance = None def __init__(self, host, port, database, user, password, ): # 数据库连接池 self.pool =...
2.34375
2
kanshin/data.py
basuke/kanshin-export
0
12785563
# -*- coding: utf-8 -*- import boto3 from boto3.dynamodb.conditions import Key TABLE_PREFIX = 'KanshinCom-' USER_TABLE = TABLE_PREFIX + 'user' KEYWORD_TABLE = TABLE_PREFIX + 'keyword' CONNECTION_TABLE = TABLE_PREFIX + 'connection' DIARY_TABLE = TABLE_PREFIX + 'diary' dynamodb = boto3.resource('dynamodb', region_name...
1.96875
2
python/Calculator.py
mysteriouspla/helloAlgorithm
0
12785564
# Welcome to pyhack calculator num_1 = float(input("Enter the first number ")) num_2 = float(input("Enter the second number ")) print("Please select operation which you want to do: ") operator = int(input("Type 1-Addition, 2-Substration, 3-Multiplication, 4-Division " )) if operator == 1: a = num_1 + num_2 ...
4
4
app/configs/__init__.py
riszkymf/pricefinder_data_endpoint
0
12785565
<filename>app/configs/__init__.py import os from dotenv import load_dotenv from app.libs import MetaFlaskEnv APP_ROOT = os.path.join(os.path.dirname(__file__), '../..') dotenv_path = os.path.join(APP_ROOT, '.env') load_dotenv(dotenv_path=dotenv_path) class Config(metaclass=MetaFlaskEnv): ENV_PREFIX = "FLASK_"
2.3125
2
prototype/converter.py
kloppstock/deep_cyber
0
12785566
import numpy as np import sys # convert any index to a 4 tuple def unpackIndex(i, default): a = b = c = d = default if type(i) == int: d = i elif len(i) == 1: d = i[0] elif len(i) == 2: c = i[0] d = i[1] elif len(i) == 3: b = i[0] c = i[1] d =...
2.40625
2
tf/ensemble.py
zxlzr/atec_back
0
12785567
x1=[] x2=[] x3=[] import sys import numpy as np f1 = open("light_gbm.txt") for line in f1: x1.append(float((line.strip().split('\t')[1]))) #print x1 f2 = open("simese_cnn.txt") for line in f2: x2.append(0.5 + 0.5*float((line.strip().split('\t')[1]))) #print x2 f3 = open("matchpyramid.txt") for line in f3: ...
2.4375
2
people/repositories.py
jordifierro/abidria-api
93
12785568
<reponame>jordifierro/abidria-api<filename>people/repositories.py<gh_stars>10-100 from abidria.exceptions import EntityDoesNotExistException from .models import ORMPerson, ORMAuthToken, ORMConfirmationToken from .entities import Person, AuthToken class PersonRepo: def get_person(self, id=None, username=None, ema...
2.25
2
hello_world_mujoco_base.py
BolunDai0216/PyMuJoCoBase
5
12785569
from mujoco_base import MuJoCoBase def main(): xml_path = "./xml/ball.xml" mjb = MuJoCoBase(xml_path) mjb.simulate() if __name__ == "__main__": main()
1.46875
1
tests/__init__.py
tdidechkin/rethinkdb-sessions
5
12785570
from django.conf import settings settings.configure( SESSION_ENGINE='rdb_session.main' )
1.015625
1
species/plot/plot_spectrum.py
vandalt/species
0
12785571
""" Module with a function for plotting spectra. """ import os import math import warnings import itertools from typing import Optional, Union, Tuple, List import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from typeguard import typechecked from matplotlib.ticker import AutoMinorLocator, Mu...
2.46875
2
Print All Links.py
fatih-iver-2016400264/Search-Engine-with-Python
0
12785572
<gh_stars>0 def print_all_links(page): while True: url, endpos = get_next_target(page) if url: print(url) page = page[endpos:] else: break
3
3
tests/unit/p2p/messages/errors.py
btclib-org/btclib_node
4
12785573
from btclib_node.p2p.messages import get_payload from btclib_node.p2p.messages.errors import Notfound, Reject, RejectCode def test_not_found(): msg = Notfound([(1, "00" * 32)]) msg_bytes = bytes.fromhex("00" * 4) + msg.serialize() assert msg == Notfound.deserialize(get_payload(msg_bytes)[1]) def test_re...
2.40625
2
calvinextras/calvinsys/web/pushbullet/Pushbullet.py
gabrielcercel/calvin-base
334
12785574
<reponame>gabrielcercel/calvin-base<gh_stars>100-1000 # -*- coding: utf-8 -*- # Copyright (c) 2017 Ericsson AB # # 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/l...
1.789063
2
openpyscad/util.py
Samoxiaki/openpyscad
0
12785575
<reponame>Samoxiaki/openpyscad # -*- coding: utf-8 -*- from __future__ import absolute_import from .base import BaseObject from .boolean import Union from .shapes_3d import * from .transformations import * __all__ = ['Workspace', 'PolyhedronBuilder'] class Workspace(BaseObject): def __init__(self, position=[0,0,...
2.484375
2
Meraki/get_network_client_traffic_history.py
insidus341/devnet
0
12785576
from meraki_sdk.meraki_sdk_client import MerakiSdkClient from tools.api_key import key from get_network_id import get_network_id meraki = MerakiSdkClient(key) # net_id = get_network_id() net_id = 'L_594475150812909110' cient_id = 'k01816e' clients_controller = meraki.clients params = {} params['network_id'] = net_id...
2.0625
2
modules/loss.py
ChenX17/aligntts
0
12785577
<filename>modules/loss.py ''' Date: 2021-01-23 18:37:19 LastEditors: <NAME>(<EMAIL>) LastEditTime: 2021-02-02 23:30:55 ''' import torch import torch.nn as nn import torch.nn.functional as F import hparams as hp from utils.utils import get_mask_from_lengths import math class MDNLoss(nn.Module): def __init__(self)...
2.46875
2
shift_classification/preprocessing.py
team8/outdoor-blind-navigation
6
12785578
import numpy as np import cv2 def preprocess(img, side): img = cv2.rotate(img, cv2.ROTATE_90_COUNTERCLOCKWISE) img = cv2.transpose(img) size_y, size_x, _ = img.shape img_crop_size = (480, 480) min_resize = max(img_crop_size[0] / size_x, img_crop_size[1] / size_y) img = cv2.resize(img, (int(siz...
2.90625
3
make/help.py
abhishekgahlot/flexx
1
12785579
<reponame>abhishekgahlot/flexx<gh_stars>1-10 # License: consider this public domain """ Show the list of available commands, or details on a command. * python make help - show list of commands * python make help foo - show details on command "foo" """ import os import sys from make import THIS_DIR, NAME def help(c...
2.859375
3
controller_setter.py
lijian2020/NDNAPP
0
12785580
#!/usr/bin/python3 # # Copyright (C) 2019 Trinity College of Dublin, the University of Dublin. # Copyright (c) 2019 <NAME> # Author: <NAME> <<EMAIL>> # 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 Licen...
2.09375
2
mtp_noms_ops/apps/security/export.py
ministryofjustice/money-to-prisoners-noms-ops
3
12785581
import datetime import re from django.http import HttpResponse from django.utils.dateparse import parse_datetime from mtp_common.utils import format_currency from openpyxl import Workbook from security.models import credit_sources, disbursement_methods from security.templatetags.security import ( format_card_numb...
2.0625
2
src/scorers/result_scorer_pr_binary_factory.py
elangovana/large-scale-ptm-ppi
1
12785582
<gh_stars>1-10 from scorers.base_classification_scorer_factory import BaseClassificationScorerFactory from scorers.result_scorer_pr_binary import ResultScorerPrBinary class ResultScorerPrBinaryFactory(BaseClassificationScorerFactory): """ Factory for Pr Binary """ def get(self): return Result...
1.867188
2
python/p273.py
forewing/lc
0
12785583
<gh_stars>0 class Solution: def __init__(self): self.hundred = "Hundred" self.split = ["INVALID", "Thousand", "Million", "Billion"] self.tens = ["INVALID", "INVALID", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"] self.teens = ["Ten", "Eleven", "Twelve"...
3.296875
3
src/owmpy/current/_classes.py
ernieIzde8ski/open_weather_mappy
0
12785584
from ..utils import Number as _Number from ..utils import Units, _AutomaticClient from ._classes import * from .response import * class CurrentWeatherAPIException(Exception): pass class CurrentWeather(_AutomaticClient): BASE_URL = "https://api.openweathermap.org/data/2.5/weather" async def get( ...
2.765625
3
Joels_Files/mathFunctions/signal_math.py
Hullimulli/EEGEyeNet
0
12785585
<gh_stars>0 from tqdm import tqdm import os import numpy as np from config import config def pca(inputSignals: np.ndarray, filename: str, directory: str): """ Calculates the principle components for the given samples. Saves the matrix as a numpy file. @param inputSignals: 3d Tensor of the signals of which...
2.421875
2
src/commands/actions/download_entity.py
jherrerotardon/spies
0
12785586
<reponame>jherrerotardon/spies from pyframework.commands.action import Action from pyframework.exceptions.custom_exceptions import ArgumentException from ...triggers.entity_info_trigger import EntityInfoTrigger, AbstractTrigger class DownloadEntity(Action): """Concrete action to download entities (restaurants) f...
2.296875
2
cardboard/tests/test_phases.py
Julian/cardboard
5
12785587
<reponame>Julian/cardboard import unittest import mock from cardboard import events, phases as p from cardboard.tests.util import GameTestCase class TestPhase(unittest.TestCase): def test_init(self): h = p.Phase("Foo", [1, 2, 3]) self.assertEqual(h.name, "Foo") self.assertEqual(h.steps,...
3.125
3
starbot/configuration/config.py
onerandomusername/StarBot
0
12785588
<reponame>onerandomusername/StarBot from typing import Any from disnake import Permissions from starbot.configuration.config_abc import ConfigABC from starbot.configuration.definition import DEFINITION from starbot.configuration.utils import get_dotted_path class GuildConfig(ConfigABC): """ Represents one n...
2.78125
3
birdseye/actions.py
emmair/BirdsEye
0
12785589
<filename>birdseye/actions.py<gh_stars>0 import random import itertools import numpy as np class Actions(object): """Common base class for action methods Parameters ---------- action_space : tuple Set of tuples defining combinations of actions for all dimensions ...
2.984375
3
home.admin/BlitzTUI/blitztui/ui/qcode.py
PatrickScheich/raspiblitz
1,908
12785590
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'designer/qcode.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_DialogShowQrCode(object): def setupUi(self, DialogShowQrCode...
1.671875
2
CONSTANT.py
sotolatopiga/scrape-server
0
12785591
OUTPUT_PICKLE_FILENAME = "data.pickle"
1.132813
1
Command/commands/set.py
hc-tec/redis-py
1
12785592
from Client.interfaces import IClient from Command.base import BaseCommand, CommandType from Database.interfaces import IDatabase from Timer.event import TimeoutEvent from Timer.timestamp import Timestamp from Conf.command import CMD_RES class Set(BaseCommand): args_order = ['key', 'value', 'expires_time'] ...
2.21875
2
env_wrapper.py
modanesh/integrated-gradient-pytorch
0
12785593
""" The Atari environment(env) wrapper. Some envs needed some configurations which you can find below. """ import gym import numpy as np from scipy.misc import imresize class AtariWrapper(): def __init__(self, env): self.env = env self.observation_space = self.env.observation_space self.r...
2.515625
3
cart/admin.py
arihant-001/django-cart
0
12785594
<reponame>arihant-001/django-cart<filename>cart/admin.py from django.contrib import admin from cart.models import Order, OrderItem, ShippingAddress @admin.register(Order) class OrderAdmin(admin.ModelAdmin): pass @admin.register(OrderItem) class OrderItemAdmin(admin.ModelAdmin): pass @admin.register(Shippi...
1.757813
2
IG-robot.py
abdallah34/IG-bot
0
12785595
from time import sleep import requests import json class AbdullahCoder(): def __init__(self): self.hosturl = "https://www.instagram.com/" self.loginurl = "https://www.instagram.com/accounts/login/ajax/" self.editurl = "https://www.instagram.com/accounts/web_change_profile_picture/" ...
2.953125
3
config_wrangler/config_types/path_types.py
arcann/config_wrangler
0
12785596
import os import shutil from pathlib import Path from pydantic import DirectoryPath, FilePath from pydantic.validators import path_validator __all__ = [ 'FilePath', 'DirectoryPath', 'AutoCreateDirectoryPath', 'DirectoryFindUp', 'PathExpandUser', 'ExecutablePath', ] class PathExpandUser(Direct...
2.515625
3
test_shell.py
deepfield/ishell
0
12785597
import unittest from ishell.console import Console from ishell.command import Command import io from contextlib import redirect_stdout class TestConsole(unittest.TestCase): def test_console_creation(self): """Console must be created.""" c = Console() assert isinstance(c, Console) def ...
3.265625
3
pints/tests/test_toy_fitzhugh_nagumo_model.py
lisaplag/pints
0
12785598
#!/usr/bin/env python3 # # Tests if the Fitzhugh-Nagumo toy model runs. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import unittest import pints import pints.toy i...
3.078125
3
gen_asm_reljump.py
orsonteodoro/tsha
0
12785599
#!/usr/bin/python3 # # Near Jump, Jump Table Generator for sha256b # # Copyright (c) 2021-2022 <NAME> <<EMAIL>>. All rights reserved. # # 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 withou...
2.5
2
evaluation/matthews_corrcoef_evaluation.py
AghilasSini/AT-Annotator
0
12785600
from sklearn.metrics import matthews_corrcoef y_true = [+1, +1, +1, -1] y_pred = [+1, -1, +1, +1] matthews_corrcoef(y_true, y_pred)
1.8125
2
recipes/Python/473781_mthreadpy_version_2/recipe-473781.py
tdiprima/code
2,023
12785601
<reponame>tdiprima/code # #include <windows.h> import thread # #include <math.h> import math # #include <stdio.h> import sys # #include <stdlib.h> import time # static int runFlag = TRUE; runFlag = True # void main(int argc, char *argv[]) { def main(argc, argv): global runFlag # unsigned int runTime # PYT...
3.109375
3
main.py
HD13sel/Second_Me
0
12785602
from chatterbot import ChatBot from chatterbot.trainers import ListTrainer from spacy.cli import download download('en_core_web_sm') class ENGSM: ISO_639_1 = 'en_core_web_sm' chatbot = ChatBot('Botencio', tagger_langugage=ENGSM) conversa = [ 'Olá', 'Eai', 'Como você está?', 'Estou bem, e você...
2.71875
3
example_libs.py
LindsayYoung/Python-class-intro
1
12785603
<reponame>LindsayYoung/Python-class-intro # get user input and set variables number = raw_input("give me a whole number ") size = raw_input("give me a size ") noun = raw_input("give me a noun, please ") adjective = raw_input("give me an adverb ") # create the test by passing variables into strings beginning = "You wo...
4.15625
4
async_rx/observable/rx_map.py
geronimo-iia/async-rx
4
12785604
from inspect import iscoroutinefunction from typing import Any, Callable, Optional from ..protocol import Observable, Observer, Subscription, rx_observer_from from .rx_create import rx_create __all__ = ["rx_map"] def rx_map( observable: Observable, transform: Callable, expand_arg_parameters: Optional[bool] = Fa...
2.8125
3
examples/zmq_trigger_experiment.py
mark-dawn/stytra
0
12785605
<gh_stars>0 from stytra import Stytra, Protocol from stytra.stimulation.stimuli.visual import Pause, FullFieldVisualStimulus from stytra.triggering import ZmqTrigger class FlashProtocol(Protocol): name = "flash protocol" def __init__(self): super().__init__() self.add_params(period_sec=5., fl...
2.21875
2
python/testData/resolve/multiFile/dunderAllDynamicallyBuiltInHelperFunction/pkg/submod.py
Sajaki/intellij-community
2
12785606
__all__ = ['bar'] bar = 'bar'
1.21875
1
server/opendp_apps/communication/email_client.py
opendifferentialprivacy/opendp-ux
6
12785607
import os from sendgrid import sendgrid, Email, Content, Mail, To from django.conf import settings class SendGridAPIError(Exception): pass class EmailClient(object): def __init__(self, from_email=None, api_key=None): self.from_email = from_email if from_email else settings.DEFAULT_FROM_EMAIL ...
2.328125
2
code/TkGui.py
briansune/python-smith-chart-antenna-matching
1
12785608
import skrf import tkinter as tk from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import numpy as np import CircuitFig from PIL import ImageTk, Image, ImageDraw import io import MatchCal l2z = lambda l: l[0] + 1j * l[1] s4cmp = lambda sf: 'nH' if sf == 'l' else 'pF'...
2.1875
2
target_history_findings.py
Probely/API_Scripts
7
12785609
#!/usr/bin/env python """ Create an overview file of the target finding history This example is for python 3.5 """ import argparse import csv import getpass from collections import OrderedDict import requests from urllib.parse import urljoin api_base_url = "https://api.probely.com" auth_endpoint = urljoin(api_base_...
2.84375
3
podcomm/radio.py
badgerpapa/omnipy
0
12785610
<reponame>badgerpapa/omnipy<filename>podcomm/radio.py import threading from .exceptions import ProtocolError, RileyLinkError, TransmissionOutOfSyncError from podcomm import crc from podcomm.rileylink import RileyLink from .message import Message, MessageState from .packet import Packet from .definitions import * clas...
2.4375
2
project/forms/admin_unit_member.py
DanielGrams/gsevp
1
12785611
<gh_stars>1-10 from flask_babelex import lazy_gettext from flask_wtf import FlaskForm from wtforms import SubmitField from wtforms.fields.html5 import EmailField from wtforms.validators import DataRequired from project.forms.widgets import MultiCheckboxField class InviteAdminUnitMemberForm(FlaskForm): email = Em...
2.1875
2
students/K33402/Shuginin_Yurii/practical_works/simple_django_web_project/cars/migrations/0002_auto_20220107_2119.py
emina13/ITMO_ICT_WebDevelopment_2021-2022
0
12785612
<reponame>emina13/ITMO_ICT_WebDevelopment_2021-2022 # Generated by Django 3.2 on 2022-01-07 21:19 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cars', '0001_initial'), ] operations = [ migrations.AlterField( model_name='ca...
1.679688
2
pywinusb/__main__.py
sam-aldis/pyWinUSB
92
12785613
<filename>pywinusb/__main__.py<gh_stars>10-100 import os, sys from gi.repository import Gtk, GObject, Gdk from pywinusb.window import AppWindow def check_root_access(): """ Sprwdzenie czy skrypt jest instalowany pod rootem :return: True jeśli root """ return not os.geteuid() def main(): if not che...
1.953125
2
terraform/environments/core-logging/lambda/index.py
cherrymu/modernisation-platform
1
12785614
<filename>terraform/environments/core-logging/lambda/index.py<gh_stars>1-10 import boto3 import base64 from botocore.exceptions import ClientError import json athena_client = boto3.client('athena', region_name='eu-west-2') sts_client = boto3.client('sts') ssm_client = boto3.client('ssm', region_name='eu-west-2') quer...
2.0625
2
terrascript/alicloud/r.py
vutsalsinghal/python-terrascript
0
12785615
# terrascript/alicloud/r.py import terrascript class alicloud_instance(terrascript.Resource): pass class alicloud_ram_role_attachment(terrascript.Resource): pass class alicloud_disk(terrascript.Resource): pass class alicloud_disk_attachment(terrascript.Resource): pass class alicloud_network_inte...
1.65625
2
platalea/text_image.py
gchrupala/platalea
1
12785616
<filename>platalea/text_image.py from collections import Counter import json import logging import numpy as np import torch import torch.nn as nn import torch.optim as optim from platalea.basic import cyclic_scheduler import platalea.dataset as D from platalea.encoders import TextEncoder, ImageEncoder import platalea....
2.296875
2
deepq/asyn_sec/four_robots_asyn_test.py
longhuang318/RL-and-Robot
28
12785617
from multiprocessing import Process, Queue, Pipe from baselines import deepq import gym from deepq.asyn_sec.actor_interact_env import actor_inter from deepq.asyn_sec.simple_multi_agent import learn # from deepq.asyn_trainer_actor.new_models import mlp from deepq.models import mlp # from p2os_test.src.seventh_edition_g...
2.421875
2
wagtail_simple_gallery/migrations/0001_initial.py
MorezMartin/wagtail-simple-gallery
41
12785618
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-10-07 12:48 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import wagtail.core.fields class Migration(migrations.Migration): initial = True dependencies = [ ('wagtailcore',...
1.75
2
torchbenchmark/e2e_models/hf_bert/__init__.py
LaudateCorpus1/benchmark
0
12785619
<reponame>LaudateCorpus1/benchmark import torch import math import os from pathlib import Path from torch.utils.data import DataLoader from torchbenchmark.util.e2emodel import E2EBenchmarkModel from torchbenchmark.tasks import NLP from datasets import load_metric from accelerate import Accelerator from transformers imp...
2.203125
2
ch9-reading-and-writing-files/madlibs.py
aojrzynski/BK-automate-boring-stuff-python-projects
0
12785620
<filename>ch9-reading-and-writing-files/madlibs.py #! python3 # madlibs.py - reads in text files and lets the user add their own text anywhere the word # ADJECTIVE, NOUN, ADVERB, or VERB appears in the text file. # # NOTES: Needs a story.txt file to be in the same location as this program. import re import pyinputplus...
4.15625
4
lib/button.py
bopopescu/ros
0
12785621
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 by <NAME>. All rights reserved. This file is part of # the Robot OS project and is released under the "Apache Licence, Version 2.0". # Please see the LICENSE file included as part of this package. # # author: <NAME> # created: 2020-01-18 # modified: 2...
2.234375
2
pysynphot/test/utils.py
axru5812/pysynphot
0
12785622
<gh_stars>0 import pytest # This is to mark tests that require access to CDBS try: use_cdbs = pytest.mark.skipif(not pytest.config.getoption('--cdbs'), reason='need --cdbs option to run') except AttributeError: # Not using pytest use_cdbs = pytest.mark.skipif(True, reason='ne...
2.109375
2
generation/calibrations.py
guodashun/art-force
0
12785623
import math import numpy as np ## Real Data: # %% Kinect Color Camera color_cam_matrix = np.array([ 1.0526303338534365e+03, 0., 9.3528526085572480e+02, 0., 1.0534191001014469e+03, 5.2225718970556716e+02, 0., 0., 1. ]).reshape(3,3) color_distortion_coeffs = np.array([ 4.5467150011699140e-02, -7.4470107942918126e-02, -6...
2.046875
2
rnn_enhancement/unitary_linear.py
nicolas-ivanov/Seq2Seq_Upgrade_TensorFlow
65
12785624
<gh_stars>10-100 """Linear Algebraic Functions for Unitary Matrices. These equations come from http://arxiv.org/pdf/1511.06464v2.pdf This paper is constantly referenced throughout this library""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tenso...
2.578125
3
tests/scheduler/schemas/examples/test_utils.py
quantify-os/quantify-scheduler
1
12785625
# pylint: disable=missing-module-docstring # pylint: disable=missing-class-docstring # pylint: disable=missing-function-docstring import pytest from quantify_scheduler.schemas.examples import utils @pytest.mark.parametrize( "filename", [ "qblox_test_mapping.json", "transmon_test_config.json",...
1.90625
2
eval.py
cbschaff/nlimb
12
12785626
from deeplearning import tf_util as U from init import make_env_fn, make_model_fn from collections import namedtuple import os, argparse, json import numpy as np def eval_robot(args, env, pi): rewards = [] lengths = [] for j in range(args.nepisodes): rewards.append(0) lengths.append(0) ...
2.40625
2
bootimgpack/pack_bootimg.py
hchyhchyxh/tools
45
12785627
#!/usr/bin/python # Copyright 2015 duanqz # # 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...
2.390625
2
algorithms/kth-smallest-element-in-a-bst.py
Chronoviser/leetcode-1
41
12785628
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def traversal(self, root): if root: yield from self.traversal(root.left) yield root.val yield...
3.75
4
module/active/csp_info.py
b1ackc4t/getdomain
0
12785629
<gh_stars>0 from requests import get, exceptions from tldextract import extract import asyncio import aiohttp class CSPInfo(object): """ 利用csp头搜集子域名 """ def __init__(self, url): """ :param apex_domain: csp头中对应的顶级域名 :param ip: 域名对应ip地址 :param count: 域名有几个子域名 :pa...
2.796875
3
Themis2.0/grid.py
austinatchley/Themis
88
12785630
<filename>Themis2.0/grid.py import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import xml.etree.ElementTree as ET import themis2 class App(QDialog): def __init__(self): super().__init__() self.title = 'Themis 2.0' self.left = 100 self.t...
2.578125
3
albow/input/Field.py
hasii2011/albow-python-3
6
12785631
import logging from albow.widgets.Control import Control from albow.input.TextEditor import TextEditor class Field(Control, TextEditor): """ Field is an abstract base class for controls that edit a value with a textual representation. It provides facilities for - Converting between the text and i...
3.59375
4
tests/find_func_r2.py
CAFA1/angrop
0
12785632
import os import subprocess import r2pipe import sys #return file name work_dir='/home/l/Downloads/test/' def get_file_name(file_dir): file_elf=[] for root,dirs,files in os.walk(file_dir): for file in files: out_bytes=subprocess.check_output(['file',os.path.join(root,file)]) if(o...
2.84375
3
lesson2_netmiko/ex6f.py
anejolazaro70/python_july19
0
12785633
#!/usr/bin/python from datetime import datetime from netmiko import ConnectHandler from pprint import pprint from getpass import getpass import time password=<PASSWORD>() device={"host": "cisco4", "username": "user", "password": password, 'secret': password, "device_type": "cisco_ios", ...
2.5
2
venv/Lib/site-packages/PySide2/examples/installer_test/hello.py
TEDxVienna/continuum
0
12785634
# This Python file uses the following encoding: utf-8 # It has been edited by fix-complaints.py . ############################################################################# ## ## Copyright (C) 2019 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. ## ## $QT_BEGIN...
1.429688
1
dbus_async/__init__.py
hugosenari/dbus_async
1
12785635
__author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '0.1.0' from .core import Session, System, Bus from .client import Object from .service import Service
1.195313
1
supports/pyload/src/pyload/plugins/accounts/DepositfilesCom.py
LuckyNicky/pycrawler
1
12785636
# -*- coding: utf-8 -*- import re import time from ..base.account import BaseAccount class DepositfilesCom(BaseAccount): __name__ = "DepositfilesCom" __type__ = "account" __version__ = "0.39" __status__ = "testing" __pyload_version__ = "0.5" __description__ = """Depositfiles.com account pl...
2.4375
2
CONTENT/PYTHON/LEETCODE/155_min_stack/min_stack.py
impastasyndrome/DS-ALGO-OFFICIAL
13
12785637
<filename>CONTENT/PYTHON/LEETCODE/155_min_stack/min_stack.py<gh_stars>10-100 class MinStack: # initialize your data structure here. def __init__(self): self.nums = [] self.mins = [] # @param x, an integer # @return nothing def push(self, x): self.nums.append(x) if se...
3.390625
3
tests/data/e2e_latency_replacements.py
FrNecas/requre
4
12785638
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT from requre.import_system import UpgradeImportSystem from requre.simple_object import Simple FILTERS = UpgradeImportSystem().decorate("time.sleep", Simple.decorator_plain())
1.492188
1
lab/lab3/dist/autograder/tests/q4e.py
ds-modules/PS-88-21-DEV
0
12785639
<reponame>ds-modules/PS-88-21-DEV test = { 'name': 'q4e', 'points': 1, 'suites': [ { 'cases': [ {'code': '>>> 0 <= voter_2_pivotal_prob <= .25\nTrue', 'hidden': False, 'locked': False}, {'code': '>>> voter_2_pivotal_prob == sum(grouptrials.column("overall piv 2"))/ntri...
1.585938
2
news_buddy/alembic/versions/42b486977799_added_tags_table.py
izacus/newsbuddy
0
12785640
"""Added tags table Revision ID: 42b486977799 Revises: <PASSWORD> Create Date: 2014-02-05 23:57:37.029556 """ # revision identifiers, used by Alembic. revision = '42b486977799' down_revision = '<PASSWORD>' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table('tags', ...
1.59375
2
Python/54_SpiralMatrix.py
comicxmz001/LeetCode
2
12785641
class Solution(object): def spiralOrder(self, matrix): """ :type matrix: List[List[int]] :rtype: List[int] """ result = [] row = len(matrix) if row == 0: return matrix if row == 1: result = matrix[0] return result ...
3.3125
3
bot.py
diogoscf/telegram-birthday-bot
11
12785642
""" Bot that wishes happy birthday """ import datetime import json import logging import math import os import requests import sys from dotenv import load_dotenv from telegram import Update from telegram.ext import Updater, CommandHandler, CallbackContext # Load .env file load_dotenv() TOKEN = os.getenv("TOKEN") #...
2.78125
3
DjangoPractice/DjangoPractice/serializers.py
UVA-DSI-2019-Capstones/ARL
1
12785643
from django.contrib.auth.models import User from .models import TraineeResponseModel, MediaModel from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username', 'first_name', 'last_name', 'email') class TraineeSerializer(seriali...
2.09375
2
rpbp/reference_preprocessing/label_orfs.py
HeyLifeHD/rp-bp
6
12785644
<gh_stars>1-10 #! /usr/bin/env python3 """This script labels the ORFs based on their exon transcript structure with respect to annotated coding sequences """ import argparse import logging import pbio.misc.logging_utils as logging_utils import pbio.utils.bed_utils as bed_utils from rpbp.defaults import default_num_...
2.953125
3
assets/python/flaskserver.py
dnoneill/annotate-theme
0
12785645
from flask import Flask, jsonify from flask import request, render_template from flask_cors import CORS import json, os, glob, requests import base64 from settings import * from bs4 import BeautifulSoup import yaml import re import string, random import uuid app = Flask(__name__) CORS(app) annotations = [] @app.route...
2.328125
2
tests/test_vectors/did_doc/did_doc_bob.py
alex-polosky/didcomm-python
8
12785646
from authlib.common.encoding import json_dumps from didcomm.common.types import ( VerificationMethodType, VerificationMaterial, VerificationMaterialFormat, ) from didcomm.did_doc.did_doc import VerificationMethod, DIDDoc, DIDCommService from didcomm.protocols.routing.forward import ( PROFILE_DIDCOMM_V2...
2.25
2
tasks/code90/code/code90.py
internetwache/Internetwache-CTF-2016
83
12785647
<gh_stars>10-100 #!/usr/bin/env python2 import socket import threading import time import SocketServer import random import tree HOST = "0.0.0.0" PORT = 11491 WELCOME_MSG = "I'm lost in a forest. Can you invert the path?\n" ERROR_MSG = "Ooops, something went wrong here. Please check your input!\n" CORRECT_MSG = "Yay,...
2.703125
3
datascience/numpy/from_function.py
janbodnar/Python-Course
13
12785648
#!/usr/bin/python import numpy as np # Construct an array by executing a function over each coordinate. def f(x, y): return 2*x + y + 1 a = np.fromfunction(f, (5, 4), dtype=int) print(a) # anonymous functoin b = np.fromfunction(lambda x, y: 2*x + y, (2, 2)) print(b)
3.890625
4
indicators/management/commands/qa_program_widgets/qa_widgets.py
mercycorps/toladata
0
12785649
import math import random import json import os from copy import deepcopy from datetime import date, timedelta from itertools import cycle from dateutil.relativedelta import relativedelta from django.contrib.auth.models import User from django.utils import timezone from indicators.models import ( Indicator, I...
1.960938
2
src/handlers/feedback.py
ngshiheng/burplist-frontend
4
12785650
<reponame>ngshiheng/burplist-frontend __all__ = ['feedback'] from pywebio.output import put_html from pywebio.platform import seo from pywebio.platform.page import config from pywebio.session import run_js from src.settings import SEO_DESCRIPTION, SEO_TITLE from src.utils.constants import GA_JS_CODE, GA_JS_FILE from sr...
1.914063
2