content
string
""" Train a network with one GRU layer to perform the vector copy task. Reference: Neural Turing Machines `[Graves2014]`_ .. _[Graves2014]: https://arxiv.org/pdf/1410.5401.pdf Usage: python examples/rnn_copy.py """ from neon.initializers import Uniform from neon.layers import GeneralizedCostMask, Affine, ...
"""ttLib/sfnt.py -- low-level module to deal with the sfnt file format. Defines two public classes: SFNTReader SFNTWriter (Normally you don't have to use these classes explicitly; they are used automatically by ttLib.TTFont.) The reading and writing of sfnt files is separated in two distinct classes, since whene...
import os.path import re import xml.sax import gourmet.importers.importer as importer import gourmet.importers.xml_importer as xml_importer from gourmet.gdebug import debug from gourmet.i18n import _ from gourmet.importers.xml_importer import unquoteattr class Mx2Cleaner: def __init__ (self): self.regs_t...
""" [2015-04-10] Challenge #209 [Hard] Unpacking a Sentence in a Box https://www.reddit.com/r/dailyprogrammer/comments/322hh0/20150410_challenge_209_hard_unpacking_a_sentence/ Those of you who took the time to work on a Hamiltonian path generator can build off of that. # Description You moved! Remember on Wednesday ...
""" Date and time elements for the English language ============================================================================ """ from datetime import date, time, timedelta from ...grammar.elements import Alternative, Compound, Choice from ..base.integer import Integer, IntegerRef #------------...
# Magnet2 by Grom PE. Public domain. import xmpp, time from magnet_api import * # TODO: Clean wait_ping for those who didn't reply for long time wait_ping = {} def command_ping(bot, room, nick, access_level, parameters, message): if parameters: target = parameters if not target in bot.roster[room]: r...
import primitives from billiard import BilliardBall, BilliardTable from constants import * import Leap, time, sys import leapDriver import hand import gestures from forceLine import ForceLine from menu import Menu, Screen, ActionButton, NavigationalButton import itertools draw_hands = [hand.Hand(), hand.Hand()] las...
import numpy from tvb.basic.traits import types_basic as basic, core from tvb.datatypes import arrays as arrays from tvb.datatypes.local_connectivity_data import LocalConnectivityData from tvb.datatypes.region_mapping_data import RegionMappingData from tvb.datatypes.surfaces_data import CorticalSurfaceData class Cort...
#!/usr/bin/python # # stop_test: tests the stop command # # Test the stop command for stopping a process by its pid. # Requires the following commands to be implemented # or otherwise usable: # # stop, sleep # import sys, imp, atexit sys.path.append("/home/courses/cs3214/software/pexpect-dpty/"); import pexpect, shel...
"""winshell - convenience functions to access Windows shell functionality Certain aspects of the Windows user interface are grouped by Microsoft as Shell functions. These include the Desktop, shortcut icons, special folders (such as My Documents) and a few other things. These are mostly available via the shell modu...
import webiopi import datetime GPIO = webiopi.GPIO LIGHT = 17 # GPIO pin using BCM numbering HOUR_ON = 8 # Turn Light ON at 08:00 HOUR_OFF = 18 # Turn Light OFF at 18:00 # setup function is automatically called at WebIOPi startup def setup(): # set the GPIO used by the light to output GPIO.setFunction(LIG...
'''pylw.app. Contains Resp,Req,App object definitions. pylw.app.App() is the WSGI callable object.''' import itsdangerous import routing import request import response class App(object): '''This class implements a bare minimum WSGI application''' def __init__(self, secret_key=None, config_dict=None, user_...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.email_settings' db.add_column(u'website_userp...
import re from keystonemiddleware import auth_token from magnum.common import exception from magnum.common import utils from magnum.openstack.common._i18n import _ from magnum.openstack.common import log LOG = log.getLogger(__name__) class AuthTokenMiddleware(auth_token.AuthProtocol): """A wrapper on Keystone ...
from elementary import Read from mixin import ambiguous from zeobuilder.conversion import express_measure, express_data_size from molmod import Rotation import gtk, numpy __all__ = [ "Label", "Handedness", "BBox", "Distance", "VectorLength", "DataSize", "Mapping", ] class Label(Read): def create_widget...
# coding=utf-8 import random import unittest import fro import utils class FroTests(unittest.TestCase): # Tests for parser-constructing functions def test_alt1(self): parser = fro.alt([r"abc+", r"ab+c"]) self.assertEqual(parser.parse_str("abcc"), "abcc") self.assertEqual(parser.pars...
import os from contextlib import closing from textwrap import dedent from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary from pants.backend.jvm.targets.java_library import JavaLibrary from pants.backend.jvm.targets.jvm_binary import JvmBinary from pants.backend.jvm.targets.scala_library...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import json from django.core.mail import EmailMessage from django.core import mail from django.test import TestCase from django.test.utils import override_settings from . import core from . import models from . import utils from .template_mail import...
""" Class used to create and control radamec device """ from math import * from direct.showbase.DirectObject import DirectObject from .DirectDeviceManager import * from direct.directnotify import DirectNotifyGlobal """ TODO: Handle interaction between widget, followSelectedTask and updateTask """ # ANALOGS RAD_PAN ...
import proto # type: ignore __protobuf__ = proto.module( package='google.ads.googleads.v7.services', marshal='google.ads.googleads.v7', manifest={ 'GetProductGroupViewRequest', }, ) class GetProductGroupViewRequest(proto.Message): r"""Request message for [ProductGroupViewService.Get...
"""Native Home Assistant iOS app component.""" import datetime import voluptuous as vol from homeassistant import config_entries from homeassistant.components.http import HomeAssistantView from homeassistant.const import HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR from homeassistant.core import callback from homeass...
import itertools import netaddr from neutron_lib.objects import common_types from neutron.db.models import l3 from neutron.db.models import port_forwarding as models from neutron.objects import base from neutron_lib import constants as lib_const from oslo_utils import versionutils from oslo_versionedobjects import fi...
import bpy import collections from typing import NamedTuple def clear_link_memory(): for ng in bpy.data.node_groups: if hasattr(ng, "sv_links"): ng.sv_links.clear_all_dictionaries() def get_output_socket_id(socket): if socket.node.bl_idname == 'NodeReroute': if socket.node.inputs[0...
# -*- coding: utf-8 -*- """ Bit Reading Request/Response messages -------------------------------------- """ import struct from pymodbus3.pdu import ModbusRequest from pymodbus3.pdu import ModbusResponse from pymodbus3.pdu import ModbusExceptions from pymodbus3.utilities import pack_bitstring, unpack_bitstring clas...
#!/usr/bin/env python """ 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");...
# -*- coding: utf-8 -*- import docx from show import Show, ShowEncoder import json class DocumentProcessor(object): def __init__(self): pass def get_shows(self, doc_path): doc = docx.Document(doc_path) table = doc.tables[0] # Get the column indices indices = dict() ...
from distutils.spawn import find_executable import os import sys from subprocess import Popen, PIPE def find_xsdcxx(): xsdcxx = find_executable("xsdcxx") if xsdcxx is not None: return xsdcxx xsdcxx = find_executable("xsd") return xsdcxx def generate(name): xsdcxx = find_xsdcxx() if xsdcxx is None: print("C...
#! /usr/bin/env python import time, threading from pymonome import monome class Fader(threading.Thread): def __init__(self, monome, x): threading.Thread.__init__(self) self.daemon = True self.monome = monome self.x = x self.goal = 0 self.now = 0 def run(sel...
from spack import * class H5utils(AutotoolsPackage): """h5utils is a set of utilities for visualization and conversion of scientific data in the free, portable HDF5 format.""" homepage = "http://ab-initio.mit.edu/wiki/index.php/H5utils" url = "http://ab-initio.mit.edu/h5utils/h5utils-1.12.1.tar....
import unittest from hecuba import config, StorageDict from hecuba.IStorage import IStorage class PersistentDict(StorageDict): ''' @TypeSpec dict<<key:int>, value:double> ''' class IStorageTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.old = config.execution_name ...
VIRT_FAILED = 1 VIRT_SUCCESS = 0 VIRT_UNAVAILABLE=2 try: import libvirt except ImportError: HAS_VIRT = False else: HAS_VIRT = True try: from lxml import etree except ImportError: HAS_XML = False else: HAS_XML = True from ansible.module_utils.basic import AnsibleModule ALL_COMMANDS = [] ENT...
#!/usr/bin/python # # skripta za konvertiranje među formatima # # <EMAIL> # # 22.05.2013 # #LLS Lecture - Artificial Atmosphere import sys, math def procitaj_timecode(code): tmp = code.strip().split(":") #print("pro " + code) secs = 0 for i in [0, 1, 2]: secs = secs*60 + int(tmp[i]) # fakat cudni form...
class LinkedListNode: """ Node to be used in linked list === Attributes === @param LinkedListNode next_: successor to this LinkedListNode @param object value: data this LinkedListNode represents """ def __init__(self, value, next_=None): """ Create LinkedListNode self with d...
#!/usr/bin/env python import argparse import os import subprocess import sys from makegyp.core import command module_path = os.path.abspath(__file__) test_root_dir = os.path.dirname(module_path) def test_library(name): print '* Test %r...' % name # Determines the directory of the tested library: test_d...
import sys import nltk import newspaper from newspaper import Article # from newspaper import news_pool ############## NEWSPAPER ################## newspaper.languages() marketwatch = newspaper.build(u'http://www.marketwatch.com', language = 'en') # bloomberg = newspaper.build('https://www.bloomberg.com') # cnbc =...
#!/usr/bin/env python # -*- coding: utf-8 -*- from math import log import bitwise as btws import constants as const class Attacks(object): # global slider pass class Attack(Attacks): ''' returns all the attacked squares for a piece on a square (slider) attack_bishop = PAttack(occupied squares...
""" wsproto ~~~~~~~ A WebSocket implementation. """ from typing import Generator, Optional from .connection import Connection, ConnectionState, ConnectionType from .events import Event from .handshake import H11Handshake from .typing import Headers __version__ = "1.0.0+dev" class WSConnection: """ Represen...
# -*- coding: utf-8 -*- # -*- mode: python -*- """Test module input and output Copyright (C) 2013 Dan Meliza <<EMAIL>> Created Thu Jun 20 14:59:30 2013 """ from test.common import * from mspikes import types from mspikes import filters def test_rand_samples(): from mspikes.modules.random_sources import rand_samp...
#! /usr/bin/env python import unittest import time from Communication import Communication class CommunicationTest(unittest.TestCase): def setUp(self): ''' Verify environment is setup properly. ''' self.controller = Communication() self.b_list = self.controller.get_blu...
import socket import sys import os # Funcion que se encarga de llevar a cabo la conexion con el servidor. def retBanner(ip, port): try: socket.setdefaulttimeout(2) s = socket.socket() s.connect((ip, port)) banner = s.recv(1024) return banner except Exception, e: #print "[-] Imposible establecer la conexi...
import unittest from mox import IsA # noqa from django import http from django.core.urlresolvers import reverse from openstack_dashboard import api from openstack_dashboard.test import helpers as test from openstack_dashboard.dashboards.idm import tests as idm_tests from openstack_dashboard.dashboards.idm.organizat...
# -*- coding: utf-8 -*- # # Test links: # https://www.oboom.com/B7CYZIEB/10Mio.dat import re from module.plugins.internal.misc import json from module.plugins.internal.Hoster import Hoster from module.plugins.captcha.ReCaptcha import ReCaptcha class OboomCom(Hoster): __name__ = "OboomCom" __type__ = "...
from __future__ import division import numpy as np from six.moves import zip from collections import OrderedDict from bokeh.plotting import * from bokeh.objects import HoverTool TOOLS="pan,wheel_zoom,box_zoom,reset,hover,previewsave" xx, yy = np.meshgrid(range(0,101,4), range(0,101,4)) x = xx.flatten() y = yy.flatte...
import asyncore import socket from tls import TLSHandshake class HTTPRequestHandler(asyncore.dispatcher): response = """HTTP/1.0 200 OK\r Date: Sun, 23 Oct 2016 18:02:00 GMT\r Content-Type: text/html; charset=UTF-8\r Content-Encoding: UTF-8\r Content-Length: 136\r Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT\r Se...
import pytest import sys from pybind11_tests import pytypes as m from pybind11_tests import debug_enabled def test_list(capture, doc): with capture: lst = m.get_list() assert lst == ["overwritten"] lst.append("value2") m.print_list(lst) assert capture.unordered == """ ...
#!/usr/bin/env python from setuptools import find_packages, setup def is_requirement(line): """ Return True if the requirement line is a package requirement; that is, it is not blank, a comment, or editable. """ # Remove whitespace at the start/end of the line line = line.strip() # Skip b...
import sqlite3 as sql import sys import os from brew_data.data_miner.brew_target.fermentables import Fermentable, get_fermentables from brew_data.data_miner.brew_target.hops import Hop, get_hops from brew_data.data_miner.brew_target.yeast import Yeast, get_yeast from brew_data.data_miner.brew_target.styles import Styl...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html Modified from: https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path he...
import sys import unittest from libcloud.utils.py3 import httplib from libcloud.common.types import InvalidCredsError from libcloud.compute.drivers.opsource import OpsourceNodeDriver as Opsource from libcloud.compute.drivers.opsource import OpsourceAPIException from libcloud.compute.base import Node, NodeAuthPa...
from typing import List #from collections import defaultdict class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: visited = dict() result = [] def findDuplicateSubtrees(self, root: TreeNode) -> List[TreeNode]: self.preOrd...
""" Enableds logging of variables from the Crazyflie. When a Crazyflie is connected it's possible to download a TableOfContent of all the variables that can be logged. Using this it's possible to add logging configurations where selected variables are sent to the client at a specified period. """ __author__ = 'Bitcr...
""" Unit tests for Windows Server 2012 OpenStack Cinder volume driver """ import mock import os from oslo_utils import fileutils from oslo_utils import units from cinder.image import image_utils from cinder import test from cinder.tests.unit.windows import db_fakes from cinder.volume import configuration as conf fro...
import glob from os import path from oslo_log import log as logging from trove.common import cfg from trove.common import exception from trove.common.i18n import _ from trove.guestagent.common import operating_system from trove.guestagent.datastore.oracle import service from trove.guestagent.strategies.restore import...
from django.conf.urls import patterns, include, url from django.conf import settings from django.conf.urls.static import static # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^login/$', 'django.contrib.auth...
from rest_framework import generics, permissions as drf_permissions from modularodm import Q from website.models import User, Node from framework.auth.core import Auth from api.base.utils import get_object_or_error from api.base.filters import ODMFilterMixin from api.nodes.serializers import NodeSerializer from .seria...
"""Integration tests for uploading and downloading to GCS. These tests exercise most of the corner cases for upload/download of files in apitools, via GCS. There are no performance tests here yet. """ import json import os import unittest import six from apitools.base.py import exceptions import storage _CLIENT = ...
from moveit_msgs.msg import CollisionObject from geometry_msgs.msg import Pose, Point from shape_msgs.msg import SolidPrimitive, Plane, Mesh, MeshTriangle import pyexotica as exo try: from pyassimp import pyassimp except: try: import pyassimp except: raise Exception("Failed to import pyassi...
import sys from datetime import datetime # GTK Imports import gobject,gtk # Import default date format if sys.platform!='win32': import locale LOCALE_DATE_FORMAT=locale.nl_langinfo(locale.D_FMT) else: LOCALE_DATE_FORMAT='%Y-%m-%d' class DatePicker(gtk.Entry): """ Sourceview enhanced widget class ...
#!/usr/bin/python import unittest as u import re, fnmatch, os rootDir = '../src/' prefix = """ %pragma(java) jniclasscode=%{ static { try { System.loadLibrary(\"""" suffix = """\"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load. ...
"""Support for BMW car locks with BMW ConnectedDrive.""" import logging from homeassistant.components.bmw_connected_drive import DOMAIN as BMW_DOMAIN from homeassistant.components.lock import LockDevice from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED DEPENDENCIES = ['bmw_connected_drive'] _LOGGER = logg...
from numpy.testing import assert_allclose from deli.graph import Graph from deli.serialization.api import serialize from deli.testing.mock_view import MockView class Demo(MockView): def __init__(self, **kwargs): super(Demo, self).__init__(**kwargs) self.do_layout() def setup_graph(self): ...
''' Created on 1 févr. 2014 @author: inso ''' import os import logging import tarfile import shutil import json import datetime import i18n_rc from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot, \ QUrl, QTranslator, QCoreApplication, QLocale from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetw...
"""A job to send a HTTP (GET or DELETE) periodically.""" import logging import requests from ndscheduler import job logger = logging.getLogger(__name__) class CurlJob(job.JobBase): TIMEOUT = 10 @classmethod def meta_info(cls): return { 'job_class_string': '%s.%s' % (cls.__module__,...
app_name = "erpnext" app_title = "ERPNext" app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" app_version = "4.3.0" error_report_email = "<EMAIL>" app_include_j...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AnnotationAttachment.creator' db.add_column('ddsc_site_annotationattachment', 'creator', ...
"""Database models for integration configuration storage.""" from __future__ import unicode_literals import logging from django.db import models from django.utils.translation import ugettext_lazy as _ from djblets.conditions import ConditionSet from djblets.integrations.models import BaseIntegrationConfig from revi...
import hashlib import httplib import os.path import re import sys import threading import time import traceback import urllib2 import urlparse try: import paymentrequest_pb2 except: sys.exit("Error: could not find paymentrequest_pb2.py. Create it with 'protoc --proto_path=lib/ --python_out=lib/ lib/paymentreq...
import pywps.configuration as config from pywps.processing.basic import MultiProcessing from pywps.processing.scheduler import Scheduler # api only from pywps.processing.basic import Processing # noqa: F401 from pywps.processing.job import Job # noqa: F401 import logging LOGGER = logging.getLogger("PYWPS") MULTIPRO...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.six.moves import queue from ansible.compat.six import iteritems, text_type from ansible.vars import strip_internal_keys import multiprocessing import time import traceback # TODO: not needed if we use the cryp...
#!/usr/bin/python -u # -*- coding: utf-8 -*- import cgi from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer #import subprocess from subprocess import Popen, PIPE import sys import syslog from socket import * import psycopg2 import psycopg2.extras from psycopg2.extensions import adapt HOST = '127.0.0.1' PORT...
from sos.plugins import Plugin, RedHatPlugin from glob import glob from os.path import exists class Ipa(Plugin, RedHatPlugin): """ Identity, policy, audit """ plugin_name = 'ipa' profiles = ('identity', 'apache') ipa_server = False ipa_client = False files = ('/etc/ipa',) packages =...
#!/usr/bin/env python import sys import logging from easy_thumbnails.files import generate_all_aliases from easy_thumbnails.exceptions import InvalidImageFormatError from toolkit.diary.models import MediaItem from toolkit.members.models import Volunteer logger = logging.getLogger('toolkit.import') logger.setLevel(lo...
import os import uuid from GTG.backends.backendsignals import BackendSignals from GTG.backends.genericbackend import GenericBackend from GTG.backends.periodicimportbackend import PeriodicImportBackend from GTG.backends.syncengine import SyncEngine, SyncMeme from GTG.core.task import Task from GTG.core.translations imp...
from gi.repository import Gtk from gi.repository import GObject from gi.repository import Peas from gi.repository import Totem import threading import subprocess import gettext """ Constants for Radio Buttons activities """ SUSPEND = 0 TURNOFF = 1 NOTHING = 2 t = gettext.translation('poweroffplugin', '/usr/share/loc...
import numpy from chainer import cuda, Function def _cu_conv_sum(y, x, n): # Convolutional sum # TODO(beam2d): Use scan computation rdim = x.size / (x.shape[0] * x.shape[1]) cuda.elementwise( 'float* y, const float* x, int rdim, int N, int n_', ''' int half_n = n_ / 2; ...
from sympy import (symbols, product, factorial, rf, sqrt, cos, Function, Product, Rational, Sum, oo) from sympy.utilities.pytest import raises a, k, n, m, x = symbols('a,k,n,m,x', integer=True) f = Function('f') def test_simple_products(): assert product(2, (k, a, n)) == 2**(n-a+1) assert p...
from com.googlecode.fascinator.common import JsonObject from org.json.simple import JSONArray from java.util import HashMap from com.googlecode.fascinator.spring import ApplicationContextProvider # TODO: might refactor it with other user related modules: grantAccess.py, userinfo.py which is this was based on class Use...
import re import sys from datetime import datetime import os import errno import zipfile def make_sure_path_exists(path): try: os.makedirs(path) except OSError as exception: if exception.errno != errno.EEXIST: raise def checkSourceFiles(origPath): for suffix in ["_EQ.xml","_SV....
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 from copy import deepcopy from datetime import datetime, timedelta import operator import os import nose from pandas import DataFrame, Series import pandas as pd from numpy import nan import numpy as np from pandas.util.testing import assert_frame_equal from...
""" A simple module that can get login information from a .mylogin.cnf file made by `mysql_config_editor` """ import mylogin.ip_parser as ip_parser def get_login_info(login_path, host=None, port=None, socket=None): """ Get the user and password from a .mylogin.cnf file """ host = host or u'localhost' port ...
# encoding: utf-8 from setuptools import setup, find_packages import os.path # Package data # ------------ _name = 'jpl.mcl.site.knowledge' _version = '0.0.9' _description = 'Knowledge representation for the MCL site' _url = 'https://github.com/MCLConsortium/' + _name _downloadURL ...
from sympy.core.basic import S, sympify from sympy.core.function import Function import sympy.polys from sympy.core import diff ############################################################################### ################################ DELTA FUNCTION ############################### ###############################...
""" Database access related functions for BibFormat engine and administration pages. """ __revision__ = "$Id$" import zlib import time from invenio.dbquery import run_sql ## MARC-21 tag/field access functions def get_fieldvalues(recID, tag): """ Returns list of values of the MARC-21 'tag' fields for the rec...
from base_screen import BaseScreen import mopidy.models from ..graphic_utils import ListView class LibraryScreen(BaseScreen): def __init__(self, size, base_size, manager, fonts, playqueues=None): BaseScreen.__init__(self, size, base_size, manager, fonts) self.list_view = ListView((0, 0), ( ...
# ====================================================================== # Globally useful modules, imported here and then accessible by all # functions in this file: from __future__ import print_function # Fonts, latex: import matplotlib matplotlib.rc('font',**{'family':'serif', 'serif':['TimesNewRoman']}) matplotli...
from qingcloud.cli.iaas_client.actions.collaboration.describe_shared_resource_groups import DescribeSharedResourceGroupsAction from qingcloud.cli.iaas_client.actions.collaboration.describe_resource_groups import DescribeResourceGroupsAction from qingcloud.cli.iaas_client.actions.collaboration.create_resource_groups imp...
"""This module provides base classes for cycling data objects.""" from abc import ABCMeta, abstractmethod from cylc.exceptions import CyclerTypeError def parse_exclusion(expr): count = expr.count('!') if count == 0: return expr, None elif count > 1: raise Exception("'%s': only one set of...
"""this module contains exceptions used in the astng library :author: Sylvain Thenault :copyright: 2003-2007 LOGILAB S.A. (Paris, FRANCE) :contact: http://www.logilab.fr/ -- mailto:<EMAIL> :copyright: 2003-2007 Sylvain Thenault :contact: mailto:<EMAIL> """ __doctype__ = "restructuredtext en" class ASTNGError(...
"""Local development settings, including local_settings, if present.""" from __future__ import absolute_import import os from .base import CommunityBaseSettings class CommunityDevSettings(CommunityBaseSettings): """Settings for local development""" PRODUCTION_DOMAIN = 'localhost:8000' WEBSOCKET_HOST = ...
#! /usr/bin/env python # vim: set fileencoding=utf-8: set encoding=utf-8: import markdown import re import jinja2 import types import collections import os.path from .markdown_ext import SliderExtension class Author(object): def __init__(self, value): if isinstance(value, types.StringTypes): s...
import uuid import os.path as path from unidecode import unidecode from django.template.defaultfilters import slugify from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from taiga.projects.history.services import make_key_from_model_object from taiga.timel...
#!/usr/bin/env python """Automatically install required tools and data to run bcbio-nextgen pipelines. This automates the steps required for installation and setup to make it easier to get started with bcbio-nextgen. The defaults provide data files for human variant calling. Requires: git, Python 2.7 or argparse for ...
import numpy as np import sys import pylab import os from Bio import SeqIO import matplotlib.pyplot as plt """Generates fragment length histogram from two files: 1) an assembled fastq file (eg from pear output), 2) a two column, tab separated frequency table where the first column is a list of insert sizes and the sec...
''' Contains functions that poke the bot to do something on its own ''' import socket import SocketServer from yowsup.layers.protocol_messages.protocolentities \ import TextMessageProtocolEntity from .registry import get_easy_logger, RPCCommand, RPC_DICT, safe_call LOGGER = get_easy_logger('rpc') RPC_OK = 'Ok...
import argparse import sys from nose.core import run def main(): description = "Runs slack unit and/or integration tests." parser = argparse.ArgumentParser(description=description) parser.add_argument('-t', '--service-tests', action='append', default=[], help="Run tests for a give...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------- """ This module contains the PortPersistence class. """ import os import inspect # For module inspect import pkgutil # For dynamic package load from os.path import expanduser from harpia.utils.XMLUtils import XMLParser fr...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
import argparse import csv, os, time import psycopg2 # psycopg2 v2.5.1 import sys sys.path.append('../modules') from result import Result # Get command line arguments parser = argparse.ArgumentParser(description='Load SNP and locus data') parser.add_argument('--dev', action='store_true', help='Only load chromosome 2...
""" This module is resposible for peer discovery over UDP only. The process is simple. 1) Start up the client and broadcast a UDP datagram on a defined interval. 2) Listen for other packets 3) When another packet is heard, pull it into the list of the peers. But, if the peer is already in the list, do nothing. 4...
#!/usr/bin/env python3 """ High-level tests for the overall functionallity and things in kc.py """ import os import unittest from ruamel import yaml from kerncraft.kernel import KernelCode, KernelDescription class TestKernel(unittest.TestCase): def setUp(self): with open(self._find_file('2d-5pt.c')) as ...