text
stringlengths
12
6.59M
# -*- coding: utf-8 -*- ''' Support for Debconf ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import os import re # Import salt libs import salt.utils.path import salt.utils.files import salt.utils.stringutils import salt.utils.versions log = logging...
# -*- coding: utf-8 -*- ''' Remote package support using ``pkg_add(1)`` .. warning:: This module has been completely rewritten. Up to and including version 0.17.0, it supported ``pkg_add(1)``, but checked for the existence of a pkgng local database and, if found, would provide some of pkgng's functio...
# -*- coding: utf-8 -*- ''' Edit ini files :maintainer: <akilesh1597@gmail.com> :maturity: new :depends: re :platform: all (for example /etc/sysctl.conf) ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import os import re # Import Salt libs import salt.utils.data imp...
# -*- coding: utf-8 -*- ''' Edit ini files :maintainer: <akilesh1597@gmail.com> :maturity: new :depends: re :platform: all Use section as DEFAULT_IMPLICIT if your ini file does not have any section (for example /etc/sysctl.conf) ''' from __future__ import absolute_import # Import Python libs import re __virtualnam...
''' Service support for classic Red Hat type systems. This interface uses the service command (so it is compatible with upstart systems) and the chkconfig command. ''' import os def __virtual__(): ''' Only work on systems which default to systemd ''' # Disable on these platforms, specific service mod...
# -*- coding: utf-8 -*- ''' IPS pkg support for Solaris This module provides support for Solaris 11 new package management - IPS (Image Packaging System). In order to manage the IPS packages using salt, you need to override the ``pkg`` provider by setting the :conf_minion:`providers` parameter in your Minion config fi...
# -*- coding: utf-8 -*- ''' Support for reboot, shutdown, etc ''' import salt.utils def __virtual__(): ''' This only supports Windows ''' if not salt.utils.is_windows(): return False return 'system' def halt(timeout=5): ''' Halt a running system CLI Example: .. code-bl...
# -*- coding: utf-8 -*- ''' Support for reboot, shutdown, etc ''' from __future__ import absolute_import # Import python libs import logging import re # Import salt libs import salt.utils # Set up logging log = logging.getLogger(__name__) # Define the module's virtual name __virtualname__ = 'system' def __virtual...
# -*- coding: utf-8 -*- ''' Management of zc.buildout ========================= .. versionadded:: 2014.1.0 .. _`minitage's buildout maker`: https://github.com/minitage/minitage/blob/master/src/minitage/core/makers/buildout.py This module is inspired by `minitage's buildout maker`_ .. note:: The zc.buildout int...
# -*- coding: utf-8 -*- ''' Encapsulate the different transports available to Salt. Currently this is only ZeroMQ. ''' import time import os import threading # Import Salt Libs import salt.payload import salt.auth import salt.utils import logging from collections import defaultdict log = logging.getLogger(__name__) ...
# -*- coding: utf-8 -*- ''' Helpers/utils for working with tornado asynchronous stuff ''' from __future__ import absolute_import, print_function, unicode_literals import sys import tornado.ioloop import tornado.concurrent import contextlib from salt.ext import six from salt.utils import zeromq @contextlib.contextm...
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import json import client_cmdmanager import test_utils # Test-user account details USR, PW = 'mail@hotmail.com', 'Hard_Password_Since_1985' class TestCmdManagerDaemonConnection(unittest.TestCase): """ Test the connection between Cmd Manager and...
"""Tokenizes sentences.""" __author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>' __license__ = 'MIT License. See LICENSE.' from cltk.corpus.common.file_operations import open_pickle import pickle from pickle import PickleError from nltk.tokenize.punkt import PunktLanguageVars from nltk.tokenize.punkt import PunktS...
# coding: utf-8 from django.views import generic from harvest.models import Harvest, Property, Equipment, \ RequestForParticipation, TreeType, Comment, PropertyImage, HarvestYield, HarvestImage from harvest.forms import CommentForm, RequestForm, PropertyForm, \ HarvestForm, PropertyImageForm, EquipmentForm, RFP...
try: from decimal import Decimal except: from django.utils._decimal import Decimal import logging from django.core import urlresolvers from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.datastr...
# Calculate production rates for Satisfactory # Requires Python 3.7, maybe newer # I spent WAY too much time and had WAY too much fun doing this. Deal with it. from collections import defaultdict, Counter from fractions import Fraction import itertools consumers = defaultdict(list) producers = defaultdict(list) clas...
from ..graph import Greengraph from ..map import Map import os import yaml from nose.tools import assert_equal, assert_almost_equal from mock import patch def test_Greengraph(): ''' Test to ensure Greengraph instantiates correctly. ''' actual = Greengraph('London', 'Cambridge') assert_equal(actua...
from trac import TracClient from jenkins import JenkinsClient class NotificationCentre(object): """ Manages notifications from all sources and distributes them to sinks. """ def __init__(self, update_interval): self._sources = dict() self._sinks = dict() self._update_interval ...
# Copyright 2015 PerfKitBenchmarker 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 appli...
import base64 import virtool.user import virtool.utils import virtool.errors from virtool.handlers.utils import bad_request AUTHORIZATION_PROJECTION = ["user", "groups", "permissions"] class Client: def __init__(self, ip, user_agent): # These attributes are assigned even when the session is not author...
# -*- coding: utf-8 -*- """ Frost Number by Nelson and Outcalt 1983. DOI: 10.2307/1551363. http://www.jstor.org/stable/1551363 This is the Geo version """ from __future__ import print_function import numpy as np from permamodel.components import perma_base from permamodel.components import frost_number_Geo...
import semver from virtool.user_permissions import PERMISSIONS from virtool.user_groups import merge_group_permissions async def organize(db, server_version): if semver.parse(server_version)["major"] == 3: return if "viruses" in await db.collection_names(): await db.viruses.rename("targets")...
import os import arrow import virtool.virus import virtool.virus_index import virtool.sample import virtool.organize_utils from virtool.user_permissions import PERMISSIONS from virtool.user_groups import merge_group_permissions async def organize_jobs(db): """ Unset deprecated fields ``_version`` and ``archi...
import sys from distutils.util import strtobool from django.db import transaction from django.db.utils import IntegrityError from django.core import serializers from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django....
import logging import os import pymongo.errors import shutil import virtool.db.references import virtool.db.utils import virtool.references import virtool.users import virtool.utils logger = logging.getLogger(__name__) REFERENCE_QUERY = { "reference": { "$exists": False } } async def add_original_r...
assert __import__("pkg_resources").get_distribution( "sqlalchemy").version.split('.') >= ['0', '6'], \ "requires sqlalchemy version 0.6 or greater" import warnings import uricore from sqlalchemy import schema, Table, exc, util from sqlalchemy.schema import Constraint from sqlalchemy.sql import (text, bindpara...
#!/usr/bin/env python # Copyright 2014 Scalyr 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 ag...
import sys import pdb import svgfig import json import math argv = {} argv["json"] = 0 g = svgfig.SVG("g") nodes = set() offset = 15 hoffset = 15 voffset = 10 groups = {} #svgfig._canvas_defaults["width"] = '1200px' svgfig._canvas_defaults["width"] = str(100*12) + 'px' # BEGIN FUNCTIONS def show_help(): print("Usag...
"""Plotting functions for AnnData. """ import os import numpy as np import pandas as pd from pandas.api.types import is_categorical_dtype from scipy.sparse import issparse from matplotlib import pyplot as pl from matplotlib import rcParams from matplotlib.colors import is_color_like import seaborn as sns from .. impo...
import asyncio import datetime import unicodedata import xml.etree.ElementTree as et import discord from bs4 import BeautifulSoup from discord.ext import tasks from discord_slash import cog_ext from discord_slash.model import SlashCommandOptionType from discord_slash.utils.manage_components import (create_actionrow, ...
usr/bin/python3.2 '''Getting the module''' import os from os import listdir from os.path import isfile, join # Subprocess doesnt currently work from subprocess import call check = 0 while(check != 1): directory = input("Enter the full (absolute) path of the directory: ") if os.path.isdir(directory):...
# -*- coding: utf-8 -*- from datetime import date from cms.utils.compat.metaclasses import with_metaclass from django.core.urlresolvers import reverse, NoReverseMatch from django.utils.safestring import mark_safe import os import warnings from django.core.exceptions import ValidationError, ObjectDoesNotExist from djan...
#!/usr/bin/python # # Generating ready-to-draw access patterns for a given file. # # # Copyright 2017 Xilopix, Inc. # Author: Abdulqawi SAIF # Licensed under the Apache License, Version 2.0 (the "License") from __future__ import print_function from bcc import BPF import argparse import signal import re import ctypes ...
try: from django.db.transaction import atomic as commit_on_success except ImportError: try: try: from ..versioning.transactions import xact as commit_on_success except ValueError: from versioning.transactions import xact as commit_on_success except ImportError: ...
import asyncio import datetime import xml.etree.ElementTree as et import discord from bs4 import BeautifulSoup from discord.ext import commands from discord.ext.commands.cooldowns import BucketType from .exceptions import APIError class NotiifiersMixin: @commands.group() @commands.guild_only() @commands...
from django.db.models.base import ModelBase from cms.models.pagemodel import Page from cms.models.placeholdermodel import Placeholder from os.path import join from datetime import datetime, date from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import Valid...
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame SCREEN_WIDTH = 640 SCREEN_HEIGHT = 480 """ # Background black = Color(0, 1) noline = LineStyle(0, black) bg_asset = RectangleAsset(SCREEN_WIDTH, SCREEN_HEIGHT, noline, black) bg = Sprite(bg_asset, (0,0)) """ class SpaceShip(Sprite): ...
""" Async helper function that are invalid syntax on Python 3.5 and below. Known limitation and possible improvement. Top level code that contain a return statement (instead of, or in addition to await) will be detected as requiring being wrapped in async calls. This should be prevented as early return will not work....
''' Copyright (c) 2013 Potential Ventures Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions an...
from utilities.account_manager import AccountManager from utilities.backend_config import Configuration import storj from utilities.log_manager import logger class StorjEngine: def __init__(self): self.conf_manager = Configuration() self.account_manager = AccountManager() self.password = ...
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. import sys import traceback import inspect from UM.PluginObject import PluginObject ## Static class used for logging purposes. This class is only meant to be used as a static class. class Logger: def __init__(self...
import json import locale import pycurl import re import time import urllib from collections import OrderedDict from distutils.version import LooseVersion try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO from Utils import * from http import HttpInterface, UserAgent, Re...
#!/usr/bin/python import os import re import sys import subprocess REDIS_HOST = sys.argv[2] RPC_BACKEND = re.compile('^\s*rpc_backend') DEFAULT = re.compile('^\s*\[DEFAULT\]\s*$') REDIS_SECTION = re.compile('^\s*\[matchmaker_redis\]\s*$') ZMQ_SECTION = re.compile('^\s*\[oslo_messaging_zmq\]\s*$') IGNORE=['debug', ...
#!/usr/bin/python from SciServer import Authentication, LoginPortal, Config, CasJobs, SkyServer, SkyQuery, SciDrive import unittest2 as unittest import os; import pandas; import sys; import json; from io import StringIO from io import BytesIO # Define login Name and password before running the tests loginName = '***'...
# Copyright 2007-2015 UShareSoft SAS, 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 requi...
# -*- coding: utf-8 -*- # # File: UserField.py # # Copyright (c) 2007 by BlueDynamics Alliance, Austria # Generator: ArchGenXML Version 1.5.3 dev/svn # http://plone.org/products/archgenxml # # GNU General Public License (GPL) # # This program is free software; you can redistribute it and/or # modify it under...
''' Read results from database and create 24 hour graph of activity ''' import psycopg2 import pandas as pd import matplotlib.pyplot as plt import time import datetime import twython import numpy as np import os import psycopg2 from pgconnect import pgconnect from keys import keys def tweet_status(day): ''' ...
""" Testing D transform implementation """ from operator import add import numpy as np from regreg.affine import (broadcast_first, affine_transform, AffineError, composition, adjoint) from numpy.testing import (assert_array_almost_equal, assert_array_equal) fro...
# -*- coding: utf-8 -*- import re from decimal import Decimal, InvalidOperation from difflib import SequenceMatcher from flask import g, request, Markup from baseframe import _, __ import baseframe.forms as forms from baseframe.staticdata import webmail_domains from coaster.utils import getbool, get_email_domain from...
# -*- coding: utf-8 -*- import bleach from datetime import datetime, timedelta from markdown import markdown # FIXME: coaster.gfm is breaking links, so can't use it from difflib import SequenceMatcher from html2text import html2text from premailer import transform as email_transform from sqlalchemy.exc import Integr...
''' Main installation script for CoG application. ''' from distutils.core import Command import logging logging.basicConfig(level=logging.INFO) class CogSetupCommand(Command): '''Custom CoG install command to execute post-install configuration.''' description = "CoG configuration and installation command"...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2017 SML 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...
class leet: def encode(self,string): alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','|','<','>','G'] leet = ['4','8','<','>','3','f','9','h','1','j','k','|','m','n','0','p','q','r','5','7','v...
"""HDL Expressions.""" from . import HDLValue from .const import HDLIntegerConstant import hdltools.abshdl.signal as signal import ast import operator as op import copy class HDLExpression(HDLValue): """An expression involving parameters.""" _ast_op_names = {ast.Sub: '-', ast.Add: '+', ...
from assembly import Assembly # String of forbidden chars forbidden_chars = "" class Utils: verbose = False # Is debug printing activated? @staticmethod def none(*args): return None @staticmethod def debug(*ss): if Utils.verbose: for s ...
import json import logging import re from google.appengine.api import urlfetch from BeautifulSoup import BeautifulSoup from consts.media_type import MediaType class MediaHelper(object): @classmethod def group_by_slugname(cls, medias): medias_by_slugname = {} for media in medias: ...
import uuid from django.contrib.auth.models import User from django.db import models from django.dispatch import receiver from comics.core.models import Comic @receiver(models.signals.post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: UserProfile.objects.cr...
import json from textwrap import fill from typing import Sequence, cast from looker_sdk import models from henry.modules import exceptions, fetcher, spinner class Pulse(fetcher.Fetcher): """Runs a number of checks against a given Looker instance to determine overall health. """ @classmethod def...
# -*- mode: python; coding: utf-8 -*- # Copyright 2016 the HERA Collaboration # Licensed under the 2-clause BSD license. """Returns cm revisions """ from __future__ import absolute_import, print_function from tabulate import tabulate from hera_mc import cm_utils, part_connect def get_revisions_of_type(rev_type, ...
# -*- mode: python; coding: utf-8 -*- # Copyright 2016 the HERA Collaboration # Licensed under the 2-clause BSD license. """Returns cm revisions """ from __future__ import absolute_import, print_function from tabulate import tabulate from hera_mc import cm_utils, part_connect import warnings from argparse import Na...
# LIBTBX_SET_DISPATCHER_NAME xia2 from __future__ import absolute_import, division import sys import os import time import exceptions import traceback # Needed to make xia2 imports work correctly import libtbx.load_env from xia2.Handlers.Streams import Chatter, Debug from xia2.Handlers.Flags import Flags from xia2.H...
# -*- mode: python; coding: utf-8 -*- # Copyright 2017 the HERA Collaboration # Licensed under the 2-clause BSD license. """Functions to handle various cm revision queries and checks. """ from __future__ import absolute_import, print_function from tabulate import tabulate from hera_mc import cm_utils, part_connect ...
from django.shortcuts import render, redirect from django.contrib import auth, messages from django.http import HttpResponse from .models import Password, Recent from django.utils import timezone from .secret import Secret from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger def index(request): ...
from hitchstory import utils, exceptions from ruamel.yaml.comments import CommentedMap, CommentedSeq class Arguments(object): """A null-argument, single argument or group of arguments of a hitchstory step.""" def __init__(self, yaml_args): """Create arguments from dict (from yaml).""" if yaml...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import requests from bs4 import BeautifulSoup as Soup import datetime import json CASA_SAPO_URL_ROOT = "https://casa.sapo.pt" CASA_SAPO_URL_BASE = "https://casa.sapo.pt/Venda/Lisboa/?sa=11&gp=%d&lau=%d&mpr=%s&or=10&pn=%d" default_max_price = 720000 ...
from discord.ext import commands from utils.mysql import * from utils.tools import * from utils.config import Config config = Config() class Configuration(): def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) async def config(self, ctx, type:str, *, value:str):...
import sys, collections, math, random, copy import numpy as np from eligibility_traces import EligibilityTraces class RLAlgorithm(object): """ :description: abstract class defining the interface of a RL algorithm """ def getAction(self, state): raise NotImplementedError("Override me") de...
######################################################################## # Group: Windows Package Manager #2 # Name: Joshua Stein # Group Members: Sebastian Imlay and Timothy James Telan # Date: October 3, 2011 # Wrapper for database queries. Abstracts database. #########################################################...
#!/usr/bin/env python # -*- coding: utf-8 -*- """General configuration module""" from __future__ import with_statement import os import optparse import logging import ConfigParser import vmcheckerpaths import assignments as assignments_ from assignments import _SECTION_PREFIX DATE_FORMAT = '%Y.%m.%d %H:%M:%S' DEFA...
from abc import ABCMeta, abstractmethod import numpy as np from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin, RegressorMixin from .activations import SigmoidActivationFunction, ReLUActivationFunction class BinaryRBM(BaseEstimator, TransformerMixin): """ This class implements a Binary...
"""Django DDP Server views.""" from __future__ import absolute_import, unicode_literals from copy import deepcopy import io import logging import mimetypes import os.path from ejson import dumps, loads from django.conf import settings from django.http import HttpResponse from django.views.generic import View import ...
# Copyright 2010 Google 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 agreed to ...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Tool Description ================ This tool helps with finding Qt4 tools and libraries, and also provides syntactic sugar for using Qt4 tools. The following snippet illustrates the tool usage:: def options(opt): opt.load('compiler_cxx qt...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Michel Mooij, michel.mooij7@gmail.com import os import xml.etree.ElementTree as ElementTree from xml.dom import minidom import waflib from waflib import Utils, Node def export(bld): root = WafProject(bld) for gen, targets in bld.components.items(): if set(('c', '...
# Copyright (c) 2012 Yuri K. Schlesner # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, d...
import inspect from .__version__ import __version__ from contextlib import contextmanager try: from flux import current_timeline as time_module except ImportError: import time as time_module from .deadlines import make_deadline as _make_deadline from .exceptions import TimeoutExpired, IllegalArgumentError d...
#!/usr/bin/python # -*- coding: utf-8 -*- """ dedupe provides the main user interface for the library the Dedupe class """ from __future__ import print_function, division from future.utils import viewitems, viewvalues, viewkeys import itertools import logging import pickle import multiprocessing import random import w...
"""A program to do an inconsistent backup of a PostgreSQL heap to S3, hopefully quickly. This is done without putting the heap into one file (via tar or cpio) because in addition to multi-stream S3 PUT, it is also important to be able to parallelize GET, and one convenient way to do that is send the Postgres heap as-i...
"""Network structures commonly used in simulations of evolution.""" from .models import Network import random class Chain(Network): """A -> B -> C -> ...""" __mapper_args__ = {"polymorphic_identity": "chain"} def add_agent(self, newcomer): """Add an agent, connecting it to the previous node.""...
import itertools import pprint from six.moves import queue import collections import os import io import logging import six import wandb import numpy import uuid import json import codecs from wandb import util from wandb import util3D def val_to_json(key, val, mode="summary", step=None): """Converts a wandb dat...
import argparse from libdlt.schedule import AbstractSchedule, BaseDownloadSchedule from libdlt import Session from libdlt.util import util class FallbackDownloadSchedule(AbstractSchedule): def __init__(self, url, threshold, primary, fallback, md_id): def bandwidth(x, ts, prior, state): result ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2014, Teo Mrnjavac <teo@kde.org> # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # === This file is part of Calamares - <http://github.com/calamares> === # # Copyright 2015, Teo Mrnjavac <teo@kde.org> # Copyright 2017-2018, 2020, Adriaan de Groot <groot@kde.org> # # Calamares is free software: you can redistribute it and/or modify # it under ...
#!/usr/bin/python import glob import grp import hashlib import json import os import pwd import re import shutil import subprocess import tarfile import threading import time import urlparse import uuid from base64 import b64encode from collections import OrderedDict from copy import deepcopy from charmhelpers.contri...
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. from hoomd import _hoomd from hoomd.parameterdicts import TypeParameterDict, ParameterDict from hoomd.typeconverter import OnlyIf, toTypeConverter from hoomd.typ...
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """Hard particle Monte Carlo integrators.""" from hoomd import _hoomd from hoomd.parameterdicts import TypeParameterDict, ParameterDict from hoomd.typeconverter...
from typing import Optional, Sequence import time from timeit import default_timer as timer import os import sys import threading import logging import dronekit from bugzoo.client import Client as BugZooClient from pymavlink import mavutil from .connection import CommandLong, MAVLinkConnection, MAVLinkMessage from .....
__all__ = ['access', 'getpacs'] from hsadownload import access, getpacs
''' AceProxy configuration script ''' import logging, platform from aceclient.acemessages import AceConst class AceConfig: # Ace program key (None uses remote key generator) acekey = None # Ace Stream Engine host acehost = '127.0.0.1' # Ace Stream Engine port (autodetect for Windows) aceport = 62062 # Ac...
# -*- coding: utf-8 -*- import json import os import random import unittest import unicodedata from bitcoin import * from bitcoin.mnemonic import bip39_check, bip39_to_mn, bip39_to_seed from bitcoin.pyspecials import from_str_to_bytes, from_bytes_to_str, by, st from bitcoin.deterministic import bip32_master_key class...
"""test_isort.py. Tests all major functionality of the isort library Should be ran using py.test by simply running by.test in the isort project directory 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 So...
#!/usr/bin/env python # -*- coding: utf-8 -*- """A series of pytest tests to test the quality of our Queue class and its methods """ from __future__ import unicode_literals import pytest import queue @pytest.fixture(scope="function") def create_queue(request): """Create a queue with numbers 1 - 5 """ new...
import atexit import os import shutil import tempfile import textwrap from mock import Mock, patch, call, ANY from nose.tools import eq_ from rolex import Command, Pane, Watch, get_matches, get_diffs, _read_config from rolex import EvenVerticalLayout, EvenHorizontalLayout import rolex def _tempdir(): temp = tem...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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...
import pytest from stack import Element from stack import Stack def test_element_init(): n = Element() assert n.val is None assert n.previous is None m = Element(3) assert m.val == 3 assert m.previous is None def test_stack_init(): l = Stack() assert l.top is None def test_stack_pu...
""" Unit tests for star (and double-star) generation and indexing """ __author__ = 'Dallas R. Trinkle' # import unittest import FCClatt import KPTmesh import numpy as np import stars class StarTests(unittest.TestCase): """Set of tests that our star code is behaving correctly for a general materials""" def...
import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings' from django.core import management apps = sys.argv[1:] if not apps: apps = [ 'resources', 'forms', 'tokens', ] management.call_command('test', *apps)
# -*- coding: utf-8 -*- """ ====================== Test Utility Functions ====================== :Author: Moritz Emanuel Beber :Date: 2012-10-26 :Copyright: Copyright(c) 2012 Jacobs University of Bremen. All rights reserved. :File: test_utils.py """ import os if os.geteuid() != 0: raise Standa...
#!/usr/bin/env python # Desiderata Author: Eben Olson <eben.olson@gmail.com> # MtHasher Author: Peter Wu <peter@lekensteyn.nl> # Licensed under the MIT license <http://opensource.org/licenses/MIT> import hashlib import logging from colorlog import ColoredFormatter import plac import sys, os from fs import zipfs forma...
import os import sys import re import codecs import time import argparse import db2js import codecs def get_timestamp(): return time.strftime("%a %d %b %Y %H:%M", time.localtime()) class JSFileParseError(Exception): def __init__(self, value): self.value = value def __str__(self): return self...