content
stringlengths
4
20k
import datetime import elasticsearch_dsl.filter as es_filter from elasticsearch_dsl import aggs, query, SF from rest_framework.filters import BaseFilterBackend from mkt.games.constants import GAME_CATEGORIES class DailyGamesFilter(BaseFilterBackend): """ Randomly chooses 4 games, one from each featured game...
from __future__ import unicode_literals import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 SETUP_INFO = dict( name='lino_book', version='18.3.0', install_requires=[ 'lino', 'selenium','mock', 'django-iban', 'metafone', 'channels<2', 'djangorestframework', 'bl...
""" sample.py ------------ Randomly sample surface and volume of meshes. """ import numpy as np from . import util from . import transformations def sample_surface(mesh, count): """ Sample the surface of a mesh, returning the specified number of points For individual triangle sampling uses this met...
# -*- coding: utf-8 -*- from ansible.compat.tests import unittest from ansible.modules.packaging.os import yum yum_plugin_load_error = """ Plugin "product-id" can't be imported Plugin "search-disabled-repos" can't be imported Plugin "subscription-manager" can't be imported Plugin "product-id" can't be imported Plugi...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Narrator', 'Author': ['@harmj0y'], 'Description': ("Sets the debugger for the text narrator (Narrator.exe) to be cmd.exe, " ...
""" Agglomerative clustering with different metrics =============================================== Demonstrates the effect of different metrics on the hierarchical clustering. The example is engineered to show the effect of the choice of different metrics. It is applied to waveforms, which can be seen as high-dimens...
from __future__ import absolute_import from functools import partial from zerver.lib.actions import check_send_message from zerver.lib.response import json_success from zerver.decorator import api_key_only_webhook_view, REQ, has_request_variables from zerver.lib.webhooks.git import get_push_commits_event_message, EMPTY...
import sys import StringIO from lxml import etree import utils Font_size= 10.0 def verbose(text): sys.stderr.write(text+"\n") class textbox(object): """A box containing plain text. It can have an offset, in chars. Lines can be either text strings, or textbox'es, recursively. """ def __init_...
from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt from erpnext.accounts.utils import get_fiscal_year from erpnext.controllers.trends import get_period_date_ranges, get_period_month_ranges def execute(filters=None): if not filters: filters = {} columns ...
def limit(iterator, count): """ A filter that removes all elements behind the set limit. :param iterator: The iterator to be filtered. :param count: The iterator limit. All elements at positions bigger than this limit are trimmed off. Exclusion: 0 or numbers below ...
"""The metric spec class to flexibly connect models and metrics.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.platform import tf_logging as logging from tensorflow.python.util import tf_inspect def _assert_named_ar...
""" Verifies that xcode-style GCC_... settings that require clang are handled properly. """ import TestGyp import os import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) CHDIR = 'xcode-gcc' test.run_gyp('test-clang.gyp', chdir=CHDIR) test.build('test-clang.gyp'...
import threading from testutils import unittest, ConnectingTestCase, skip_before_postgres import psycopg2 from psycopg2.extensions import ( ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY) class TransactionTests(ConnectingTestCase): def setUp(self): ConnectingTestCase.setUp(self) sel...
from msrest.serialization import Model class CapabilityInformation(Model): """Subscription-level properties and limits for Data Lake Analytics. Variables are only populated by the server, and will be ignored when sending a request. :ivar subscription_id: the subscription credentials that uniquely ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_say version_added: "2.3" short_description: Text to speech module for Windows to speak messages and optionally play sounds description: - U...
from twisted.internet.defer import Deferred from higgins.logger import Loggable class SignalDisconnected(Exception): pass class Signal(object, Loggable): log_domain = "signal" def __init__(self): self.receivers = {} def matches(self, kwds): """ Override this method in your si...
#!/usr/bin/env python import dataloader import pickle import os.path import dataloader import dataprocessor import numpy class DataProvider(object): def __init__(self, order=1, use_pca=False, pca_nodes_path=None, db_host="localhost", db_user="root", db_password="", db_name="andrew", device_list=None, start...
import json import shlex import os import sys def query_package(module, name): pkg_info_path = module.get_bin_path('pkg_info', False) # Assume that if we have pkg_info, we haven't upgraded to pkgng if pkg_info_path: pkgng = False pkg_glob_path = module.get_bin_path('pkg_glob', True) ...
import logging import ibmsecurity.utilities.tools logger = logging.getLogger(__name__) requires_model="Appliance" def get(isamAppliance, check_mode=False, force=False): """ Retrieving the current date and time settings """ return isamAppliance.invoke_get("Retrieving the current date and time settings...
import sys sys.path.append("../liveq-common") # ---------- import logging import time import signal import sys from dashboard.config import Config from dashboard.component import DashboardComponent from liveq import handleSIGINT, exit from liveq.events import GlobalEvents from liveq.exceptions import ConfigException...
# # Test script for the curses module # # This script doesn't actually display anything very coherent. but it # does call every method and function. # # Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(), # getmouse(), ungetmouse(), init_color() # import curses, sys, tempfile # Optionally test cur...
# coding: utf-8 from __future__ import unicode_literals import json import pytest from boxsdk.object.metadata import MetadataUpdate @pytest.fixture def metadata_response(): return { '$id': 'c79896a0-a33f-11e3-a5e2-0800200c9a66', '$type': 'properties', '$parent': 'file_552345101', ...
"""Starter script for all nova services. This script attempts to start all the nova services in one process. Each service is started in its own greenthread. Please note that exceptions and sys.exit() on the starting of a service are logged and the script will continue attempting to launch the rest of the services. ...
import threading import numpy as np from mpi4py import MPI import tensorflow as tf from baselines.her.util import reshape_for_broadcasting class Normalizer: def __init__(self, size, eps=1e-2, default_clip_range=np.inf, sess=None): """A normalizer that ensures that observations are approximately distribu...
from oslo_serialization import jsonutils from requests import auth class AmbariClient(object): def __init__(self, instance, port="8080", **kwargs): kwargs.setdefault("username", "admin") kwargs.setdefault("password", "admin") self._port = port self._base_url = "http://{host}:{port...
data = ( 'jjael', # 0x00 'jjaelg', # 0x01 'jjaelm', # 0x02 'jjaelb', # 0x03 'jjaels', # 0x04 'jjaelt', # 0x05 'jjaelp', # 0x06 'jjaelh', # 0x07 'jjaem', # 0x08 'jjaeb', # 0x09 'jjaebs', # 0x0a 'jjaes', # 0x0b 'jjaess', # 0x0c 'jjaeng', # 0x0d 'jjaej', # 0x0e 'jjaec', # 0x...
from ansible.runner.return_data import ReturnData class ActionModule(object): def __init__(self, runner): self.runner = runner def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **kwargs): ''' transfer the given module name, plus the async module, then run it ''' ...
from Exporter import Exporter from settings import * import utils #============================================================================== # VarExporter #============================================================================== class VarExporter(Exporter): '''Exports a global variable. ''' def...
import os.path import sys IS_JYTHON = sys.platform.find('java') != -1 try: this_file_name = __file__ except NameError: # stupid jython. plain old __file__ isnt working for some reason import test_runfiles #@UnresolvedImport - importing the module itself this_file_name = test_runfiles.__file__ desir...
import os import pytest from ..pep257 import (StringIO, TokenStream, Parser, Error, check, Module, Class, Method, Function, NestedFunction, ErrorRegistry, AllError) _ = type('', (), dict(__repr__=lambda *a: '_', __eq__=lambda *a: True))() parse = Parser() source = ''' """...
#Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2016 import unittest import metaknowledge import os class TestScopus(unittest.TestCase): def setUp(self): metaknowledge.VERBOSE_MODE = False self.RC = metaknowledge.RecordCollection("metaknowledge/tests/scopus_testing.csv...
""" Views for managing instances. """ from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from horizon.utils import memoized from opens...
import os import re import numpy as np import tensorflow as tf from Config import Config class NetworkVP: def __init__(self, device, model_name, num_actions): self.device = device self.model_name = model_name self.num_actions = num_actions self.img_width = Config.IMAGE_WIDTH ...
"""Multiple DB API backend support. Supported configuration options: The following two parameters are in the 'database' group: `backend`: DB backend name or full module path to DB backend module. `use_tpool`: Enable thread pooling of DB API calls. A DB backend module should implement a method named 'get_backend' whi...
''' <Run loop detection test on Stanford network> Copyright 2012, Stanford University. This file is licensed under GPL v2 plus a special exception, as described in included LICENSE_EXCEPTION.txt. Created on Aug 14, 2011 @author: Peyman Kazemian ''' from examples.utils.network_loader import load_netwo...
from __future__ import unicode_literals # Try the new app settings (Django 1.7) and fall back to the old system try: from django.apps import apps as django_apps auth_app = django_apps.get_app_config("auth") except ImportError: from django.contrib.auth import models as auth_app from django.contrib.contentty...
import csv import os.path import numpy as np import matplotlib.pyplot as plt # collect stats from csv num_pods = [] num_nodes = [] sizes_raw = [] sizes_compressed = [] tpp_total_mean = [] tpp_build_mean = [] tpp_minimize_mean = [] tpp_order_mean = [] tpp_gen_mean = [] tpp_compress_mean = [] # read values from csv fil...
""" Suds basic options classes. """ from suds.properties import * from suds.wsse import Security from suds.xsd.doctor import Doctor from suds.transport import Transport from suds.cache import Cache, NoCache class TpLinker(AutoLinker): """ Transport (auto) linker used to manage linkage between transport o...
"""Tests l2hmc fit to 2D strongly correlated Gaussian executed eagerly.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy.random as npr import tensorflow as tf import tensorflow.contrib.eager as tfe from tensorflow.contrib.eager.p...
comma = ','.join quest = lambda l: '=?,'.join(l) + '=?' quest_2 = lambda l, c: ', '.join([('%s=CASE ' % x) + ("WHEN asset_id=? THEN ? " * c) + 'ELSE asset_id END' for x in l]) exists_table = "SELECT name FROM sqlite_master WHERE type='table' AND name='assets'" read_all = lambda keys: 'select ' + comma(keys) + ' from ...
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from django.contrib.gis.gdal.libgdal import lgdal from django.contrib.gis.gdal.prototypes.errcheck import check_envelope from django.contrib.gis.gdal.prototypes.generation import ( const_string_...
#!/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");...
import re class BattingStats(object): def __init__(self): self.game_id = "" self.player_id = 0 self.ab = 0 self._1b = 0 self._2b = 0 self.fd_points_2b = 0.0 self._3b = 0 self.fd_points_3b = 0.0 self.hr = 0 self.fd_points_hr = 0.0 ...
# -*- coding: utf-8 -*- """ *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. This program 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...
# -*- coding:utf-8 -*- from __future__ import absolute_import import gettext import os from os import path from django.conf import settings from django.core.urlresolvers import reverse from django.test import LiveServerTestCase, TestCase from django.test.utils import override_settings from django.utils import six, un...
import unittest from openerp.tools.translate import quote, unquote class TranslationToolsTestCase(unittest.TestCase): def test_quote_unquote(self): def test_string(str): quoted = quote(str) #print "\n1:", repr(str) #print "2:", repr(quoted) unquoted = unquo...
from nose.tools import eq_ from django.test.client import RequestFactory from crashstats.base.tests.testbase import TestCase from crashstats.base.helpers import ( change_query_string ) class TestChangeURL(TestCase): def test_root_url_no_query_string(self): context = {} context['request'] = ...
try: import simplejson as json except ImportError: import json from django.db import models from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from django.template.defaultfilters import slugify import pytz import time from netadmin.networks.models import Host from ...
import os import re import platform import sys import azurelinuxagent.common.conf as conf import azurelinuxagent.common.utils.shellutil as shellutil from azurelinuxagent.common.utils.flexible_version import FlexibleVersion from azurelinuxagent.common.future import ustr, get_linux_distribution __DAEMON_VERSION_ENV_VAR...
"""distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.""" __revision__ = "$Id$" # XXX this module has *lots* of code ripped-off quite transparently from # build_ext.py -- not sur...
from django.core.management.base import BaseCommand from assets.models import Asset from podcasts.models import PodcastEpisode class Command(BaseCommand): help = 'Cleans up dangling references to superseded files on eps awaiting import' def handle(self, *args, **options): eps = PodcastEpisode.object...
"""Contains layer utilies for input validation and format conversion. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from six.moves import xrange # pylint: disable=redefined-builtin import numpy as np from tensorflow.python.ops import varia...
# -*- coding: utf-8 -*- """ *************************************************************************** r_describe.py --------------------- Date : December 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************************...
ANDROID_WHITELISTED_LICENSES = [ 'A(pple )?PSL 2(\.0)?', 'Apache( Version)? 2(\.0)?', '(New )?([23]-Clause )?BSD( [23]-Clause)?( with advertising clause)?', 'L?GPL ?v?2(\.[01])?( or later)?', 'MIT(/X11)?(-like)?', 'MPL 1\.1 ?/ ?GPL 2(\.0)? ?/ ?LGPL 2\.1', 'MPL 2(\.0)?', 'Microsoft Limited Public License...
"""Unit tests for qubo.py.""" import unittest import numpy as np from parse_raw_sat import Clause from parse_raw_sat import Sat from qubo import open_brackets from qubo import Penalty from qubo import Qclause from qubo import QuboProblem class _TestOpenBrackets(unittest.TestCase): def test_open_brackets(self)...
from cStringIO import StringIO import json import unittest from zipfile import ZipFile from compiled_file_system import CompiledFileSystem from content_provider import ContentProvider from file_system import FileNotFoundError from object_store_creator import ObjectStoreCreator from path_canonicalizer import PathCanoni...
#!/usr/bin/env python # makepolys.py import codecs import json import math import os import random import re import shutil import stat import sys import time from geo import Geo import shpUtils import states #states = json.load( open('states.json') ) jsonpath = 'json' shapespath = 'shapefiles' geo = Geo() keysep ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.compat.tests.mock import patch from ansible.modules.network.nxos import nxos_bgp_neighbor_af from .nxos_module import TestNxosModule, load_fixture, set_module_args class TestNxosBgpNeighborAfModule(TestNxosModule): ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys from nose.plugins.skip import SkipTest if sys.version_info < (2, 7): raise SkipTest("F5 Ansible modules require Python >= 2.7") from ansible.compat.tests import unittest from ans...
""" This module implements clipboard handling on Windows using ctypes. """ import time import contextlib import ctypes from ctypes import c_size_t, sizeof, c_wchar_p, get_errno, c_wchar from .exceptions import PyperclipWindowsException class CheckedCall(object): def __init__(self, f): super(CheckedCall, ...
""" Utilities ========= """ from pipes import quote import os import posixpath from fabric.api import env, hide, run, sudo def run_as_root(command, *args, **kwargs): """ Run a remote command as the root user. When connecting as root to the remote system, this will use Fabric's ``run`` function. In ...
import mimetypes from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.shortcuts import render, redirect from django.http import HttpResponse from django.contrib.auth import login, logout, updat...
""" Models for configuration of the feature flags controlling persistent grades. """ from config_models.models import ConfigurationModel from django.conf import settings from django.db.models import BooleanField from xmodule_django.models import CourseKeyField class PersistentGradesEnabledFlag(ConfigurationModel): ...
try: import uctypes except ImportError: print("SKIP") raise SystemExit desc = { # arr is array at offset 0, of UINT8 elements, array size is 2 "arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2), # arr2 is array at offset 0, size 2, of structures defined recursively "arr2": (uctypes.ARRAY | 0, 2,...
"""Write a .xlsx file.""" # Python stdlib imports from zipfile import ZipFile, ZIP_DEFLATED from ....compat import BytesIO as StringIO # package imports from ..shared.ooxml import ARC_SHARED_STRINGS, ARC_CONTENT_TYPES, \ ARC_ROOT_RELS, ARC_WORKBOOK_RELS, ARC_APP, ARC_CORE, ARC_THEME, \ ARC_STYLE, ARC_...
import project import company import report import wizard import res_partner import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import urllib try: import json except ImportError: try: import simplejson as json except ImportError: json = None # import module snippets from ansib...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Machinery for generating tracing-related intermediate files. """ __author__ = "Lluís Vilanova <<EMAIL>>" __copyright__ = "Copyright 2012, Lluís Vilanova <<EMAIL>>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Ha...
"""Exception in web_socket_transfer_data(). """ def web_socket_do_extra_handshake(request): pass def web_socket_transfer_data(request): raise Exception('Intentional Exception for %s, %s' % (request.ws_resource, request.ws_protocol)) # vi:sts=4 sw=4 et
""" An interactive shell. This file is designed to be launched as a PYTHONSTARTUP script. """ import atexit import os import platform import warnings import py4j from pyspark import SparkConf from pyspark.context import SparkContext from pyspark.sql import SparkSession, SQLContext if os.environ.get("SPARK_EXECUTOR...
import Image import matplotlib.pyplot as plt import numpy import os from optparse import OptionParser from common import * def _parse_flags(): global indir, rangeradius parser = OptionParser() parser.add_option("-i", "--in", dest="indir", help="directory that containes images for which the dif...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: aci_l3out_route_tag_policy short_description: Manage route t...
#!/usr/bin/env python import os import re import sys dirname = "" RE_CODE_BLOCK = re.compile(r'.. code-block:: (.+?)\s*$') RE_INCLUDE = re.compile(r'.. include:: (.+?)\s*$') RE_REFERENCE = re.compile(r':(.+?):`(.+?)`') def include_file(lines, pos, match): global dirname orig_filename = match.groups()[0] ...
import unittest from Crypto.Cipher import AES from Crypto.Util import Counter import obfsproxy.common.aes as aes import twisted.trial.unittest class testAES_CTR_128_NIST(twisted.trial.unittest.TestCase): def _helper_test_vector(self, input_block, output_block, plaintext, ciphertext): self.assertEqual(lon...
from openerp.osv import orm from openerp.tools.translate import _ from datetime import datetime from openerp.tools import DEFAULT_SERVER_DATE_FORMAT class hr_payslip(orm.Model): _name = 'hr.payslip' _inherit = 'hr.payslip' def timesheet_mapping( self, cr, uid, timesheet_sheets, pa...
from __future__ import absolute_import import logging logger = logging.getLogger("confu") class ToolCollection: def __init__(self, target): self.target = target def __iter__(self): from confu.tools import Tool for name in dir(self): member = getattr(self, name) ...
from collections import Callable from numbers import Number from phi import math from ._field import Field from ..geom import Geometry from ..math import Shape, GLOBAL_AXIS_ORDER, spatial class AngularVelocity(Field): """ Model of a single vortex or set of vortices. The falloff of the velocity magnitude...
from oslo.config import cfg """ Configuration for the datacom switch. The options are used to locate datacom switches and identify openstack. The dm_username and dm_password are the credentials and the dm_host is the IP for the switch. The region name is the identifier for the controller. """ DATACOM_DRIVER_OPTS = ...
from django.contrib.gis.db import models class State(models.Model): name = models.CharField(max_length=20) objects = models.GeoManager() class County(models.Model): name = models.CharField(max_length=25) state = models.ForeignKey(State) mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in...
# encoding: utf-8 """ |ChartFormat| and related objects. |ChartFormat| acts as proxy for the `spPr` element, which provides visual shape properties such as line and fill for chart elements. """ from __future__ import absolute_import, division, print_function, unicode_literals from .fill import FillFormat from .line ...
import json import os from collections import defaultdict from item import item_types, ManualTest, WebdriverSpecTest, Stub, RefTest, TestharnessTest from log import get_logger from sourcefile import SourceFile from utils import from_os_path, to_os_path CURRENT_VERSION = 2 class ManifestError(Exception): pass ...
# -*- coding: utf-8 -*- ''' Covenant Add-on This program 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. This prog...
from tower import ugettext_lazy as _ class DEVICE_DESKTOP(object): id = 1 name = _(u'Desktop') class_name = 'desktop' api_name = 'desktop' class DEVICE_MOBILE(object): id = 2 name = _(u'Firefox Mobile') class_name = 'android-mobile' api_name = 'android-mobile' class DEVICE_TABLET(o...
import os import types class report_grave_plant_lists: def __init__(self, nRows = 0, sName = 'standard', iOrderSort=0): self.nRows = nRows self.sName = sName self.iOrderSort = iOrderSort self.dicReportData = {} self.dicReportData['Title'] = _(sName + ' ge...
import sys import importlib from .resources import HendrixResource from twisted.application import internet, service from twisted.internet import reactor, protocol from twisted.python.threadpool import ThreadPool from twisted.web import server, resource, static import logging logger = logging.getLogger(__name__) cl...
"""Code for instructing systems under test to block or fail.""" import abc import contextlib import threading import six class Defect(Exception): """Simulates a programming defect raised into in a system under test. Use of a standard exception type is too easily misconstrued as an actual defect in either t...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/console/template.ui' # # by: PyQt5 UI code generator 5.0.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): For...
import csv from matplotlib import pyplot as plt from datetime import datetime as dt # Get dats and high temps from file #filename = 'death_valley_2014.csv' #filename = 'sitka_weather_07-2014.csv' #filename = 'sitka_weather_2014.csv' filename = 'denver_weather_2001.csv' with open(filename) as f: reader = csv.reade...
class RabbitMqPolicy(object): def __init__(self, module, name): self._module = module self._name = name self._vhost = module.params['vhost'] self._pattern = module.params['pattern'] self._tags = module.params['tags'] self._priority = module.params['priority'] ...
# -*- coding: utf-8 -*- from odoo import tools import odoo.addons.decimal_precision as dp from odoo import models, fields class ReportSellSummary(models.Model): _name = 'report.sell.summary' _description = u'销售汇总表' _auto = False partner_id = fields.Many2one('partner', u'客户') department_id = fiel...
from datetime import datetime from django.db import models from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from actstr...
import time as systime, sys, os, traceback from sys import stdout sleep_time=10 #seconds duration =1 #minutes # Servers settings servers='AdminServer' # servers must be UP servers=servers.split(',') adminurl='t3://localhost:7001' #connect to AdminServer username='weblogic' password='weblogic1' log_dir='./...
"""Views for the branding app. """ import logging import urllib from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage from django.core.cache import cache from django.core.urlresolvers import reverse from django.http import Http404, HttpResponse from django.shortcuts import...
"""Define names for all type symbols known in the standard interpreter. Types that are part of optional modules (e.g. array) are not listed. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check...
import copy import importlib import json import logging import os from trellio.services import TCPService, HTTPService from ..utils.log_handlers import BufferingSMTPHandler logger = logging.getLogger(__name__) GLOBAL_CONFIG = { "RONIN": False, "HOST_NAME": "", "ADMIN_EMAILS": [], "SERVICE_NAME": "", ...
from test_framework import DobbscoinTestFramework from util import * import base64 try: import http.client as httplib except ImportError: import httplib try: import urllib.parse as urlparse except ImportError: import urlparse class HTTPBasicsTest (DobbscoinTestFramework): def setup_nodes(s...
# This file allows project-level configuration of the checkin-test system to # set project options that are required for all developers. Machine or package # specific options should not be placed in this file. # This is a dictionary that specifies project-specific options for the # checkin-test script that should be u...
""" .. todo:: WRITEME """ import numpy import theano from theano import tensor from theano.compat.six.moves import reduce from pylearn2.utils import py_integer_types prod = numpy.prod def dot(x, y): """ Return the linear transformation of `y` by `x` or `x` by `y` when one or both of `x` and `y` is a...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * # Create one-input, one-output, no-fee transaction: class MempoolSpendCoinbaseTest(BitcoinTestFramework): def setup_network(self): # Just need one node for this test args = ["-checkmempool", "-debug=me...
def license_for_generated_cpp(): return """/* * Copyright (C) 2013 Google Inc. 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 a...