content
string
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() data = get_employees(filters) return columns, data def get_columns(): return [ _("Employee") + ":Link/Employee:120", _("Name"...
import unittest from swift.common import exceptions class TestExceptions(unittest.TestCase): def test_replication_exception(self): self.assertEqual(str(exceptions.ReplicationException()), '') self.assertEqual(str(exceptions.ReplicationException('test')), 'test') def test_replication_lock_tim...
from django.contrib.contenttypes.models import ContentType from django.db import DEFAULT_DB_ALIAS, router from django.db.models import get_apps, get_models, signals from django.utils.encoding import smart_text from django.utils import six from django.utils.six.moves import input def update_contenttypes(app, created_m...
import html5lib from nose.tools import eq_ import bleach def test_empty(): eq_('', bleach.clean('')) def test_comments_only(): comment = '<!-- this is a comment -->' open_comment = '<!-- this is an open comment' eq_('', bleach.clean(comment)) eq_('', bleach.clean(open_comment)) eq_(comment,...
from ycmd.responses import ServerError # Throws an exception if request doesn't have all the required fields. # TODO: Accept a request_type param so that we can also verify missing # command_arguments and completer_target fields if necessary. def EnsureRequestValid( request_json ): required_fields = set( [ 'li...
import time import FacebookService import thrift.reflection.limited from ttypes import fb_status class FacebookBase(FacebookService.Iface): def __init__(self, name): self.name = name self.alive = int(time.time()) self.counters = {} def getName(self, ): return self.name def getVersion(self, ): ...
from django import template from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self, varname=None, name=None): if name is None: raise template.Templa...
import os def messages_path(): """ Determine the path to the 'messages' directory as best possible. """ module_path = os.path.abspath(__file__) locale_path = os.path.join(os.path.dirname(module_path), 'locale') if not os.path.exists(locale_path): locale_path = '/usr/share/locale' r...
{ 'name': 'Create Tasks from SO', 'version': '1.0', 'category': 'Project Management', 'description': """ Automatically creates project tasks from procurement lines. =========================================================== This module will automatically create a new task for each procurement order li...
"""ShardStage unit tests.""" import mock import logging from src import basetest from src.pipelines import shardstage class SimpleShardStage(shardstage.ShardStage): """A Simple stage that just keeps track of what config it was started with.""" def __init__(self, config): super(shardstage.ShardStage, self...
from __future__ import print_function import os, sys from nose import with_setup import cPickle as pickle from tacc_stats.pickler import job_pickles from tacc_stats.pickler import job_stats, batch_acct sys.modules['pickler.job_stats'] = job_stats sys.modules['pickler.batch_acct'] = batch_acct path = os.path.dirname(o...
""" ``python-future``: pure Python implementation of Python 3 round(). """ from future.utils import PYPY, PY26, bind_method # Use the decimal module for simplicity of implementation (and # hopefully correctness). from decimal import Decimal, ROUND_HALF_EVEN def newround(number, ndigits=None): """ ...
""" Simple roster implementation. Can be used though for different tasks like mass-renaming of contacts. """ from protocol import * from client import PlugIn class Roster(PlugIn): """ Defines a plenty of methods that will allow you to manage roster. Also automatically track presences from remote JIDs taki...
# -*- coding: utf-8 -*- import sys """Auxiliary procedure for printing each item of row in columns in binary form """ def _printTable(t, size): out = "" for i in range(len(t)): binaryForm = bin(t[i]) binaryForm = binaryForm[2 : ] binaryForm = binaryForm.zfill(size) out += binary...
"""Module to make discovery data test cases available""" import urlparse import os.path from openid.yadis.discover import DiscoveryResult, DiscoveryFailure from openid.yadis.constants import YADIS_HEADER_NAME tests_dir = os.path.dirname(__file__) data_path = os.path.join(tests_dir, 'data') testlist = [ # success, i...
"""Tests for string and unicode handling in PIDL generated bindings samba.dcerpc.*""" from samba.dcerpc import drsblobs import samba.tests from samba.ndr import ndr_unpack, ndr_pack import talloc import gc class TestException(Exception): pass class StringTests(samba.tests.TestCase): def setUp(self): ...
def context_to_airflow_vars(context): """ Given a context, this function provides a dictionary of values that can be used to externally reconstruct relations between dags, dag_runs, tasks and task_instances. :param context: The context for the task_instance of interest :type context: dict """ ...
#!/usr/bin/env python # A game with VTK and Tkinter. :) import Tkinter import vtk from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor # Create the pipeline puzzle = vtk.vtkSpherePuzzle() mapper = vtk.vtkPolyDataMapper() mapper.SetInputConnection(puzzle.GetOutputPort()) actor = vtk.vtkActor() a...
from logr import Logr from caper.matcher import FragmentMatcher from caper.objects import CaperFragment, CaperClosure from caper.parsers.anime import AnimeParser from caper.parsers.scene import SceneParser from caper.parsers.usenet import UsenetParser __version_info__ = ('0', '3', '1') __version_branch__ = 'master' ...
from telemetry.core import exceptions from telemetry.unittest import tab_test_case class InspectorRuntimeTest(tab_test_case.TabTestCase): def testRuntimeEvaluateSimple(self): res = self._tab.EvaluateJavaScript('1+1') assert res == 2 def testRuntimeEvaluateThatFails(self): self.assertRaises(exceptions....
from django.core.exceptions import MiddlewareNotUsed from django.utils.http import http_date, parse_http_date_safe class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, ...
import random import math class BreedingPool(object): """ This class is a container for Chromosomes. Allows efficient selection of chromosomes to be "bred". This class implements a binary tree """ class node(): """ Each node represents the "value" of a single chromosome. Used to...
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141. TODO: Fill out more detailed documentation on the operators.""" from abc import ABCMeta, abstractmethod __all__ = ["Number", "Complex", "Real", "Rational", "Integral"] class Number(metaclass=ABCMeta): """All numbers inherit from this class. ...
"""Tests for ..public.message for the pure Python implementation.""" import os os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'python' # We must set the implementation version above before the google3 imports. # pylint: disable=g-import-not-at-top from google.apputils import basetest from google.protobuf.inte...
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
from base_page import BasePage class BackupAccountPage(BasePage): def __init__(self, context): super(BackupAccountPage, self).__init__(context, context.backup_account_url) self._locators = { 'logout_button': 'button[name="logout"]' } def logout(self): logout_butto...
"""Extend OptionParser with commands. Example: >>> parser = OptionParser() >>> parser.usage = '%prog COMMAND [options] <arg> ...' >>> parser.add_command('build', 'mymod.build') >>> parser.add_command('clean', run_clean, add_opt_clean) >>> run, options, args = parser.parse_command(sys.argv[1:]) >>> return run(options,...
import cStringIO import struct import dns.exception import dns.rdata class NSEC3PARAM(dns.rdata.Rdata): """NSEC3PARAM record @ivar algorithm: the hash algorithm number @type algorithm: int @ivar flags: the flags @type flags: int @ivar iterations: the number of iterations @type iterations:...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import time try: import boto3 HAS_BOTO3 = True except ImportError: HAS_BOTO3 =...
import unittest import sys from cStringIO import StringIO from spanner import countdown include = True class CountdownTestCase(unittest.TestCase): def setUp(self): # redirect stdout self.old_stdout = sys.stdout self.trapped_stdout = sys.stdout = StringIO() def tearDown(self): ...
""" Combat Simulator Project : Quit and resume window script """ import csp.cspsim from csp.data.ui.scripts.utils import SlotManager from csp.data.ui.scripts.windows.options import Options class QuitResume(csp.cspsim.Window, SlotManager): def __init__(self, cspsim): csp.cspsim.Window.__init__(self) ...
# -*- coding: utf-8 -*- """ Created on Mon Nov 30 17:28:58 2015 @author: fernando chaure """ from configuration import GENERAL_CONFIG as CONFIG from multiprocess_config import * import numpy as np from configuration import CONFIG_PARSER from os import path COMM = {} for x in CONFIG_PARSER['FORMAT_CONFIG']: if CO...
from __future__ import absolute_import import os import sys # Make sure we import from working tree pynagbase = os.path.dirname(os.path.realpath(__file__ + "/..")) sys.path.insert(0, pynagbase) import unittest2 as unittest from mock import patch import shutil import tempfile import pynag.Utils as utils import pynag.M...
from setuptools import setup, find_packages, os import json with open('package.json') as packageFile: version = json.load(packageFile)['version'] setup( name="jasmine-core", version=version, url="http://jasmine.github.io", author="Pivotal Labs", author_email="<EMAIL>", description=('Jasmine ...
from i18n import _ import error class repository(object): def capable(self, name): '''tell whether repo supports named capability. return False if not supported. if boolean capability, return True. if string capability, return string.''' if name in self.capabilities: ...
"""Ensure emitted events contain the fields legacy processors expect to find.""" from collections import namedtuple import ddt from django.test.utils import override_settings from mock import sentinel from openedx.core.lib.tests.assertions.events import assert_events_equal from . import FROZEN_TIME, EventTrackingTe...
from __future__ import (division, absolute_import, print_function, unicode_literals) from mock import Mock from test._common import unittest from test.helper import TestHelper from beets.library import Item from beetsplug.mpdstats import MPDStats class MPDStatsTest(unittest.TestCase, TestHe...
""" merged implementation of the cache provider the name cache was not choosen to ensure pluggy automatically ignores the external pytest-cache """ import py import pytest import json from os.path import sep as _sep, altsep as _altsep class Cache(object): def __init__(self, config): self.config = config...
from spack import * class FontBhType1(Package): """X.org bh-type1 font.""" homepage = "http://cgit.freedesktop.org/xorg/font/bh-type1" url = "https://www.x.org/archive/individual/font/font-bh-type1-1.0.3.tar.gz" version('1.0.3', '62d4e8f782a6a0658784072a5df5ac98') depends_on('font-util') ...
# -*- coding: utf-8 -*- """ werkzeug.contrib.atom ~~~~~~~~~~~~~~~~~~~~~ This module provides a class called :class:`AtomFeed` which can be used to generate feeds in the Atom syndication format (see :rfc:`4287`). Example:: def atom_feed(request): feed = AtomFeed("My Blog", feed...
import smtplib from email.mime.text import MIMEText from bredo.logger import * class Mail(object): def __init__(self, smtpserver, sender): self.log = Logger('kippo-alert.log') self.smtpserver = smtpserver self.sender = sender def send(self, recipient, subject, message): try: s = smtplib.SMTP(self.smtpser...
import sys, os # Delay import _tkinter until we have set TCL_LIBRARY, # so that Tcl_FindExecutable has a chance to locate its # encoding directory. # Unfortunately, we cannot know the TCL_LIBRARY directory # if we don't know the tcl version, which we cannot find out # without import Tcl. Fortunately, Tcl will itself ...
DATE_FORMAT = 'N j, Y' # 'Oct. 25, 2006' TIME_FORMAT = 'P' # '2:30 pm' DATETIME_FORMAT = 'N j, Y, P' # 'Oct. 25, 2006, 2:30 pm' YEAR_MONTH_FORMAT = 'F Y' # 'October 2006' MONTH_DAY_FORMAT = 'F j' # 'October 25' SHORT_DATE_FORMAT = 'd/m/Y' ...
""" Run and manage servers for local development. """ from __future__ import print_function import argparse import sys from paver.easy import call_task, cmdopts, consume_args, needs, sh, task from .assets import collect_assets from .utils.cmd import django_cmd from .utils.process import run_process, run_multi_process...
""" Django admin page for CourseAssetCacheTtlConfig, which allows you to configure the TTL that gets used when sending cachability headers back with request course assets. """ from django.contrib import admin from config_models.admin import ConfigurationModelAdmin from .models import CourseAssetCacheTtlConfig, CdnUserA...
"""Class for parsing ASN.1""" from .compat import * from .codec import * #Takes a byte array which has a DER TLV field at its head class ASN1Parser(object): def __init__(self, bytes): p = Parser(bytes) p.get(1) #skip Type #Get Length self.length = self._getASN1Length(p) #G...
"""SCons.Script This file implements the main() function used by the scons script. Architecturally, this *is* the scons script, and will likely only be called from the external "scons" wrapper. Consequently, anything here should not be, or be considered, part of the build engine. If it's something that we expect ot...
from xen.xend.XendAPIConstants import XEN_API_TASK_STATUS_TYPE from xen.xend.XendLogging import log import thread import threading class XendTask(threading.Thread): """Represents a Asynchronous Task used by Xen API. Basically proxies the callable object in a thread and returns the results via self.{type,r...
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" __revision__ = "$Id$" import os from sysconfig import get_python_version from distutils.util import get_platform ...
# -*- coding: utf-8 -*- # # Mock documentation build configuration file, created by # sphinx-quickstart on Mon Nov 17 18:12:00 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable...
from builtins import str from builtins import zip from collections import OrderedDict import json import logging from airflow.utils import AirflowException from airflow.hooks import PrestoHook, HiveMetastoreHook, MySqlHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class HiveSta...
from __future__ import absolute_import from __future__ import with_statement import time import shelve import logging import threading import collections from functools import partial import celery from tornado.ioloop import PeriodicCallback from tornado.ioloop import IOLoop from celery.events import EventReceiver...
from django.core.management.base import NoArgsCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): "Converts a module namespace to a Python dictionary. Used by get_settings_diff." return dict([(k, repr(v)) for k, v in module.__dict__.items() if not omittable(k)]) class Command(NoArgsComm...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import sys import paramiko import time import argparse import socket import array import json import time import re try: from ansible.module_utils import cnos HAS_LIB = Tr...
from __future__ import print_function, division def finite_diff(expression, variable, increment=1): """ Takes as input a polynomial expression and the variable used to construct it and returns the difference between function's value when the input is incremented to 1 and the original function value. I...
""" Find all the available input interfaces and try to initialize them. """ import os import glob import logging from ..inputreaderinterface import InputReaderInterface __author__ = 'Bitcraze AB' __all__ = ['InputInterface'] logger = logging.getLogger(__name__) found_interfaces = [os.path.splitext(os.path.basename...
import sys, signal, threading from twisted.internet import reactor from twisted.internet.protocol import Protocol, Factory class PubProtocol(Protocol): def __init__(self, factory): self.factory = factory def connectionMade(self): print("new connection made") def connectionLost(self, rea...
import posixpath from django import http from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404, redirect import caching.base as caching import commonware.log import jingo from mobility.decorators import mobile_template import amo from amo.urlresolvers import reverse from ...
"""Tests for tensorflow.ops.numerics.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from ...
# coding: utf-8 # numpy_utils for Intro to Data Science with Python # -------------------------------------- import numpy ## Stage 2 begin fieldNames = ['', 'id', 'priceLabel', 'name','brandId', 'brandName', 'imageLink', 'desc', 'vendor', 'patterned', 'material'] dataTypes = [('myint', 'i'), ('myid...
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User, Group class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--list', action='store_true', de...
# -*- coding: utf-8 -*- """ Sahana Eden Automated Tests - INV005 Create Item @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to dea...
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
#!d:\e-commers\scripts\python.exe # # The Python Imaging Library # $Id$ # # this demo script creates four windows containing an image and a slider. # drag the slider to modify the image. # try: from tkinter import Tk, Toplevel, Frame, Label, Scale, HORIZONTAL except ImportError: from Tkinter import Tk, Topleve...
"""Tests for `DataFeeder`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import six from six.moves import xrange # pylint: disable=redefined-builtin # pylint: disable=wildcard-import from tensorflow.contrib.learn.python.learn.learn...
import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '../..','LIB')) import rfestimationLib as rfe import argparse #argument parsing import numpy as np import scipy.ndimage from sklearn.decomposition import PCA import matplotlib.pyplot as plt import matplotlib.mlab as mlab from sklearn import mixture...
from twisted.internet.defer import inlineCallbacks from twisted.internet import reactor from twisted.internet.protocol import ClientCreator from twisted.python import log from txamqp.protocol import AMQClient from txamqp.client import TwistedDelegate import txamqp.spec @inlineCallbacks def gotConnection(conn, userna...
from platformio.exception import PlatformioException, UserSideException class DebugError(PlatformioException): pass class DebugSupportError(DebugError, UserSideException): MESSAGE = ( "Currently, PlatformIO does not support debugging for `{0}`.\n" "Please request support at https://github.c...
from django.shortcuts import render_to_response from django.template.context import RequestContext from django.http.response import HttpResponseNotAllowed class HttpMethodRestrictMixin(object): allowed_methods = [ 'options', 'get', 'head', 'post', 'put', 'delete', 'trace', 'connect', ] de...
""" India-specific Form helpers. """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_unicode from django.utils.translation import gettext import re class INZipCodeField(RegexFiel...
"""Collada DOM 1.3.0 tool for SCons.""" import sys def generate(env): # NOTE: SCons requires the use of this name, which fails gpylint. """SCons entry point for this tool.""" env.Append(CCFLAGS=[ '-I$COLLADA_DIR/include', '-I$COLLADA_DIR/include/1.4', ])
# -*- 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 'CourseMode.description' db.add_column('course_modes_coursemode', 'description', ...
""" The GeometryColumns and SpatialRefSys models for the SpatiaLite backend. """ from django.contrib.gis.db.backends.base.models import SpatialRefSysMixin from django.contrib.gis.db.backends.spatialite.base import DatabaseWrapper from django.db import connection, models from django.db.backends.signals import connectio...
from django.shortcuts import render_to_response from django.db.models import Q from django.template import RequestContext from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.utils.translation import ugettext as _ from main.models import Post, Tag from main.forms import PostForm from ut...
from __future__ import print_function HIDE_CURSOR = '\x1b[?25l' SHOW_CURSOR = '\x1b[?25h' class WriteMixin(object): hide_cursor = False def __init__(self, message=None, **kwargs): super(WriteMixin, self).__init__(**kwargs) self._width = 0 if message: self.message = messa...
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2009 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http:...
""" Import related utilities and helper functions. """ import sys import traceback def import_class(import_str): """Returns a class from a string including module and class.""" mod_str, _sep, class_str = import_str.rpartition('.') try: __import__(mod_str) return getattr(sys.modules[mod_st...
from math import sqrt from numpy import isclose from rbnics.problems.elliptic.elliptic_coercive_compliant_problem import EllipticCoerciveCompliantProblem from rbnics.problems.elliptic.elliptic_coercive_compliant_reduced_problem import EllipticCoerciveCompliantReducedProblem from rbnics.problems.elliptic.elliptic_coerci...
from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..compat import ( compat_str, compat_urllib_parse_urlparse, compat_urlparse, ) from ..utils import ( ExtractorError, find_xpath_attr, int_or_none, orderedSet, xpath_wit...
data = ( 'qiet', # 0x00 'qiex', # 0x01 'qie', # 0x02 'qiep', # 0x03 'quot', # 0x04 'quox', # 0x05 'quo', # 0x06 'quop', # 0x07 'qot', # 0x08 'qox', # 0x09 'qo', # 0x0a 'qop', # 0x0b 'qut', # 0x0c 'qux', # 0x0d 'qu', # 0x0e 'qup', # 0x0f 'qurx', # 0x10 'qur', # 0x11 ...
#!/usr/bin/env python ######################################################################## # $Header: $ ######################################################################## __RCSID__ = "$Id$" from DIRAC import exit as DIRACExit from DIRAC.Core.Base import Script Script.setUsageMessage( """ Remove th...
"""Checks that all the versions match.""" import logging import os import re import shakaBuildHelpers def player_version(): """Gets the version of the library from player.js.""" path = os.path.join(shakaBuildHelpers.get_source_base(), 'lib', 'player.js') with open(path, 'r') as f: match = re.search(r'goog...
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin class Cobbler(Plugin): plugin_name = "cobbler" class RedHatCobbler(Cobbler, RedHatPlugin): """Cobbler installation server """ packages = ('cobbler',) profiles = ('cluster', 'sysmgmt') def setup(self): self.add...
import numpy as np from scipy.optimize import fmin from scipy.misc import derivative from scipy.stats import norm from .Utilities import integrate from numpy import Inf from math import fabs, log class MLE(object): def __init__(self, density, theta0, support= None, dims = None, fisher_matrix=None): """ A class f...
import unittest2 from lxml import etree import openerp from openerp.tools.misc import mute_logger from openerp.tests import common # test group that demo user should not have GROUP_TECHNICAL_FEATURES = 'base.group_no_one' class TestACL(common.TransactionCase): def setUp(self): super(TestACL, self).setU...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
"""Scrapy Shell See documentation in docs/topics/shell.rst """ from __future__ import print_function import os import signal import warnings from twisted.internet import reactor, threads, defer from twisted.python import threadable from w3lib.url import any_to_uri from scrapy.crawler import Crawler from scrapy.exc...
import volatility.obj as obj class Win2003x86GuiVTypes(obj.ProfileModification): """Apply the overlays for Windows 2003 x86 (builds on Windows XP x86)""" before = ["XP2003x86BaseVTypes"] conditions = {'os': lambda x: x == 'windows', 'memory_model': lambda x: x == '32bit', ...
import uno import string import unohelper import random import xmlrpclib import base64, tempfile from com.sun.star.task import XJobExecutor import os import sys if __name__<>'package': from lib.gui import * from lib.error import * from lib.functions import * from lib.logreport import * from lib.tool...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class AddChild(Choreography): def __init__(self, temboo_session): """ Create a new ...
import sys import hal import emccanon import interpreter try: import emctask import customtask except ImportError: pass try: import cPickle as pickle except ImportError: import pickle def starttask(): global pytask import emc ini = emc.ini(emctask.ini_filename()) t = ini.find("PYT...
''' Created on Sep 17, 2016 @author: Teemu Ahola [<EMAIL>] ''' import os import elfcloud import worker import binascii import logger APIKEY = 'swrqwb95d98ou8d' VALULT_TYPES = [elfcloud.utils.VAULT_TYPE_DEFAULT, 'com.ahola.sailelfcloud'] DEFAULT_REQUEST_SIZE_BYTES = 256 * 1024 # Size of one request when sending or ...
{ 'name': 'Weighting Scale Hardware Driver', 'version': '1.0', 'category': 'Hardware Drivers', 'sequence': 6, 'summary': 'Hardware Driver for Weighting Scales', 'website': 'https://www.odoo.com/page/point-of-sale', 'description': """ Barcode Scanner Hardware Driver ==========================...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import enumfields.fields import shuup.core.fields import shuup.xtheme.models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name...
from WebIDL import IDLInterface class Configuration: """ Represents global configuration state based on IDL parse data and the configuration file. """ def __init__(self, filename, parseData): # Read the configuration file. glbl = {} execfile(filename, glbl) config =...
# -*- coding: utf-8 -*- """ Tests for In-Course Reverification Access Control Partition scheme """ import ddt import unittest from django.conf import settings from lms.djangoapps.verify_student.models import ( VerificationCheckpoint, VerificationStatus, SkippedReverification, ) from openedx.core.djangoap...
from sympy import symbols, S, I, atan, log, Poly from sympy.integrals.rationaltools import ratint, \ ratint_ratpart, ratint_logpart, log_to_atan, log_to_real from sympy.abc import a, x, t half = S(1)/2 def test_ratint(): assert ratint(S(0), x) == 0 assert ratint(S(7), x) == 7*x assert ratint(x, x) ...
"""Collection of helper methods. All containing methods are legacy helpers that should not be used by new components. Instead call the service directly. """ from homeassistant.components.vacuum import ( ATTR_FAN_SPEED, ATTR_PARAMS, DOMAIN, SERVICE_CLEAN_SPOT, SERVICE_LOCATE, SERVICE_PAUSE, ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion import modelcluster.fields import wagtail.wagtailcore.fields import wagtail.wagtailcore.blocks class Migration(migrations.Migration): dependencies = [ ('wagtailimages...
#!/bin/env # -*- coding: utf-8 -*- from langconv import * from bs4 import BeautifulSoup import re import os import json #输入Unicode编辑,输出Unicode def big2simple(line): #转换繁体到简体 line = Converter('zh-hans').convert(line) return line def save_img_url(img_url,num): img_url_file = open("img_url.txt","a") line = num+"...