text
string
size
int64
token_count
int64
#! /usr/bin/env nix-shell #! nix-shell -i python3 -p "[python3] ++ (with pkgs.python37Packages; [ requests future ws4py pytest pylint coveralls twine wheel ])" # <<END Extended Shebang>> import json from pywebostv.discovery import * from pywebostv.connection import * from pywebostv.controls import * with open('/home/...
844
278
#!/usr/bin/python import realog.debug as debug import lutin.tools as tools def get_type(): return "LIBRARY" def get_desc(): return "Lua interpretic script module" def get_licence(): return "MIT" def get_compagny_type(): return "org" def get_compagny_name(): return "lua" def get_maintainer(): return "author...
2,102
1,028
import pandas import pytest from covid_model_seiir_pipeline.lib.io import RegressionRoot from covid_model_seiir_pipeline.lib.io.marshall import ( CSVMarshall, ParquetMarshall, ) class MarshallInterfaceTests: """ Mixin class for testing the marshall interface. """ def test_parameters_marshall...
2,657
753
from telegram import Update from telegram.ext import CallbackContext, CommandHandler from bot.settings import settings from bot.utils import get_log from ._utils import require_owner log = get_log(__name__) @require_owner def command(update: Update, context: CallbackContext): log.debug('Taken command `setting...
727
210
import telegram from telegram.ext import CommandHandler, ConversationHandler, MessageHandler, \ Filters from civbot.commands.cmd_cancel import cancel_all from civbot.models import User, Subscription SELECT = 1 def add_game(bot, update): user = User.get_or_none(User.id == update.message.from_user.id) if...
3,595
1,063
# Rule nomad_run generates a runner script to execute nomad run with the given # job file. # # NOTE(kfeng): This rule currently assumes that the nomad executable is # installed on the host machine, and is in one of the directories listed in # the PATH environment variable. In the future, this project may fetch # the n...
982
287
def rmsprop_update(loss, params, grad_sq, lr=1e-1, alpha=0.8): """Perform an RMSprop update on a collection of parameters Args: loss (tensor): A scalar tensor containing the loss whose gradient will be computed params (iterable): Collection of parameters with respect to which we compute gradients grad_...
1,355
446
import logging from urllib.parse import urljoin import requests from thomas import Item, StreamerBase, router from unplugged import Schema, fields from twisted.internet import threads from ...exceptions import NotModifiedException, PathNotFoundException from ...plugins import InputPlugin from ...stream import Stream...
4,289
1,292
from api import get_secret, get_tweepy_api, TwitterApiSecret import json SECRET_NAME = "TwitterAPIKeys" def test_get_secret(): secret = get_secret(SECRET_NAME) assert secret is not None assert type(secret) is TwitterApiSecret assert len(secret.access_token) > 0 assert len(secret.access_token_secre...
741
261
# Copyright 2013-present Barefoot Networks, Inc. # # 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 agr...
34,698
13,150
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from model.exp_model import Experience, ExperienceSchema class ExperienceService(object): def __init__(self, app:Flask, db:SQLAlchemy) -> None: self.app = app self.db = db self.exp_schema = ExperienceSchema() ...
2,024
603
""" Code for turning a GAE Search query into a SOLR query. """ import logging import sys from constants import INDEX_NAME_FIELD, INDEX_LOCALE_FIELD from appscale.common.unpackaged import APPSCALE_PYTHON_APPSERVER sys.path.append(APPSCALE_PYTHON_APPSERVER) from google.appengine.api.search import query_parser from goo...
4,850
1,563
import sys import pickle def create_evaluable_CAG(input, output): with open(input, "rb") as f: G = pickle.load(f) G.res = 200 G.assemble_transition_model_from_gradable_adjectives() G.sample_from_prior() with open(output, "wb") as f: pickle.dump(G, f) if __name__ == "__main__": ...
367
147
byt = open("xor_key.bin", "rb").read() final = "\x00\x00\x00\x00\x6A\x00\x6A\x00\x68".encode() final = [e for e in final] final.append(0x26) final.append(0xFC) final.append(0x19) final.append(0x00) final.append(0x6A) final.append(0x00) final = [e for e in final] final.append(0xB8) final.append(0xC8) final.append(0x59) ...
774
384
''' Incremental-Classifier Learning Authors : Khurram Javed, Muhammad Talha Paracha Maintainer : Khurram Javed Lab : TUKL-SEECS R&D Lab Email : 14besekjaved@seecs.edu.pk ''' import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init class DownsampleStride(nn.Module)...
3,721
1,391
# -*- coding: utf-8 -*- """ IO ~~~~~~~~~~~~~~~~~~~ A Python module for Input and Ouput interactions :copyright: (c) 2020 Killian Mahé :license: MIT, see LICENSE for more details. """ __title__ = 'io' __author__ = 'Killian Mahé' __license__ = 'MIT' __copyright__ = 'Copyright 2020 Killian Mahé' __version__ = '0.0.1'...
406
158
''' Tools for dealing with multithreaded programs. ''' from concurrent.futures import ThreadPoolExecutor, as_completed from nlplib.general.iterate import chunked __all__ = ['simultaneously'] def simultaneously (function, iterable, max_workers=4) : ''' This runs the given function over the iterable concurrently...
2,095
646
# Generated by Django 2.2.5 on 2019-09-28 19:25 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('eyedetector', '0004_xypupilframe'), ] operations = [ migrations.CreateModel( name='Experiment',...
781
250
inp=input("Enter a string: ") rev=0 while (inp>0): dig=inp%10 rev=rev*10+dig inp=inp//10 print(rev)
108
63
import globals class Exhaust(globals.Hass): async def initialize(self): config = self.args["config"] self._input = config["input"] self._temperature = config["temperature"] self._min_temperature = float(config["min_temperature"]) self._max_temperature = float(config["max_te...
1,424
393
# -*- coding: utf-8 -*- from django.db import models from apps.registro.models.Anexo import Anexo from django.core.exceptions import ValidationError import datetime class AnexoBaja(models.Model): anexo = models.ForeignKey(Anexo) observaciones = models.CharField(max_length = 255) fecha_baja = models.DateFi...
474
164
import os import unittest from rosie import Rosie from rosie import DocumentNotFound # from test import create # create(100) class RosieTest(unittest.TestCase): def setUp(self): basedir = os.path.join(os.path.expanduser("~"), "Documents", "Progetti", "HTML-CSS", "rosie-ou...
2,159
676
# @file # # FadZmaq Project # Professional Computing. Semester 2 2019 # # Copyright FadZmaq © 2019 All rights reserved. # @author Lachlan Russell 22414249@student.uwa.edu.au # @author Jordan Russell jordanrussell@live.com import json # Tests that the server is up at all. def test_index(client): ...
2,726
1,012
import inspect import subprocess import tempfile from copy import copy from weakref import WeakKeyDictionary import piexif import pyheif from cffi import FFI from PIL import Image, ImageFile from pyheif.error import HeifError ffi = FFI() _keep_refs = WeakKeyDictionary() pyheif_supports_transformations = ( 'trans...
7,728
2,500
from cloc import grp, cmd, opt, arg, mixins from cloc.types import Choices """Test Code ->""" @grp('cli') def cli(): """cli docstring""" pass @grp('nested') def group2(): """group 2""" pass @grp('permissions') def permission_group(): pass @cmd('test') @arg('arg1', type=int, help='positional ar...
1,510
540
#!/usr/bin/env python3 import os os.system("openocd -f wukong.cfg -c 'init; pld load 0 build/top.bit; exit' ")
111
47
import json import time from utils.helper import RedisClient from paho.mqtt.client import MQTT_ERR_SUCCESS import paho.mqtt.client as mqtt from utils.date_time import TimeMeasure import tasks as tasks_mqtt from utils.message import MsgShadowGet, MsgShadowUpdate import logging logger = logging.getLogger() logger.setL...
3,916
1,391
# simple servo test for PCA9685 with HS422 from servo.servo import * from time import sleep pca = PCA9685() pca.setZero(0) sleep(2) for a in xrange(-67,67,1): pca.setAngle(0,a) sleep(0.05) for a in xrange(67,0,-1): pca.setAngle(0,a) sleep(0.05)
255
132
items = input().split("|") # items to buy budged = int(input()) profit = 0 profit_price_list = [] profit_list = [] profit_price = 0 for index in items: profit = 0 profit_price = 0 separator = index.split("->") if separator[0] == "Clothes": if not 0 < float(separator[1]) <= 50: co...
1,386
473
from rest_framework import viewsets from rest_framework.serializers import ValidationError from .models import Address from .serializers import AddressSerializer from lims.permissions.permissions import IsAddressOwner, IsAddressOwnerFilter from lims.shared.mixins import AuditTrailViewMixin class AddressViewSet(Audi...
1,209
326
''' Created on Sep 8, 2018 Use autocropFaces() to crop out the material around faces in an image, where the faces are automatically detected. See the bottom for an example use script. Used this as a starting reference point: https://docs.opencv.org/3.3.0/d7/d8b/tutorial_py_face_detection.html @author: tmahrt ''' i...
7,875
2,629
# -*- coding: utf-8 -*- """MultistageDdecWorkChain workchain""" from __future__ import absolute_import from aiida.plugins import CalculationFactory, DataFactory, WorkflowFactory from aiida.common import AttributeDict from aiida.engine import WorkChain, ToContext # import sub-workchains Cp2kMultistageWorkChain = Work...
2,920
1,057
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
2,997
978
import sys import time from itertools import chain from pathlib import Path import nbformat import notedown def convert(path, timeout=40 * 60): with path.open() as in_file: notebook = notedown.MarkdownReader().read(in_file) start = time.time() notedown.run(notebook, timeout) print(f"=== {pa...
828
280
from .tu_simple_lane import TusimpleLane
40
15
import turtle as t n = 50 t. bgcolor("black") t. color("green") t. speed(0) for x in range(n): t. circle(80) t. lt(360/n)
147
69
from .dashboard_menu import *
29
9
# The 3-Clause BSD License # Copyright (C) 2019, KessK, all rights reserved. # Copyright (C) 2019, Kison.Y, all rights reserved. # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met:Redistribution and use in source and binary ...
25,389
7,394
from matplotlib import pyplot iters = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72...
691,455
691,086
''' Description: numpy项目相关 Author: HCQ Company(School): UCAS Email: 1756260160@qq.com Date: 2021-04-25 19:49:38 LastEditTime: 2021-04-25 19:57:55 FilePath: /python-libraries/01Numpy/np_project.py ''' import numpy as np # 通过下标列表获取np数据 # A = [[ 3 4 5 6] # [ 7 8 9 10] # [11 12 13 14]] A = np.arange(3,15).reshape((...
403
239
import FWCore.ParameterSet.Config as cms QualityMon = cms.EDAnalyzer("SiStripMonitorQuality", StripQualityLabel = cms.string('test1'), OutputMEsInRootFile = cms.bool(False), OutputFileName = cms.string('SiStripQuality.root') )
242
90
import os import sys sys.path.append("../../../monk/"); import psutil from gluon_prototype import prototype ########################################################################################################################## gtf = prototype(verbose=1); gtf.Prototype("sample-project-1", "sample-experiment-1");...
1,036
254
import models from DefCurse import widgets from DefCurse import style from DefCurse import area def render(model: models.Model, rows: int, cols: int): areas = [ area.Area( int(rows/2), int(cols/2), ), area.Area( int(rows/2), int(cols/2), ...
1,087
370
from django.conf.urls import url, include from rest_framework import routers from api.views import UserViewSet, GroupViewSet,FeedViewSet router = routers.DefaultRouter() router.register(r'users', UserViewSet) router.register(r'groups', GroupViewSet) router.register(r'feeds', FeedViewSet) router.register(r'category', ...
579
178
#!/usr/bin/env python3 from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ ] setup_requirements = [ 'pytest-runner', ] test_requirements = [ 'pytest>...
1,512
515
import argparse import os import sys import subprocess import time import numpy as np import random import h5py def main(): parser = argparse.ArgumentParser() parser.add_argument('--data', type=str, required=True, help='training data') parser.add_argument('--align', type=str, required=True, help='alignmen...
1,009
307
class Solution: def XXX(self, strs: List[str]) -> str: if not strs: return '' s_min, s_max = min(strs), max(strs) for i, c in enumerate(s_min): if c != s_max[i]: return s_min[:i] return s_min undefined for (i = 0; i < document.getElementsByTagName("code"...
409
136
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys def has_duplicate(phrase): seen = set() words = phrase.split(' ') for w in words: if w in seen: return True seen.add(w) return False def check(text): count = 0 phrases = text.split('\n') for p in phr...
627
225
import setuptools from setuptools import setup, Extension, find_packages from setuptools.command.build_ext import build_ext import sys import setuptools import os import re import platform import subprocess # from pathlib import Path from os.path import expanduser, join from distutils.version import LooseVersion impor...
4,707
1,500
''' https://www.geeksforgeeks.org/command-method-python-design-patterns/ Command Method is Behavioral Design Pattern that encapsulates a request as an object, thereby allowing for the parameterization of clients with different requests and the queuing or logging of requests. Parameterizing other objects with different ...
4,156
1,021
import functools import numpy as np import theano import theano.tensor as T import treeano import treeano.nodes as tn import canopy from treeano.sandbox.nodes import batch_normalization as bn fX = theano.config.floatX @treeano.register_node("strided_downsample") class StridedDownsampleNode(treeano.NodeImpl): hy...
18,099
4,899
from test_module import module_func_2 as oar module_func()
58
19
from astropy import constants import math import autofit as af import autoarray as aa import autogalaxy as ag from autoarray.mock.mock import * from autofit.mock.mock import * from autofit.mock import mock as af_m # MockProfiles # class MockLightProfile(ag.lp.LightProfile): def __init__( ...
6,857
2,332
import json import ast import plotly.plotly as py import plotly.graph_objs as go import plotly.io as pio import os import numpy as np import plotly plotly.io.orca.config.executable = '/home/gabi/dev/miniconda3/bin/orca' #May be useful in Ubuntu #PARAMS logs_path = "C:\\Users\\gbosetti\\Desktop\\test\\logs" output_pat...
9,441
3,159
from controllers import * route = [ ( r"/", home.homeHandler ), ( r"/auth/register", auth.registerHandler ), ( r"/logout", logout.logoutHandler ), ( r"/home", timetable.timeTableHandler ), ( r"/auth/login", auth.loginHandler ) ]
285
148
# -*- coding: utf-8 -*- import unittest import libkeepass import keepass_guesser # file : attempts from file expected before success or failure guess_files = {'tests/data/guesslist0': {'attempts': 3, 'guessphrase': None}, 'tests/data/guesslist1': {'attempts': 1, 'guessphrase': 'test'}, 't...
1,935
642
import numpy as np import os class MovielensDatasetLoader: def __init__(self, filename='./ml-1m/ratings.dat', npy_file='./ml-1m/ratings.npy', num_movies=None, num_users=None): self.filename = filename self.npy_file = npy_file self.rating_tuples = self.read_ratings() if num_users is None: self.num_users = n...
1,173
496
# Copyright (c) 2021, Thomas Aglassinger # All rights reserved. Distributed under the BSD 3-Clause License. from sanpo.command import main_without_logging_setup from ._common import PoFileTest class CommandTest(PoFileTest): def test_can_show_help(self): with self.assertRaises(SystemExit): mai...
1,785
620
import pytest import logging import struct import base64 import msgpack import nacl.signing import algosdk from . import txn_utils from . import ui_interaction from . import speculos @pytest.fixture def keyreg_txn(): b64votekey = "eXq34wzh2UIxCZaI1leALKyAvSz/+XOe0wqdHagM+bw=" votekey_addr = algosdk.encodi...
3,371
1,366
from sklearn.feature_extraction.text import TfidfVectorizer from database_utils import get_all_data, remove_summary from collections import OrderedDict import operator def rank_pages(summaries, query): vect = TfidfVectorizer() result = {} for video in summaries: tfidf = vect.fit_transform([video...
613
204
from netapp.netapp_object import NetAppObject class IfgrpInfo(NetAppObject): """ ifgrp name, type, and components. """ _interface_name = None @property def interface_name(self): """ The interface name. """ return self._interface_name @interface_name.sett...
3,112
962
from .abstractExpression import AbstractExpression from typing import TypeVar T = TypeVar('T') class IdExpression(AbstractExpression): def __init__(self, id_: T): self.id = id_ def __repr__(self) -> str: return str(self.id) def __eq__(self, other) -> bool: if self is other: ...
545
164
import os import sys from typing import Tuple import pkg_resources from Bio import SeqIO import RNA import numpy as np complement_table = str.maketrans('ATGCU', 'TACGA') def stream_fasta_seq_list(fasta_filename): with open(fasta_filename, "rU") as handle: for record in SeqIO.parse(handle, "fasta"): ...
4,679
1,684
#!/usr/bin/env python3 # # Analyses a hierarchical tab-indented list file # and prints out subsection sizes on a requested nesting level # Subsections with the same name in different subtrees # are treated as continutaions of a single section # The script accepts two command line parameters: # file name # indent...
2,288
682
#based on the code from https://github.com/studywolf/blog/blob/master/VREP/two_link_arm/vrep_twolink_controller.py #explained at https://studywolf.wordpress.com/2016/04/18/using-vrep-for-simulation-of-force-controlled-models/ import numpy as np from VrepWorld import VrepWorld #create the world object world = Vrep...
1,357
487
from ROAR.control_module.controller import Controller from ROAR.utilities_module.vehicle_models import VehicleControl, Vehicle from ROAR.utilities_module.data_structures_models import Transform, Location import numpy as np import logging from ROAR.agent_module.agent import Agent from typing import Tuple import json fro...
15,902
4,908
from django.test import TestCase from eahub.base.models import User from eahub.localgroups.models import LocalGroup, Organisership from eahub.profiles.models import Profile class LocalGroupTestCase(TestCase): def test_organisers_names(self): local_group = LocalGroup() local_group.save() ...
2,268
683
import boto3 import sys import getopt import datetime import pytz # Globals BucketName = '' FolderName = '' HowManyDays = None ProfileName = 'default' Env = 'us-east-1' Delete = False # Parse CL opts opts, args = getopt.getopt(sys.argv[1:],'he:b:p:f:k:d') for opt, arg in opts: if opt == '-h': print '-b bu...
2,204
761
from cloudmosh.components.base import CloudMoshComponent import os import numpy as np # Keras / TensorFlow os.environ['TF_CPP_MIN_LOG_LEVEL'] = '5' from keras.models import load_model import skimage.io from skimage.transform import resize from keras.engine.topology import Layer, InputSpec import keras.utils.conv_utils ...
5,769
2,063
# ============================================================================== # Copyright 2018 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.apa...
9,316
2,853
from fixing import * from observable import * from generate_flows import * from generate_observables import * class swap_rate(observable): def __init__(self , attributes , flow_id , reset_id , reset_date , reset_ccy , proj_start_date ...
5,038
1,555
import discord from discord.ext import commands import os import random from server import run_server #token token = os.environ.get("token") #prefisso bot = commands.Bot(command_prefix="m!", description="Nada.") bot.remove_command('help') #status @bot.event async def on_ready(): print("Sono online come", bot.use...
10,953
3,621
import numpy as np import string import re __all__ = ['BADAA', 'AALPHABET', 'convertHLAAsterisk', 'isvalidmer', 'isvalidHLA', 'rankEpitopes', 'rankKmers', 'rankMers', 'getIC50', 'getMers', 'getMerInd...
19,506
6,285
assert __name__ == '__main__' # in shell import os, sys simfempypath = os.path.abspath(os.path.join(__file__, os.path.pardir, os.path.pardir, os.path.pardir, os.path.pardir,'simfempy')) sys.path.insert(0,simfempypath) import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pygm...
5,697
2,298
import re import ujson from psycopg2.sql import SQL, Composable, Identifier from polecat.utils import to_bool, to_tuple from ...schema.column import ReverseColumn from .expression import Expression class DiscardValue: pass class Where: FILTER_PROG = re.compile(r'^([a-zA-Z][a-zA-Z0-9_]+(?:__[a-zA-Z][a-zA-Z...
11,816
3,573
import json from autobahn.asyncio.websocket import WebSocketClientProtocol from config import DEBUG, CLIENTS_MSGS_COUNT, CLIENTS_COUNT class WSClientProtocol(WebSocketClientProtocol): """ Websocket client protocol. """ def __init__(self): super(WSClientProtocol, self).__init__() sel...
1,479
468
import pytest import time import json from datetime import date, timedelta from www.core import Synapse, Env from www.services.synapse_space.daa import GrantDaaAccessService import synapseclient as syn @pytest.fixture def mk_service(syn_test_helper, syn_client, mk_uniq_real_email, blank_daa_config, set_daa_config): ...
13,174
3,855
import numpy as np # create J[k,h], the number of individuals in niche k on island h def draw_J(K, JV): # secondary parameters H = len(JV) # number of islands J = list() for k in range(K): J.append([]) for h in range(H): Jkh_float = JV[h] / K # number of indivi...
6,048
1,869
""" Game fix for Watch_Dogs """ # pylint: disable=C0103 import subprocess from protonfixes import util from protonfixes import splash def main(): """ Fix the in-game sound """ util.protontricks('xact') util.protontricks('winxp') info_popup() @util.once def info_popup(): """ Show info popup...
767
263
import collections from abc import ABC, abstractmethod from typing import TypeVar, Generic, Callable, OrderedDict, Collection, Any from brigadier import Command, RedirectModifier S = TypeVar('S') # the class ouroboros keeps growing class CommandNode(ABC, Generic[S]): @abstractmethod def is_valid_input(self,...
3,928
1,082
from absl import app, flags, logging from absl.flags import FLAGS import cv2 import os import numpy as np import tensorflow as tf import time from PIL import Image from modules.models import RetinaFaceModel from modules.utils import (set_memory_growth, load_yaml, draw_bbox_landm, pad_input_...
3,564
1,327
from .resource import ValveCompiledResource from .vphys import ValveCompiledPhysics from .vmat import ValveCompiledMaterial from .vtex import ValveCompiledTexture from .vmdl import ValveCompiledModel from .vwrld import ValveCompiledWorld from .vmorf import ValveCompiledMorph from .vrman import ValveCompiledResourceMani...
803
243
#!/usr/bin/env python # -*- coding: utf-8 -*- """ b2ac.compat ~~~~~~~~~~~ B2AC compatiblity module. """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import sys is_py3 = (sys.version_info[0] > 2) # Py3 mappings ...
351
135
#!/usr/bin/env python3 n, *a = map(int, open(0).read().split()) from itertools import* *S, = accumulate(a) *M, = accumulate(S, max) Z = ans = 0 for s, m in zip(S, M): ans = max(ans, Z + m) Z += s print(ans)
214
96
class SoundError(Exception): pass class WavePlayError(Exception): pass class ArgumentError(Exception): pass class PlayerError(Exception): pass class PlayerMciError(Exception): pass
209
63
import functools def adageop(func): """ Decorator that adds a 's' attribute to a function The attribute can be used to partially define the function call, except for the 'adageobj' keyword argument, the return value is a single-argument ('adageobj') function """ def partial(*args,**kwar...
1,978
560
import sys import getpass from keepassxc_pwned import check_password pw = getpass.getpass("Password to check: ") count = check_password(pw) if count > 0: print("Found password {} times!".format(count)) sys.exit(1) else: print("Could not find that password in the dataset.") sys.exit(0)
300
100
from __future__ import unicode_literals import django from django.test import TestCase from job.configuration.results.results_manifest.results_manifest import ResultsManifest from job.configuration.results.exceptions import InvalidResultsManifest, \ MissingRequiredOutput class TestResultsManifestConstructor...
9,318
2,764
# -*- coding: utf-8 -*- # _ __ # | |/ /___ ___ _ __ ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| # |_| # # Keeper Commander # Copyright 2022 Keeper Security Inc. # Contact: ops@keepersecurity.com # from typing import Optional, Callable, Iterator, List, Iterable, Tuple import a...
30,543
8,248
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from __future__ import with_statement from builtins import input import mpcorbget as mpc def main(): """Handy dandy quick ephemeris tool""" print("QuickEphem v1.1...
855
267
import unittest import logging import game_code log = logging.getLogger('test.level_1') class TestAdventureLevelOne(unittest.TestCase): @classmethod def setUpClass(cls): cls.game = game_code.main.start_game(interface='python') def test_outside_slowly(self): outside = self.game.interfac...
5,338
1,753
import unittest from project.player.beginner import Beginner from project.player.player_repository import PlayerRepository class TestPlayerRepo(unittest.TestCase): def setUp(self): self.repo = PlayerRepository() def test_set_up(self): self.assertEqual(self.repo.count, 0) self.assertL...
1,627
555
import xml.etree.ElementTree as ET class Template: def __init__(self, image, default_xml): self.tree = ET.parse(default_xml) self.root = self.tree.getroot() self.image = image def add_template_objects(self, xml, **kargs): tree = ET.parse(xml) root = tree.getroot() ...
1,663
568
from .datasets import * # noqa from .metrics import * # noqa
61
21
from monstage import * class MonType(): def __init__(self,sprites=None,stage=egg,becomes=None): self.stage = stage self.becomes = becomes self._sprites = sprites def setSprites(self,sprites): if type(sprites) not in [list,tuple] or sprites == None: ...
640
226
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2019-04-09 04:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('netdevice', '0006_auto_20190409_0325'), ('bgp', '0003_auto_20190328_0332'), ] ...
619
235
import sys import os import subprocess as proc import distutils.spawn as which version = sys.version[:3] activate_env_path = os.path.join("env", "bin", "activate_this.py") activate_env = activate_env_path opts = {} def has_colours(stream): if not hasattr(stream, "isatty"): return False if not stream.isatty():...
2,195
792
# from functools import lru_cache as memoize from collections import namedtuple from pyparsing import Regex, SkipTo, ParseException, OneOrMore, Optional, Suppress, Empty Language = namedtuple("Language", ["code", "text"]) # directives # _dsee = Suppress("@see")+SkipTo(LineEnd()) # _dparam = Suppress("@param")+SkipT...
2,031
735
from abc import ABC, abstractmethod class AbstractModel(ABC): def __init__(self): self.model = None self.word2idx = None self.idx2word = None self.tag2idx = None self.idx2tag = None self.max_len = None self.vocabulary = None self.categories = None...
1,314
422
import logging import sys import concurrent.futures as cf from time import clock, time import numpy as np import pytest from worms import simple_search_dag, Cyclic, grow_linear, NullCriteria from worms.util import InProcessExecutor from worms.database import CachingBBlockDB, CachingSpliceDB from worms.ssdag_pose impo...
7,327
3,242