content
stringlengths
4
20k
#!/usr/bin/env python from moderna.sequence.AlignmentMatcher import AlignmentMatcher from moderna.sequence.RNAAlignment import read_alignment from moderna.sequence.ModernaSequence import Sequence from tests.test_data import * from unittest import TestCase, main class AlignmentMatcherTests(TestCase): def setU...
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.core import mail from django.test import TestCase from django.utils import timezone from ..models import Project, Milestone from ...core import permissions as perms import datetime import json ...
"""Permet d'evaluer les resultats par rapport aux references -> Calcul le rappel, la precision et la fmesure.""" class Evaluation(): #### Calcul le nombre de frontieres bien detectees def reussis(self, hypotheses, references) : # [], [] # Calcul du pourcentage de reussite sur la segmentation reussi = 0 dist ...
import asyncio import re import sys import socket import traceback from collections import defaultdict from concurrent.futures import CancelledError from gi.repository import GObject import pychess from pychess.compat import create_task from pychess.System.Log import log from pychess import ic from pychess.Utils.con...
#basic_info return some statistical averages and harmonic info import numpy as np import math def basic_info(data,meta,rescale=True,rotate=False,user_peak=0,nonlinear=None): print 'in basic_info' #from . import read_grid,parse_inp,read_inp,show dims = data.shape ndims = len(dims) m...
""" URLconf for management pages. """ from django.conf.urls.defaults import patterns, url urlpatterns = patterns( "moztrap.view.manage", url(r"^$", "views.home", name="manage"), # user ------------------------------------------------------------------ # manage url(r"^users/$", "users.v...
"""Implements commands for running and interacting with Fuchsia on devices.""" from __future__ import print_function import amber_repo import boot_data import filecmp import logging import os import re import subprocess import sys import target import tempfile import time import uuid from common import SDK_ROOT, Ens...
# Made by Mr - Version 0.3 by DrLecter import sys from net.sf.l2j import Config from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest DARKWING_BAT_FANG = 1478 VARANGKAS_PARASITE = 1479 ADEN...
""" View Helpers for Quark Plugin """ import netaddr from oslo_config import cfg from oslo_log import log as logging from quark.db import ip_types from quark import network_strategy from quark import protocols from quark import tags CONF = cfg.CONF LOG = logging.getLogger(__name__) STRATEGY = network_strategy.STRAT...
from django.conf import settings from django.core import urlresolvers from django.http import HttpResponseRedirect from ..core.util import update_querystring from .auth import UserCredentials def login(request, user): """ Persist the given user in the session. """ request.session["userid"] = user.a...
''' The MIT License (MIT) Copyright (c) 2016 <EMAIL> 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, publ...
import json import uuid import jsonschema import anchore_engine.configuration.localconfig from anchore_engine.apis.context import ApiRequestContextProxy import anchore_engine.configuration.localconfig from anchore_engine.clients.services import http from anchore_engine.clients.services import internal_client_for from ...
#!/usr/bin/env python3 import argparse, os from genompy.cn import * pr = argparse.ArgumentParser(description='Convert regions to genes') pr.add_argument('input', help='input regions file') pr.add_argument('output', help='output genes file') pr.add_argument('-d', '--delimiter', help='delimiting character', default=...
import bpy import sys import time import json import socket import zmq from zocp import ZOCP from mathutils import Vector from bpy.app.handlers import persistent alreadyDeletedObjects = set() camSettings = {} mistSettings = () def toggleDebug(s, ctx): pass # PROPERTIES bpy.types.Scene.zdebug_prop = bpy.props.Bo...
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import re try: import urlparse except: import urllib.parse as urlparse import urllib import functools import time import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disabl...
from __future__ import print_function import os import random def readFile(filename): if os.path.exists(filename) and not os.access(os.path.dirname(filename), os.W_OK): file = open(filename, 'r') buffer = list(file.read()) file.close() return buffer else: print("Could not open file: " + filename) return ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import doctest import unittest import ser class NameTestCase(unittest.TestCase): def test(self): name = 'serpens' self.assertEqual(ser.name, name, msg='name should be {}'.format(name)) class IsSnakeTestCa...
''' Created on September 15, 2016 @author: compsecmonkey Helper methods for generating API response code and logging the responses. Usage: Utilize the below methods for all return statements in API endpoints given the appropriate response. Utilize the rfc7231 documentation for determing the appropriate ...
from cuon.Databases.SingleData import SingleData import logging import cuon.Addresses.SingleAddress class SingleBank(SingleData): def __init__(self, allTables): SingleData.__init__(self) # tables.dbd and address self.sNameOfTable = "bank" self.xmlTableDef = 0 ...
import os import logging from werkzeug.local import LocalManager from werkzeug.wrappers import Request, Response from werkzeug.exceptions import HTTPException, NotFound from werkzeug.middleware.profiler import ProfilerMiddleware from werkzeug.middleware.shared_data import SharedDataMiddleware import frappe import fra...
"""Smartlink device for Alicat Digital Flow Controllers.""" import asyncio from asyncio import ensure_future from concurrent.futures import CancelledError import serial from . import ReactiveSerialDevice, DeviceError class PCD(ReactiveSerialDevice): """Smartlink device for Alicat PCD Digital Flow Controllers.""...
from can.protocols.j1939.pgn import PGN class ArbitrationID(object): def __init__(self, priority=7, pgn=None, source_address=0): """ :param int priority: Between 0 and 7, where 0 is highest priority. :param :class:`can.protocols.j1939.PGN`/int pgn: The parameter g...
# -*- coding: utf-8 -*- from pydocgen.model import Document, Paragraph, Span, Header, List, Image, Table class Builder(object): def generate(self, documentTreeNode): if isinstance(documentTreeNode, Document): documentTreeNode.fill_parent_fields() documentTreeNode.reset_sequences() ...
from Muon.GUI.Common.fitting_widgets.model_fitting.model_fitting_model import ModelFittingModel from Muon.GUI.Common.fitting_widgets.model_fitting.model_fitting_presenter import ModelFittingPresenter from Muon.GUI.Common.fitting_widgets.model_fitting.model_fitting_view import ModelFittingView class ModelFittingTabWid...
from django.db import models from .Person import * from Course.models import Department class FacultyManager(models.Manager): def addFaculty(self, request): """ adds new faculty member """ nameObjs = Name.objects.addName(request) addressObjs = Address.objects.addAddress(request) c...
import unittest from mixbox.vendor.six import u from cybox.objects.archive_file_object import ArchiveFile from cybox.common import Hash from cybox.compat import long from cybox.test.objects import ObjectTestCase from cybox.test.objects.file_test import TestFile class TestArchiveFile(ObjectTestCase, unittest.TestCa...
from renderer import Renderer from interface import * from tga import TgaTexture import highscores import glutils import time import music from decorators import callparent def displayFullWindowTexture(texture): ''' texture is a TgaTexture with a gl texture associated. (i.e. texture.name is a GLInt texture...
""" Italian-language mappings for language-dependent features of reStructuredText. """ __docformat__ = 'reStructuredText' directives = { 'attenzione': 'attention', 'cautela': 'caution', 'pericolo': 'danger', 'errore': 'error', 'suggerimento': 'hint', 'importante': 'i...
"""Unit test for xml.py.""" import unittest import xml class MockErrorHandler(object): def __init__(self, handle_style_error): self.turned_off_filtering = False self._handle_style_error = handle_style_error def turn_off_line_filtering(self): self.turned_off_filtering = True def...
from __future__ import absolute_import, unicode_literals import urlparse from mopidy.internal import deprecation from mopidy.mpd import exceptions, protocol, translator @protocol.commands.add('add') def add(context, uri): """ *musicpd.org, current playlist section:* ``add {URI}`` Adds the ...
from typing import ( Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple, Optional, ) from google.cloud.dialogflow_v2.types import environment class ListEnvironmentsPager: """A pager for iterating through ``list_environments`` requests. This class thinly wraps ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import json from itertools import chain from ansible.module_utils._text import to_bytes, to_text from ansible.module_utils.network.common.utils import to_list from ansible.plugins.cliconf import CliconfBase, enable_mode...
#! /usr/bin/env python """ Sample script that illustrates card connection decorators. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:<EMAIL> This file is part of pyscard. pyscard is free software; you can redistribute it and/or modify it under the terms of the G...
"""Example writing to and reading from a subprocess at the same time using tasks.""" import asyncio import os from asyncio.subprocess import PIPE @asyncio.coroutine def send_input(writer, input): try: for line in input: print('sending', len(line), 'bytes') writer.write(line) ...
from airflow.contrib.hooks.slack_webhook_hook import SlackWebhookHook from airflow.operators.http_operator import SimpleHttpOperator from airflow.utils.decorators import apply_defaults class SlackWebhookOperator(SimpleHttpOperator): """ This operator allows you to post messages to Slack using incoming webhook...
""" Code to implement vector rotation by angles, and inferring gridcell angles from coordinate points and bounds. """ import numpy as np import cartopy.crs as ccrs import iris def _3d_xyz_from_latlon(lon, lat): """ Return locations of (lon, lat) in 3D space. Args: * lon, lat: (float array) ...
from django.contrib.admin import AdminSite from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy from django.db.models.base import ModelBase from django.conf.urls import patterns, url, include from django.utils.text import capfirst from django.conf import settings from dja...
""" Django settings for tweetnotes project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
"""convert mimetypes or launch an application based on one""" __version__ = "$Rev$" _ASSOCSTR_COMMAND = 1 _ASSOCSTR_EXECUTABLE = 2 _EXTENSIONS = { 'application/ogg': 'ogg', 'audio/mpeg': 'mp3', 'audio/x-flac': 'flac', 'audio/x-wav': 'wav', 'multipart/x-mixed-replace': 'multipart', 'video/mpegts...
# -*- coding: utf-8 -*- from copy import deepcopy from reobject.exceptions import CorruptTransactionException __all__ = ['Transaction', 'transactional'] class Transaction(object): def __init__(self, obj): self.obj = obj self.__transaction_state = None def __enter__(self): self.__tr...
import FreeCAD,FreeCADGui,Path,PathGui from PySide import QtCore,QtGui """Path Pocket object and FreeCAD command""" # Qt tanslation handling try: _encoding = QtGui.QApplication.UnicodeUTF8 def translate(context, text, disambig=None): return QtGui.QApplication.translate(context, text, disambig, _encodi...
from django.contrib.auth.decorators import login_required from django.db.models.functions import Lower from django.shortcuts import render from django.contrib import messages import random import re from .models import Hunt, Team from .forms import PersonForm, ShibUserForm import logging logger = logging.getLogger(__...
# -*- coding: utf-8 -*- """ Created on Thu Oct 02 08:41:08 2014 @author: Acer """ import sys import pycd3 import csv from datetime import datetime from matplotlib.dates import date2num from scipy.interpolate import interp1d from numpy.core.fromnumeric import around from numpy import floor, ceil, arange #class NodeF...
from panda3d.core import * from panda3d.direct import * from direct.distributed import DistributedObjectAI from toontown.toonbase import ToontownGlobals from otp.otpbase import OTPGlobals from direct.fsm import FSM class DistributedCashbotBossCraneAI(DistributedObjectAI.DistributedObjectAI, FSM.FSM): def __init__...
"""BibFormat element - Prints report numbers """ __revision__ = "" import cgi from invenio.utils.url import create_html_link def format_element(bfo, limit, separator=" ", extension=" etc.", link='yes'): """ Prints the report numbers of the record (037__a and 088__a) @param separator: the separator betwe...
__author__ = 'Dobias van Ingen' import re import sys import comware def etss_range(etssrange): hosts = [] block = etssrange.split('.') for x, y in enumerate(block): if '-' in y: blockrange = y.split('-') for z in range(int(blockrange[0]), int(blockrange[1])+1): ...
import numpy as np def test_errors(): classes = ['DataError'] for subclass in classes: yield check_error, subclass def check_error(subclass): import pySDC.core.Errors err = getattr(pySDC.core.Errors, subclass) try: raise err('bla') assert False except err: a...
import requests import json import csv import time import datetime from pprint import pprint from ast import literal_eval def make_associated_event_list(divs): ATLEAST_GREATER_FACTOR = 2 assoc_list = [] #1 is normal, 0 is event for i in range(len(divs)): if i + 1 < len(divs) and i - 1 >= 0: ...
import mido from lisp.core.configuration import config from lisp.core.module import Module from lisp.modules.midi.midi_settings import MIDISettings from lisp.ui.settings.app_settings import AppSettings class Midi(Module): """Provide MIDI I/O functionality""" def __init__(self): # Register the settin...
""" FLI.lib.py Python interface to the FLI (Finger Lakes Instrumentation) API author: Craig Wm. Versek, Yankee Environmental Systems author_email: <EMAIL> """ __author__ = 'Craig Wm. Versek' __date__ = '2012-07-25' import os, sys, warnings from ctypes import cdll, c_char, c_char_p, c_long, c_ulong, c_...
from datetime import datetime import dweepy from braubuddy.output import IOutput from braubuddy.output import OutputError class DweetAPIOutput(IOutput): """ Output to the `Dweet <http://dweet.io>`_ API. :param units: Temperature units to output. Use 'celsius' or 'fahrenheit'. :type units: :cl...
#!/usr/bin/python # write an experiment that raises an exception import sys import os BOREALISPATH = os.environ['BOREALISPATH'] sys.path.append(BOREALISPATH) import experiments.superdarn_common_fields as scf from experiment_prototype.experiment_prototype import ExperimentPrototype class TestExperiment(ExperimentP...
"""Read-only helpers for traversing AST objects.""" from graphql import GraphQLList from graphql.language.ast import FieldNode, InlineFragmentNode, OperationDefinitionNode from ...ast_manipulation import get_ast_field_name from ...compiler.helpers import get_field_type_from_schema, get_vertex_field_type from ...schema...
from euca2ools.commands.argtypes import delimited_list from euca2ools.commands.elasticloadbalancing import ELBRequest from requestbuilder import Arg from requestbuilder.mixins import TabifyingMixin def instance_id(inst_as_str): return {'InstanceId': inst_as_str} class DeregisterInstancesFromLoadBalancer(ELBRequ...
"""Tests for metrics.""" import lingvo.compat as tf from lingvo.core import metrics from lingvo.core import py_utils from lingvo.core import test_utils import numpy as np class MetricsTest(test_utils.TestCase): def testAverageMetric(self): m = metrics.AverageMetric() m.Update(1.0) m.Update(2.0, 10.0) ...
from typing import TYPE_CHECKING from .exceptions import JudyError from .internal import _cjudy, _ffi, _load if TYPE_CHECKING: from typing import Iterable, Mapping, Optional, Tuple, Union __all__ = ["JudyL", "JudyLIterator"] _load() class JudyLIterator(object): def __init__(self, j): # type: (Judy...
# Disclaimer: you must have Graphviz installed to run this script import os import pandas as pd from sklearn import tree props = pd.read_csv('../data/peptide_9_props.csv') immun = pd.read_excel('../input/journal.pcbi.1003266.s001-2.XLS') # understanding the apply method immun['length'] = immun.Peptide.apply(len) imm...
""" -*- coding: utf-8 -*- {{{ vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: Copyright (c) 2017, Battelle Memorial Institute All rights reserved. 1. Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity lawfully obtaining a copy of this software and associated...
import base64 import os from hashlib import sha1 as sha import pytest from twisted.internet import reactor from twisted.internet.error import CannotListenError from twisted.python.failure import Failure from twisted.web.http import FORBIDDEN from twisted.web.resource import Resource from twisted.web.server import Site...
from gettext import gettext as _ import logging from gi.repository import GObject from gi.repository import Gtk from gi.repository import Gdk from gi.repository import Wnck from sugar3.graphics import style from sugar3.graphics.toolbutton import ToolButton class Dialog: def alert(self, args, parent, request): ...
"""Signal reconstruction via overlapped addition of frames.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.signal.python.ops import shape_ops from tensorflow.contrib.signal.python.ops import util_ops from tensorflow.python.framew...
""" Support for Wink lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.wink/ """ import asyncio import colorsys from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, SUPPORT_BRIGHTNESS, SUPPORT...
""" Copyright 2014-2021 Vincent Texier <<EMAIL>> DuniterPy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. DuniterPy is distributed in the...
# -*- coding: utf-8 -*- from __future__ import absolute_import import lxml.html import requests from crawler.decaptcha import Entrance class ProgramCrawler(object): form_url = ( 'https://www.ccxp.nthu.edu.tw/' 'ccxp/INQUIRE/JH/6/6.1/6.1.11/6.1.11.6/JH61b6001.php') form_action_url = ( ...
from django.conf.urls.defaults import * from piston.authentication import HttpBasicAuthentication from api.handlers import * auth = {'authentication': HttpBasicAuthentication(realm="api")} artist_handler = ApiResource(handler=ArtistHandler) artists_handler = ApiResource(handler=ArtistsHandler, **auth) release_hand...
import tempfile import shutil import pytest from unittest import TestCase import os from zoo.orca.data.image.parquet_dataset import ParquetDataset, read_parquet from zoo.orca.data.image.utils import DType, FeatureType, SchemaField import tensorflow as tf from zoo.ray import RayContext resource_path = os.path.join(os...
"""Tests for Keras metrics serialization.""" import os import shutil from absl.testing import parameterized import numpy as np from tensorflow.python import keras from tensorflow.python.keras import keras_parameterized from tensorflow.python.keras import layers from tensorflow.python.keras import metrics from tensor...
"""Training a CNN on MNIST in TF Eager mode with DP-SGD optimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import numpy as np import tensorflow.compat.v1 as tf from tensorflow_privacy.privacy.analysis....
import logging from django.core.urlresolvers import reverse # noqa from django.utils.translation import ugettext_lazy as _ # noqa from horizon import exceptions from horizon import tabs from openstack_dashboard import api LOG = logging.getLogger(__name__) class OverviewTab(tabs.Tab): name = _("Overview") ...
import numpy as np import autosklearn.pipeline.implementations.OneHotEncoder from HPOlibConfigSpace.configuration_space import ConfigurationSpace from HPOlibConfigSpace.hyperparameters import CategoricalHyperparameter, \ UniformFloatHyperparameter from HPOlibConfigSpace.conditions import EqualsCondition from aut...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Referências: https://en.wikipedia.org/wiki/Conversion_of_units e http://physics.nist.gov/cuu/Constants/Table/allascii.txt import math from .geral import TODAS_AS_UNIDADES from .medida import Medida from .unidade import Unidade def registra_unidades(): PI = Medida("3...
# Program split_fasta.py # # Description: Standalone Python program to split a FASTA file into # chunks of a specified size. Also has capabilites to # # (1) Omit sequences below a given threshold length # (2) Remove '>' embedded within the annotation line # (3) Trim ambiguous residues from front and/or end of sequence...
from collections import OrderedDict from django.contrib.staticfiles.finders import get_finders from django.contrib.staticfiles.storage import StaticFilesStorage def find_files(): # copied from django.contrib.staticfiles.management.commands.collectstatic found_files = OrderedDict() for finder in get_finde...
#!/bin/false # these are code snippets for the slides # they are put in here so we can get a nice screenshot with # syntax highlighting # Anatomy of a Python Module #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Line #1 = shebang # Line #2 = encoding declaration """Docstrings""" # Inline documentation import mod...
import Pyro4 from . import MupifObject @Pyro4.expose class Particle(MupifObject.MupifObject): """ Representation of particle. Particle is is object characterized by its position and other attributes. Particles are typically managed by ParticleSet. Particle class is convinience mapping to ParticleSet. "...
from flask import Flask, render_template, redirect, request from mongoengine import register_connection import jinja2 from flask.ext.cache import Cache # Credits for Jinja overloading method: # http://fewstreet.com/2015/01/16/flask-blueprint-templates.html class FlaskApp(Flask): def __init__(self): Flask._...
import datetime from autobahn.asyncio.wamp import ApplicationSession class Component(ApplicationSession): """ A simple time service application component. """ def onJoin(self, details): def utcnow(): now = datetime.datetime.utcnow() return now.strftime("%Y-%m-%dT%H:...
import uuid from msrest.pipeline import ClientRawResponse from .. import models class Operations(object): """Operations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An o...
import json import socket import time import traceback from telemetry import decorators from telemetry.internal.backends.chrome_inspector import inspector_websocket from telemetry.internal.backends.chrome_inspector import websocket from telemetry.timeline import trace_data as trace_data_module class TracingUnsupport...
import pytest from flask import Flask, url_for from flask_sqlalchemy import SQLAlchemy from werkzeug.wrappers import BaseResponse from flask_marshmallow import Marshmallow from flask_marshmallow.sqla import HyperlinkRelated from marshmallow import ValidationError from tests.conftest import Bunch try: from marshma...
from marshmallow import fields from marshmallow.exceptions import ValidationError class PynamoNested(fields.Nested): def _serialize(self, nested_obj, attr, obj): if not isinstance(nested_obj, dict): nested_obj = nested_obj.attribute_values return super(PynamoNested, self)._serialize(ne...
import Tkinter as tk import datetime from cfg import Config from date import getNow from date import multiParse from date import Date from log import logTC from errorwin import ErrorWindow PADX = 10 PADY = 10 Config = Config() class ConfirmVisitorPass(): def __init__(self, primary, sub, geo="420x325"): ...
# coding: utf-8 """ ====================================================================== Learning and Visualizing the BMS sensor-time-weather data structure ====================================================================== This example employs several unsupervised learning techniques to extract the energy data...
import os import sys import Pyro.errors import Pyro.core import cylc.flags from cylc.owner import user from cylc.suite_host import get_hostname from cylc.registration import localdb from cylc.passphrase import passphrase, get_passphrase, PassphraseError from cylc.cfgspec.globalcfg import GLOBAL_CFG from cylc.network i...
from spack import * class PyPyflakes(PythonPackage): """A simple program which checks Python source files for errors.""" homepage = "https://github.com/PyCQA/pyflakes" url = "https://github.com/PyCQA/pyflakes/archive/2.1.1.tar.gz" version('2.2.0', sha256='4a6927b9ca7fc19817176d54b3ee2ee4202f064...
"""Test Statusbar url.""" import pytest from PyQt5.QtCore import QUrl from qutebrowser.utils import usertypes, urlutils from qutebrowser.mainwindow.statusbar import url from helpers import utils @pytest.fixture def url_widget(qtbot, monkeypatch, config_stub): """Fixture providing a Url widget.""" widget = ...
import datetime import csv import six from six import StringIO from icalendar import Calendar, Event from pyramid.renderers import JSON from ode.models import icalendar_to_model_keys from ode.deserializers import data_list_to_dict from ode.models import Event as EventModel, Location class IcalRenderer(object): ...
import sklearn.cluster import numpy as np import autogp from autogp import likelihoods from autogp import kernels import tensorflow as tf from autogp import datasets from autogp import losses from autogp import util def init_z(train_inputs, num_inducing): # Initialize inducing points using clustering. mini_ba...
from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api.openstack import xmlutil from nova.auth import manager from nova import exception from nova import flags from nova import log as logging FLAGS = flags.FLAGS LOG = lo...
# -*- coding: utf-8 -*- import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request class MassMailController(http.Controller): @http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none') def track_mail_open(self, mail_id, **post): """ Email tracking. """...
import time import datetime import threading import os try: import cPickle as pickle except ImportError: import pickle try: import hashlib except ImportError: # python 2.4 import md5 as hashlib try: import fcntl except ImportError: # Probably on a windows system # TODO: use win32file ...
"""A POP3 client class. Based on the J. Myers POP3 draft, Jan. 96 """ # [heavily stealing from nntplib.py] # Updated: Piers Lauder <<EMAIL>> [Jul '97] # String method conversion and test jig improvements by ESR, February 2001. # Added the POP3_SSL class. Methods loosely based on IMAP_SSL. Hector Urtub...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os from os.path import abspath, dirname, join import sys import six from asv import config from asv.commands.compare import Compare from . import tools RESULT_DIR = abspath(join(dirname(__file__), '...
#!/usr/bin/python # this script needs root privileges import datetime import thread import gammu import sys import time import os import random from temperature import Temperature from subprocess import Popen, PIPE from gpsParser import GpsParser from ctypes import CDLL, c_float class Listener(object): def __init__...
import factory import factory.fuzzy from teryt_tree.factories import JednostkaAdministracyjnaFactory from .models import Category, MetaCategory, Organization class MetaCategoryFactory(factory.django.DjangoModelFactory): name = factory.Sequence(lambda n: 'user%d' % n) key = factory.LazyAttribute(lambda obj: '...
#!/usr/bin/python #encoding: utf-8 ''' This file is part of the Panda3D user interface library, Beast. See included "License.txt" ''' from direct.showbase.DirectObject import DirectObject from panda3d.core import ConfigVariableDouble, ConfigVariableBool, PGTop, PGButton, MouseButton, CardMaker, TransparencyAttr...
# importing libraries: import maya.cmds as cmds import dpBaseControlClass as BaseControl reload(BaseControl) # global variables to this module: CLASS_NAME = "Ellipse" TITLE = "m122_ellipse" DESCRIPTION = "m099_cvControlDesc" ICON = "/Icons/dp_ellipse.png" dpEllipseVersion = 1.1 class Ellipse(BaseControl.ControlS...
import os from gi.repository import BlockDev as blockdev from ..storage_log import log_method_call from parted import PARTITION_RAID from ..errors import MDMemberError from . import DeviceFormat, register_device_format from ..flags import flags from ..i18n import N_ import logging log = logging.getLogger("blivet") ...
"""Config flow to configure the OpenUV component.""" import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( CONF_API_KEY, CONF_ELEVATION, CONF_LATITUDE, CONF_LONGITUDE) from homeassistant.core import callback from homeassistant.helpers import aiohttp_client, config_val...
""" This file defines the Job class, which is the primary code API to vector_upstart. """ import getpass import os import pickle import subprocess from glob import glob as glob_files from catkin.find_in_workspaces import find_in_workspaces import providers class Job(object): """ Represents a ROS configuration ...