content
stringlengths
4
20k
# -*- coding: utf-8 -*- """ pygments.lexers._cl_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ANSI Common Lisp builtins. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTIN_FUNCTIONS = set(( # 638 functions '<', '<=', '=', '>', '>=',...
""" Library-wide configuration variables. For now, configuration code is in openerp.tools.config. It is in mainly unprocessed form, e.g. addons_path is a string with commas-separated paths. The aim is to have code related to configuration (command line parsing, configuration file loading and saving, ...) in this modul...
import re from livestreamer.exceptions import PluginError, NoStreamsError from livestreamer.options import Options # Import base classes from a support plugin that must exist in the # same directory as this plugin. from livestreamer.plugin.api.support_plugin import justintv_common JustinTVPluginBase = justintv_commo...
from __future__ import unicode_literals import re import socket import time from netmiko.cisco_base_connection import CiscoSSHConnection from netmiko.ssh_exception import NetMikoTimeoutException class LinuxSSH(CiscoSSHConnection): def disable_paging(self, *args, **kwargs): """Linux doesn't have paging ...
"""Test classes for code snippet for modeling article.""" import pytest import keyproperty_models as models def test_models(testbed): name = 'Takashi Matsuo' contact = models.Contact(name=name) contact.put() contact = contact.key.get() assert contact.name == name # This test fails because of t...
#!/usr/bin/python import os import urllib2 import cookielib from getpass import getpass import sys username = "8858218339" passwd = "tpostuffs" message = "gfchghjbkljfcgvhjbk" path='C:\Users\Ayush894\Desktop\New Text Document.txt' def execute(path,username,passwd,message): statuspath=os.getcwd()+"\...
from __future__ import absolute_import from datetime import timedelta from django.apps import apps from django.db import models from django.utils import timezone from uuid import uuid4 from sentry.db.models import BoundedBigIntegerField, JSONField, Model def default_guid(): return uuid4().hex def default_date...
microcode = ''' def macroop ADD_R_R { add reg, reg, regm, flags=(OF,SF,ZF,AF,PF,CF) }; def macroop ADD_R_I { limm t1, imm add reg, reg, t1, flags=(OF,SF,ZF,AF,PF,CF) }; def macroop ADD_M_I { limm t2, imm ldst t1, seg, sib, disp add t1, t1, t2, flags=(OF,SF,ZF,AF,PF,CF) st t1, seg, sib, dis...
#!/usr/bin/env python # global imports import numpy as np import os # hepstore imports from hepstore.core.school import main as learn from hepstore.core.plotter import main as plot # fix a random seed np.random.seed(7) # number of events nevents = 5000 ## perform the actuall machine learning args = [ "-c", "qd...
import json from django import forms from django.test.utils import override_settings from django_webtest import WebTest from . import build_test_urls class FileInputForm(forms.Form): test_field = forms.FileField() data_field = forms.BooleanField(required=False, widget=forms.HiddenInput, ...
"""Functional tests for DepthToSpace op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tenso...
class EventException(Exception): pass class EventAddException(EventException): pass class EventRemoveException(EventException): pass class EventCallException(EventException): pass class ServerException(Exception): pass class PortAlreadyInUse(ServerException): pass class ConnectionException...
""" Tests for warning suppression features of Trial. """ from __future__ import division, absolute_import import unittest as pyunit from twisted.trial import unittest from twisted.trial.test import suppression class SuppressionMixin(object): """ Tests for the warning suppression features of L{twisted.t...
""" //Running Successfully import unittest from PIL import Image from SyntheticDataset2.ImageOperations import * class ImageMaskerTestCase(unittest.TestCase): def setUp(self): self.test_image1 = Image.open("tests/images/image1_test_image_bounder.png") self.test_image2 = Image.open("tests/images/i...
from sympy import expand, simplify from galgebra.printer import Format, xpdf from galgebra.ga import Ga g = '1 # #,' + \ '# 1 #,' + \ '# # 1' Format() ng3d = Ga('e1 e2 e3', g=g) (e1, e2, e3) = ng3d.mv() print('g_{ij} =', ng3d.g) E = e1 ^ e2 ^ e3 Esq = (E * E).scalar() print('E =', E) print('%E^{2} =', Esq) E...
""" Checks (rule) patterns associated with rows in tables, and adds an additional column to each row (in each table) which captures constraints in rule pattern. """ import dgen_core # If true, print traces of how patterns are added. # Useful to trace how patterns are generated for one (or more) tables, # depending on...
from django.shortcuts import render, get_object_or_404 import re import sys import six from six.moves import range import django.forms as forms from django.http import HttpResponseForbidden from django.contrib.auth.models import User from django.contrib import messages from crispy_forms.helper import FormHelper fro...
from __future__ import print_function, division import numpy as np from skimage import img_as_float, io, exposure, img_as_uint, color, img_as_ubyte import psyutils as pu def guess_type(image): """Make an educated guess about an image's dimensions and what they mean. Modified from skimage.color.guess_spatial_d...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} # NOQA from ansible.module_utils.azure_rm_common import AzureRMModuleBase import re try: ...
import csv import matplotlib.pyplot as plt from numpy import * import scipy.interpolate import math from pylab import * from matplotlib.ticker import MultipleLocator, FormatStrFormatter import matplotlib.patches as patches from matplotlib.path import Path import os # ---------------------------------------------------...
"""An extremely asynch approach to unzipping files. This allows you to unzip a little bit of a file at a time, which means it can integrate nicely with a reactor. """ from __future__ import generators import zipfile import os.path import binascii import zlib class ChunkingZipFile(zipfile.ZipFile): """A ZipFile...
# This file implements a class which forms an interface to the .cddb # directory that is maintained by SGI's cdman program. # # Usage is as follows: # # import readcd # r = readcd.Readcd() # c = Cddb(r.gettrackinfo()) # # Now you can use c.artist, c.title and c.track[trackno] (where trackno # starts at 1). When the CD...
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ pipe2py.lib.utils ~~~~~~~~~~~~~~~~~ Utility functions """ from __future__ import ( absolute_import, division, print_function, with_statement, unicode_literals) import sys, logging class LogFilter(logging.Filter): """Filters (lets throug...
"Test the functionality of Python classes implementing operators." import unittest from test import support testmeths = [ # Binary operations "add", "radd", "sub", "rsub", "mul", "rmul", "truediv", "rtruediv", "mod", "rmod", "divmod", "rdivmod", "pow", "rpow",...
## Dates in timeseries models from __future__ import print_function import statsmodels.api as sm import pandas as pd # ## Getting started data = sm.datasets.sunspots.load() # Right now an annual date series must be datetimes at the end of the year. dates = sm.tsa.datetools.dates_from_range('1700', length=len(dat...
from ansible.utils.debug import debug class Group: ''' a group of ansible hosts ''' #__slots__ = [ 'name', 'hosts', 'vars', 'child_groups', 'parent_groups', 'depth', '_hosts_cache' ] def __init__(self, name=None): self.depth = 0 self.name = name self.hosts = [] self.vars ...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from __future__ import with_statement import collections import glob import os import os.path import random import shutil import signal import subprocess import sys import tempfile import time DOTDOT...
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from SocketServer import ThreadingMixIn import cv2 import time class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): """Handle requests in a separate thread.""" def create_handler(video_stream): class CamHandler(BaseHTTPRequestHandler): ...
{'name': 'Check Availability after Inventories', 'version': '1.0', 'depends': ['stock', 'procurement', ], 'author': "Camptocamp,Odoo Community Association (OCA)", 'description': """ Check again availability of delivery orders after inventories ==============================================...
from django.core.exceptions import ValidationError from django.forms import MultipleChoiceField from django.test import SimpleTestCase class MultipleChoiceFieldTest(SimpleTestCase): def test_multiplechoicefield_1(self): f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two')]) with self.asser...
from __future__ import absolute_import import pytest from ansible.modules.source_control.gitlab.gitlab_hook import GitLabHook def _dummy(x): """Dummy function. Only used as a placeholder for toplevel definitions when the test is going to be skipped anyway""" return x pytestmark = [] try: from .git...
import users_ldap # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
"""SCons.Tool.pyext Tool-specific initialization for python extensions builder. AUTHORS: - David Cournapeau - Dag Sverre Seljebotn """ # # __COPYRIGHT__ # # 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 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('news', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='eventrelatedtonews', op...
from openerp.osv import fields, osv class account_partner_balance(osv.osv_memory): """ This wizard will provide the partner balance report by periods, between any two dates. """ _inherit = 'account.common.partner.report' _name = 'account.partner.balance' _description = 'Print Account Partn...
"""Cassandra indexing code using SASI.""" from __future__ import absolute_import from __future__ import print_function import itertools from cassandra import encoder as c_encoder from biggraphite import accessor as bg_accessor from biggraphite import glob_utils as bg_glob from biggraphite.drivers import cassandra_c...
# 01-01: Implement an algorithm to determine if a string has all unique # characters # Example: Funny StorY => NO # Example: Quick tall dog => YES import unittest class UniqueCharacterString: 'Checks a string for duplicate characters' def __init__(self): self.character_map = [False] * 26 retu...
import asyncio import pytest from aiohttp import ClientSession from test_helper import get_test_data from hackernews import HnApi from settings import NUM_STORIES @pytest.fixture def loop_session(): loop = asyncio.new_event_loop() session = ClientSession(loop=loop) asyncio.set_event_loop(loop) yield...
import ocl import pyocl import camvtk import time import datetime import vtk def main(filename="frame/f.png"): print ocl.revision() myscreen = camvtk.VTKScreen() myscreen.camera.SetPosition(-15, -8, 15) myscreen.camera.SetFocalPoint(5,5, 0) # axis arrows camvtk.drawArrows(m...
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1439353973.194368 _enable_loop = True _template_filename = u'/usr/local/lib/python2.7/dist-packages/nikola/data/themes/base/templates/inde...
import unittest import github class Issue142(unittest.TestCase): # https://github.com/jacquev6/PyGithub/issues/142 def testDecodeJson(self): # This test has to hit GitHub for real, because the record-replay framework looses types # and python3 does not behave like python2 for strings and bytes ...
''' Created on Aug 26, 2014 @author: moloyc ''' import sqlalchemy from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.orm import exc import util import logging import contextlib from model import Base, Device, InterfaceDefinition, LeafSetting from common import SingletonBase moduleName = 'dao' l...
"""Simple script which asks user to manually check result of bisection. Typically used as by the run-bisect-manual-test.py script. """ import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'perf')) from chrome_telemetry_build import chromium_config...
# -*- coding: utf-8 -*- """ Basic unit tests for LibraryRoot """ from mock import patch from xblock.fragment import Fragment from xblock.runtime import Runtime as VanillaRuntime from xmodule.x_module import AUTHOR_VIEW from xmodule.modulestore.tests.factories import LibraryFactory, ItemFactory from xmodule.modulestor...
import braintree from braintree.errors import Errors from braintree.credit_card_verification import CreditCardVerification class ErrorResult(object): """ An instance of this class is returned from most operations when there is a validation error. Call :func:`errors` to get the collection of errors:: ...
# -*- coding: utf-8 -*- # # SymPy documentation build configuration file, created by # sphinx-quickstart.py on Sat Mar 22 19:34:32 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 pickle...
""" Animate matching a set of literal patterns against a string. """ import sturm def main(argv): if len(argv) == 1: string = 'cats are fat' patterns = 'rat cat capsize catalog'.split() elif len(argv) == 2: print("Usage: python %s [string pattern1 pattern2...]" % argv[0]) retur...
from django.core.management.base import BaseCommand from certificates.models import certificate_status_for_student from certificates.queue import XQueueCertInterface from django.contrib.auth.models import User from optparse import make_option from django.conf import settings from xmodule.course_module import CourseDesc...
"""Tests for legendre module. """ from __future__ import division, absolute_import, print_function import numpy as np import numpy.polynomial.legendre as leg from numpy.polynomial.polynomial import polyval from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_mod...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests of the project. Each function related to the workers individual tools are tested in this suite. There is no communication. """ import mock import unittest from ADSDeploy import app from ADSDeploy.tests import test_base from ADSDeploy.models import Base fro...
# pip install pygame으로 pygame을 설치하였다. import pygame, sys # pygame.locals안의 상수들을 워낙 많이 사용해서 import를 이렇게 한다. from pygame.locals import * # pygame 초기화 pygame.init() # pygame.display.set_mode는 윈도우에 대한 pygame.Surface 객체를 반환한다. 한 쌍의 값은 각각 너비, 높이이다. # pygame.display.set_mode는 pygame.Surface 개체(Surface객체)를 반환해주고 변수에 저장한다. D...
"""Tests for the Geometric distribution.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from scipy import stats from tensorflow.contrib.distributions.python.ops import geometric from tensorflow.python.framework import constant_op from...
from RGT.XML.SVG.baseStructuralNode import BaseStructuralNode from RGT.XML.SVG.Attribs.conditionalProcessingAttributes import ConditionalProcessingAttributes from types import StringType from RGT.XML.SVG.basicSvgNode import BasicSvgNode class DefsNode(BaseStructuralNode, ConditionalProcessingAttributes): s...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect, get_object_or_404 from django.forms import ModelForm from annoying.decorators import render_to from annoying.decorators import ajax_request from annoying.functions import get_object_or_None from django.views.d...
from vismach import * import hal import math import sys # give endpoint Z values and radii # resulting cylinder is on the Z axis class HalToolCylinder(CylinderZ): def __init__(self, comp, *args): CylinderZ.__init__(self, *args) self.comp = comp def coords(self): return (45, self.comp["tool-radius"],...
from Converter import Converter from enigma import eListboxPythonStringContent from Components.Element import cached class StringList(Converter): """Turns a simple python list into a list which can be used in a listbox.""" def __init__(self, type): Converter.__init__(self, type) self.content = None def changed...
import numpy as np from system.PowerSystem import PowerSystem from system.pick_random_state import pick_random_state from auxiliary.config_iceland import mp_opt from system.combine_gen import combine_gen import itertools from optimize.genetic.evaluate_individual import evaluate_individual from auxiliary.action_map impo...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} try: import gitlab HAS_GITLAB_PACKAGE = True except: HAS_GITLAB_PACKAGE = False from ansible.module_utils.basic import * from ansible.module_utils.pycompat24 import g...
""" SDSS Stripe 82 Moving Object Catalog ------------------------------------ Figure 1.12. A multicolor scatter plot of the properties of asteroids from the SDSS Moving Object Catalog (cf. figure 1.8). The left panel shows observational markers of the chemical properties of the asteroids: two colors a* and i-z. The ri...
""" A set of simple pretty printers for gdb to make debugging Servo a bit easier. To load these, you need to add something like the following to your .gdbinit file: python import sys sys.path.insert(0, '/home/<path to git checkout>/servo/src/etc') import servo_gdb servo_gdb.register_printers(None) end """ import gdb...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import os from ansible.module_utils._text import to_text from ansible.module_utils.basic i...
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
from ._base import Config from synapse.util.stringutils import random_string_with_symbols from distutils.util import strtobool class RegistrationConfig(Config): def read_config(self, config): self.enable_registration = bool( strtobool(str(config["enable_registration"])) ) if...
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule fro...
from xml.dom import minidom def make_cpuid_h(dom) : tempstring = ""; tempstring = tempstring +'/*this file is auto generated by volk_register.py*/'; tempstring = tempstring +'\n#ifndef INCLUDED_VOLK_CPU_H'; tempstring = tempstring +'\n#define INCLUDED_VOLK_CPU_H\n\n'; tempstring = tempstring + "#in...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import from functools import partial import re import warnings from ._compat import range_type, text_type, PY2 from . import err #: Regular expression for :meth:`Cursor.executemany`. #: executemany only suports simple bulk insert. #: You can use...
""" VAE-related costs """ __authors__ = "Vincent Dumoulin" __copyright__ = "Copyright 2014, Universite de Montreal" __credits__ = ["Vincent Dumoulin"] __license__ = "3-clause BSD" __maintainer__ = "Vincent Dumoulin" __email__ = "pylearn-dev@googlegroups" from pylearn2.compat import OrderedDict from pylearn2.costs.cost...
import unittest from selenium.webdriver.common.by import By from selenium.common.exceptions import StaleElementReferenceException class StaleReferenceTests(unittest.TestCase): def testOldPage(self): self._loadSimplePage() elem = self.driver.find_element(by=By.ID, value="links") self._load...
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
# -*- coding: utf-8 -*- """ jinja2.testsuite.imports ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the import features (with includes). :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environm...
import builtins import os import select import socket import sys import unittest import errno from errno import EEXIST from test import support class SubOSError(OSError): pass class SubOSErrorWithInit(OSError): def __init__(self, message, bar): self.bar = bar super().__init__(message) class ...
import simplejson from twisted.web import http, server from twisted.python import log from zope.interface import Interface from nevow import loaders, appserver from nevow.inevow import IRequest from nevow.util import resource_filename from allmydata import blacklist from allmydata.interfaces import ExistingChildError, ...
import datetime import sys import argparse import subprocess import itertools import os import matplotlib import pylab from matplotlib.backends.backend_pdf import PdfPages from fftPerformanceTesting import * def plotGraph(dataForAllPlots, title, plottype, plotkwargs, xaxislabel, yaxislabel): """ display a pretty g...
from django.contrib.auth.models import AnonymousUser, User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.template import Context, Template, TemplateSyntaxError from django.test import TestCase, modify_settings, override_settings from .settings import FLAT...
""" ForkedFunc provides a way to run a function in a forked process and get at its return value, stdout and stderr output as well as signals and exitstatusus. """ import py import os import sys import marshal def get_unbuffered_io(fd, filename): f = open(str(filename), "w") if fd != f.fileno(): ...
"""Test *Flask-SSO* integration.""" from __future__ import absolute_import import sys pyv = sys.version_info if pyv[0] == 2 and pyv[1] < 7: import unittest2 as unittest else: import unittest from contextlib import contextmanager from flask import request_started, request from flask_login import current_user ...
""" Module for creating Three.js geometry JSON nodes. """ import os from .. import constants, logger from . import base_classes, io, api FORMAT_VERSION = 3 class Geometry(base_classes.BaseNode): """Class that wraps a single mesh/geometry node.""" def __init__(self, node, parent=None): logger.debug(...
"""Client side of the conductor RPC API.""" from oslo_config import cfg import oslo_messaging as messaging from oslo_serialization import jsonutils from oslo_versionedobjects import base as ovo_base from nova.objects import base as objects_base from nova import rpc CONF = cfg.CONF rpcapi_cap_opt = cfg.StrOpt('condu...
""" The shellutils module contains helper functions useful for interacting with the operating system shell. The main API functions are: - run_shell_command() """ import os import fcntl import tempfile import time import signal import six import select from itertools import chain from six import StringIO import sub...
import bisect import rope.base.simplify def get_name_at(resource, offset): source_code = resource.read() word_finder = Worder(source_code) return word_finder.get_word_at(offset) class Worder(object): """A class for finding boundaries of words and expressions Note that in these methods, offset ...
#!/usr/bin/python import Adafruit_BBIO.GPIO as GPIO from Adafruit_I2C import Adafruit_I2C import time from sys import argv delay = 0.75 pause = 0.02 arg = False if len(argv)>1: file, arg = argv if arg=='-c': arg = True # i2cClock 19 # i2cData 20 # spiClock 21 # slaveSelect 22 # slaveDataOut 23 # reset? 24 spiC...
""" Dependency-Graph representation of Pipeline API terms. """ from networkx import ( DiGraph, topological_sort, ) from six import iteritems, itervalues from zipline.utils.memoize import lazyval from zipline.pipeline.visualize import display_graph from .term import LoadableTerm class CyclicDependency(Excepti...
""" Third Party Auth REST API views """ from django.contrib.auth.models import User from django.db.models import Q from django.http import Http404 from rest_framework.generics import ListAPIView from rest_framework_oauth.authentication import OAuth2Authentication from social.apps.django_app.default.models import UserSo...
import math import m5 from m5.objects import * from m5.defines import buildEnv from Ruby import create_topology # # Note: the L1 Cache latency is only used by the sequencer on fast path hits # class L1Cache(RubyCache): latency = 2 # # Note: the L2 Cache latency is not currently used # class L2Cache(RubyCache): ...
from oslo_utils import uuidutils import webob from nova.api.openstack.compute.contrib import admin_actions as \ admin_actions_v2 from nova.api.openstack.compute.plugins.v3 import admin_actions as \ admin_actions_v21 from nova.compute import vm_states from nova import exception from nova import objects from nov...
from ctypes import * import unittest class SimpleTestCase(unittest.TestCase): def test_cint(self): x = c_int() self.assertEquals(x._objects, None) x.value = 42 self.assertEquals(x._objects, None) x = c_int(99) self.assertEquals(x._objects, None) def test_ccharp(...
import copy import json from django import forms from django import http from django import shortcuts from django.views import generic import six from horizon import exceptions from horizon.forms import views as hz_views from horizon.forms.views import ADD_TO_FIELD_HEADER # noqa from horizon import messages class...
# -*- coding: utf-8 -*- """ pygments.styles.borland ~~~~~~~~~~~~~~~~~~~~~~~ Style similar to the style used in the Borland IDEs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token impo...
from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.comptool import TestManager, TestInstance, RejectResult from test_framework.blocktools import * import time from test_framework.key import CECKey from test_framework.script import CScript, SignatureHa...
import os import struct import gzip import tarfile import cStringIO import numpy as np import cv2 import caffe from paddle.proto.ParameterConfig_pb2 import ParameterConfig from paddle.trainer_config_helpers.default_decorators import wrap_name_default class ModelConverter(object): def __init__(self, caffe_model_fi...
import json import logging from .utils import LogCapture from imgbased.utils import bcolors from imgbased.plugins.core import Layout log = logging.getLogger() class Initialize(object): """Wraps rolling back imgbased layers. Pretty trivial """ results = dict() def __init__(self, app, machine, sourc...
# -*- coding:utf-8 -*- """ 新闻事件数据接口 Created on 2015/02/07 @author: Jimmy Liu @group : waditu @contact: <EMAIL> """ from tushare.stock import cons as ct from tushare.stock import news_vars as nv import pandas as pd from datetime import datetime import lxml.html from lxml import etree import re import json try: fr...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging from flask import jsonify, request from math import ceil from sqlalchemy.orm.exc import NoResultFound from flexget.api import api, APIResource from flexget...
from __future__ import unicode_literals import frappe from frappe.utils import flt def execute(filters=None): columns = get_columns(filters) consumed_details = get_consumed_details(filters) supplier_details = get_suppliers_details(filters) material_transfer_vouchers = get_material_transfer_vouchers() data = [] ...
# -*- coding: utf-8 -*- from support import model, assert_equal, assert_in, assert_true # flake8: noqa @given(u'I change level for invoice "{invoice_name}" to "{level_name}" of policy "{policy_name}"') def impl(ctx, invoice_name, level_name, policy_name): invoice = model('account.invoice').get([('number', '=', invo...
import os import re import sys import unittest try: import StringIO as io except ImportError: import io try: u = unicode except NameError: u = str class TestExamples(unittest.TestCase): maxDiff = None # those are set by create_test_class filename = None expected_output = None d...
# -*- coding: utf-8 -*- import os from django.http import HttpResponse, HttpResponseRedirect from django.http import HttpResponseBadRequest from django.shortcuts import render, redirect from django.template import RequestContext from django.conf import settings from django.core.mail import send_mail from django.core.va...
from CommonServerPython import * import traceback from typing import Dict, Union, Any def set_arguments_for_widget_view(indicator_data: Dict[str, Any]) -> Union[Dict[str, str], str]: """ Prepare argument for commands or message to set custom layout of indicator """ indicator_type = indicator_data...
__author__ = 'janomar' import logging from airflow.hooks.jdbc_hook import JdbcHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class JdbcOperator(BaseOperator): """ Executes sql code in a database using jdbc driver. Requires jaydebeapi. :param jdbc_u...
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.db import router from django.template.response impo...