content
string
""" Represent an exception with a lot of information. Provides 2 useful functions: format_exc: format an exception into a complete traceback, with full debugging instruction. format_outer_frames: format the current position in the stack call. Adapted from IPython's VerboseTB. """ # Authors: Gael Varoqua...
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors import distutils.filelist import os import re import sys try: from setuptools_s...
"""Class for storing SRP password verifiers.""" from utils.cryptomath import * from utils.compat import * import mathtls from BaseDB import BaseDB class VerifierDB(BaseDB): """This class represent an in-memory or on-disk database of SRP password verifiers. A VerifierDB can be passed to a server handshake...
"""Implementation of sample attack.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from scipy.misc import imread from scipy.misc import imsave from nets import inception_v3, inception_v4, inception_resnet_v2, resnet_v2 fro...
# -*- coding: utf-8 -*- """ Created on Tue May 26 08:08:14 2015 @author: rwb27 """ import numpy as np class AttributeDict(dict): """This class extends a dictionary to have a "create" method for compatibility with h5py attrs objects.""" def create(self, name, data): self[name] = data ...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations from...
import gzip import inspect import warnings from io import BytesIO from testfixtures import LogCapture from twisted.trial import unittest from scrapy import signals from scrapy.settings import Settings from scrapy.http import Request, Response, TextResponse, XmlResponse, HtmlResponse from scrapy.spiders.init import In...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import os try: import netaddr HAS_NETADDR = True except ImportError: HAS_NETADDR = False from ansible.module_utils.f5_utils import AnsibleF5Client from ansible.module...
from sqlalchemy import Column from sqlalchemy import MetaData from sqlalchemy import Table from sqlalchemy import Text def upgrade(migrate_engine): meta = MetaData() meta.bind = migrate_engine # Add a new column extra_resources to save extra_resources info for # compute nodes compute_nodes = Tabl...
__author__ = "mworden" from mi.core.log import get_logger from mi.dataset.dataset_driver import DataSetDriver from mi.dataset.parser.glider import GliderParser class DostaAbcdjmGliderDriver: def __init__(self, source_file_path, particle_data_handler, parser_config): self._source_file_path = sou...
"""Loss operations for use in neural networks. Note: All the losses are added to the `GraphKeys.LOSSES` collection by default. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=wildcard-import from tensorflow.python.ops.losses.losses_im...
#!/usr/bin/env python """ Test for multipoll.py """ import unittest import pexpect class testMultiPoll( unittest.TestCase ): def testMultiPoll( self ): "Verify that we receive one ping per second per host" p = pexpect.spawn( 'python -m mininet.examples.multipoll' ) opts = [ "\*\*\* (h\d)...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: bigip_config short_description: Manage BIG-IP configuration...
#! /usr/bin/python # -*- coding: utf-8 -*- import sys try: from MeCab import Tagger except ImportError: pass from .. import utils __all__ = ['Mecab'] attrs = ['tags', # 품사 태그 'semantic', # 의미 부류 'has_jongsung', # 종성 유무 'read', # 읽기 'type', # 타입 ...
import os try: from dnsimple import DNSimple from dnsimple.dnsimple import DNSimpleException HAS_DNSIMPLE = True except ImportError: HAS_DNSIMPLE = False def main(): module = AnsibleModule( argument_spec = dict( account_email = dict(required=False), account_api_t...
"""Criteria to select some ServerDescriptions from a TopologyDescription.""" from pymongo.server_type import SERVER_TYPE class Selection(object): """Input or output of a server selector function.""" @classmethod def from_topology_description(cls, topology_description): known_servers = topology_d...
""" Verifies that LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled correctly. """ import TestGyp import re import subprocess import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) CHDIR = 'installname' test.run_gyp('test.gyp', chdir=CHDIR) test.build(...
try: import unittest2 as unittest except ImportError: import unittest from sheet.parser.parse_node import ParseNode from sheet.parser.fl_cell_reference_parse_node import FLCellReferenceParseNode from sheet.parser.fl_reference_parse_node import FLReferenceParseNode class FLCellReferenceParseNodeTest(unittest.T...
""" This is in many ways identical to the textrank algorithms. The only difference is that we expand the sentence graph to also include the title of the text, the topics associated with the text, and the named entitites present The output is still an importance score for each sentence in the original text but these ne...
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } import os from distutils.version import LooseVersion from ansible.module_utils.basic import AnsibleModule PACKAGE_S...
"""Utilities for the neural network modules """ # License: BSD 3 clause import numpy as np from scipy.special import expit as logistic_sigmoid def identity(X): """Simply return the input array. Parameters ---------- X : {array-like, sparse matrix}, shape (n_samples, n_features) Data, where...
import logging import threading import time from oslo_messaging._drivers.protocols.amqp import controller from oslo_messaging import exceptions from six import moves LOG = logging.getLogger(__name__) class SendTask(controller.Task): """A task that sends a message to a target, and optionally waits for a rep...
# encoding: 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): # Deleting model 'Storage' db.delete_table('easy_thumbnails_storage') def backwards(self, orm): ...
from i18n import gettext, _ import itertools, sys, os, error import extensions, revset, fileset, templatekw, templatefilters, filemerge import encoding, util, minirst import cmdutil def listexts(header, exts, indent=1): '''return a text listing of the given extensions''' rst = [] if exts: rst.appen...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import chainer import numpy as np class EmpiricalNormaliza...
# encoding: utf-8 import hashlib import logging from copy import copy from slimurl import URL from tornado.gen import coroutine, Return from tornado.httpclient import AsyncHTTPClient from tornado.ioloop import IOLoop from tornado.locks import Lock from tornado.options import options from tornado_xmlrpc.client import Se...
from __future__ import print_function import os import subprocess as subp import shutil import argparse import re import traceback import sys def is_subpath_of_set(path, pathset): part_path = '' for part in path.split(os.path.sep): part_path = os.path.join(part_path, part) if part_path in pat...
import gtk import gobject try: from gazpacho.widgets.base.base import SimpleContainerAdaptor except ImportError: pass #root_library = 'hig' class HIGContainer(gtk.Bin): __gtype_name__ = 'HIGContainer' __gproperties__ = { 'title': (str, 'Group Title', 'the group title', '', g...
""" This utility takes a JSON input that describes a CRLSet and produces a CRLSet from it. The input is taken on stdin and is a dict with the following keys: - BlockedBySPKI: An array of strings, where each string is a filename containing a PEM certificate, from which an SPKI will be extracted. - BlockedByHa...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Script to encrypt config files. Usage: scripts/encrypt_conf.py confname1 confname2 ... confnameN scripts/encrypt_conf.py credentials """ from functools import partial import click from cached_property import cached_property from cfme.utils.conf import cfme_dat...
"""Test the module ensemble classifiers.""" # Authors: Guillaume Lemaitre <<EMAIL>> # Christos Aridas # License: MIT import numpy as np from sklearn.datasets import load_iris, make_hastie_10_2 from sklearn.model_selection import (GridSearchCV, ParameterGrid, train_test_sp...
# -*- coding: utf-8 -*- from datetime import timedelta from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cms.constants import PUBLISHER_STATE_DIRTY from cms.models.managers import Ti...
#!/usr/bin/python3 DESCRIPTION = ''' Program for ptset drawing. Some examples of usage: python ptset.py -h python ptset.py --curve 9 --draw_points A,0.199,True B,0.412,True python ptset.py --curve 8 --draw_points A,-0.36,True X1,-0.26 B,0,True X2,0.26 C,0.36,True python ptset.py --curve 7 --tangent_curve python ...
""" A test harness for the logging module. Tests HTTPHandler. Copyright (C) 2001-2002 Vinay Sajip. All Rights Reserved. """ import sys, string, logging, logging.handlers def main(): import pdb host = "localhost:%d" % logging.handlers.DEFAULT_HTTP_LOGGING_PORT gh = logging.handlers.HTTPHandler(host, '/log'...
# Helper functions to do logistic regression # To use the logRegCost function needs to be minimised, use the logRegGrad method to provide derivative # import cv2 import numpy as np import scipy.io as sio import csv as csv from sklearn.preprocessing import normalize def featureNormalize(data): mu = data.mean(0) ...
import math from oslo_log import log as logging from oslo_serialization import jsonutils from nova import conf as cfg from nova.objects import fields LOG = logging.getLogger(__name__) CONF = cfg.CONF # Power VM hypervisor info # Normally, the hypervisor version is a string in the form of '8.0.0' and # converted to...
from cinderclient.v1 import client as cinder_client_v1 from cinderclient.v2 import client as cinder_client_v2 from requests_mock.contrib import fixture from testtools import matchers from nova import context from nova import exception from nova import test from nova.volume import cinder _image_metadata = { 'kern...
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
from django.conf.urls import url from django.core.urlresolvers import reverse_lazy from django.contrib.auth.views import login, logout from smartshark.views import analysis, common, collection, visualizations, remote urlpatterns = [ # Frontend url(r'^login/$', login, name='mysite_login'), url(r'^logout/$'...
from __future__ import unicode_literals import frappe, os, time def sync_statics(rebuild=False): s = sync() s.verbose = True # s.start(rebuild) # frappe.db.commit() while True: s.start(rebuild) frappe.db.commit() time.sleep(2) rebuild = False class sync(object): def __init__(self, verbose=False): sel...
import os, sys from ctypes import * up=2 def setlibpath(up): import sys path=os.path.normpath(os.path.split(os.path.realpath(__file__))[0]+'\..'*up) if path not in sys.path: sys.path.append(path) setlibpath(up) from haru import * from haru.c_func import * from haru.hpdf_errorcode im...
from django.contrib.sites.models import Site from django.template import Library, Node import speeqeweb.xmpp.muc as muc import speeqeweb.settings as settings register = Library() @register.simple_tag def current_domain(): return settings.HTTP_DOMAIN #return all active muc rooms class ActiveRoomsNode(Node): ...
"""ResNet Train/Eval module. """ import sys import time import cifar_input import numpy as np import resnet_model import tensorflow as tf FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('dataset', 'cifar10', 'cifar10 or cifar100.') tf.app.flags.DEFINE_string('mode', 'train', 'train or eval.') tf.app.flags.DEFIN...
# # iso2022_kr.py: Python Unicode Codec for ISO2022_KR # # Written by Hye-Shik Chang <<EMAIL>> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_kr') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Mul...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import platform HAVE_XENAPI = False try: import XenAPI HAVE_XENAPI = True except ImportError: pass class XenServerFacts: def __init__(self): self.codes ...
"""Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class representing message/* MIME documents.""" def __init__(self, _msg, _subtype='rfc822'): ...
# -*- coding: utf-8 -*- """ *************************************************************************** proximity.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
from boto.route53.connection import Route53Connection from boto.regioninfo import RegionInfo, get_regions class Route53RegionInfo(RegionInfo): def connect(self, **kw_params): """ Connect to this Region's endpoint. Returns an connection object pointing to the endpoint associated with this ...
# -*- 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): # Deleting model 'Coupons' db.delete_table('shoppingcart_coupons') # Adding model 'CourseRegistrati...
#!/usr/bin/env python """Interpreter and code coverage injector for use with ansible-test. The injector serves two main purposes: 1) Control the python interpreter used to run test tools and ansible code. 2) Provide optional code coverage analysis of ansible code. The injector is executed one of two ways: 1) On the...
# coding=utf-8 from __future__ import unicode_literals from . import BaseProvider import random from faker.providers.lorem import Provider as Lorem from faker.utils.decorators import slugify, slugify_domain class Provider(BaseProvider): safe_email_tlds = ('org', 'com', 'net') free_email_domains = ('gmail.co...
# Ensure we get the local copy of tornado instead of what's on the standard path import os import sys sys.path.insert(0, os.path.abspath("..")) import tornado master_doc = "index" project = "Tornado" copyright = "2011, Facebook" version = release = tornado.version extensions = [ "sphinx.ext.autodoc", "sphin...
""" Tests for DatetimeIndex methods behaving like their Timestamp counterparts """ from datetime import datetime import numpy as np import pytest from pandas._libs.tslibs import OutOfBoundsDatetime, to_offset from pandas._libs.tslibs.offsets import INVALID_FREQ_ERR_MSG import pandas as pd from pandas import Datetime...
#!/usr/bin/env python import optparse import yaml from jinja2 import Environment, FileSystemLoader from ansible.playbook import Play from ansible.playbook.block import Block from ansible.playbook.role import Role from ansible.playbook.task import Task template_file = 'playbooks_keywords.rst.j2' oblist = {} clist = ...
"""SCons.Job This module defines the Serial and Parallel classes that execute tasks to complete a build. The Jobs class provides a higher level interface to start, stop, and wait on jobs. """ # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining ...
"""Amalgate json-cpp library sources into a single source and header file. Requires Python 2.6 Example of invocation (must be invoked from json-cpp top directory): python amalgate.py """ import os import os.path import sys class AmalgamationFile: def __init__( self, top_dir ): self.top_dir = top_dir ...
# -*- coding: UTF-8 -*- from enigma import eTimer from Components.Language import language # Dict languageCode -> array of strings MAP_SEARCH = ( u"%_0", u" 1", u"abc2", u"def3", u"ghi4", u"jkl5", u"mno6", u"pqrs7", u"tuv8", u"wxyz9", ) MAP_SEARCH_UPCASE = ( U"0%_", U"1 ", U"ABC2", U"DEF3", U"GHI4", U...
import mock from oslo_log import log as logging from oslo_utils import uuidutils import testtools from webob import exc from neutron import context from neutron.db import models_v2 from neutron.extensions import external_net as external_net from neutron import manager from neutron.tests.unit.api.v2 import test_base fr...
""" recording warnings during test function execution. """ import inspect import _pytest._code import py import sys import warnings import pytest @pytest.yield_fixture def recwarn(request): """Return a WarningsRecorder instance that provides these methods: * ``pop(category=None)``: return last warning matc...
from django.conf import settings from cms.admin.forms import PageUserForm, PageUserGroupForm from cms.admin.permissionadmin import GenericCmsPermissionAdmin from cms.exceptions import NoPermissionsException from cms.models import PageUser, PageUserGroup from cms.utils.permissions import get_subordinate_users from djang...
"""Classes supporting updates to basic course settings.""" __author__ = 'Abhinav Khandelwal (<EMAIL>)' import cgi import urllib from common import schema_fields from controllers.utils import ApplicationHandler from controllers.utils import BaseRESTHandler from controllers.utils import XsrfTokenManager from models im...
"""Telnet-based shell.""" # twisted imports from twisted.protocols import telnet from twisted.internet import protocol from twisted.python import log, failure # system imports import string, copy, sys from cStringIO import StringIO class Shell(telnet.Telnet): """A Python command-line shell.""" def conn...
"""A module for the info implementation of Command.""" import cr class InfoCommand(cr.Command): """The cr info command implementation.""" def __init__(self): super(InfoCommand, self).__init__() self.help = 'Print information about the cr environment' def AddArguments(self, subparsers): parser = s...
"""Packages admin handler.""" import datetime from simian.mac import admin from simian.mac import common from simian.mac import models from simian.mac.common import auth DEFAULT_PACKAGE_LOG_FETCH_LIMIT = 25 class Packages(admin.AdminHandler): """Handler for /admin/packages.""" XSRF_PROTECT = True DATAST...
import unittest import pqkmeans import numpy import pipe class TestPQEncoder(unittest.TestCase): def data_source(self, n: int): for i in range(n): for _ in range(3): yield [i * 100] * 6 def setUp(self): self.encoder = pqkmeans.encoder.PQEncoder(num_subdim=2) d...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception try: import ldap import ldap.sasl HAS_LDAP = True exce...
import json from xml.etree import ElementTree import ansible.module_utils.junos from ansible.module_utils.basic import get_exception from ansible.module_utils.network import NetworkModule, NetworkError from ansible.module_utils.netcfg import NetworkConfig DEFAULT_COMMENT = 'configured by junos_config' def guess_...
"""This module provide widgets that did not fit in the other modules.""" from __future__ import absolute_import, unicode_literals from gettext import gettext as _ from gi.repository import GObject, Gtk from six import text_type from hamster_gtk.helpers import get_parent_window from hamster_gtk.misc.dialogs import D...
__all__ = ["projview", "newprojplot"] import numpy as np from .pixelfunc import ang2pix, npix2nside from .rotator import Rotator import matplotlib.pyplot as plt from matplotlib.projections.geo import GeoAxes from matplotlib.ticker import MultipleLocator, FormatStrFormatter, AutoMinorLocator import warnings class The...
import distutils, os from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import * __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] def config_file(kind="local"): """Get the filename of the distutils, local, global, or per-user co...
from openstackx.api import base class Tenant(base.Resource): def __repr__(self): return "<Tenant %s>" % self._info @property def id(self): return self._info['id'] @property def description(self): return self._info['description'] @property def enabled(self): ...
from __future__ import unicode_literals from django.apps import apps from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ class ContentTypeManager(models.Manager): use_in_migrations = True def __init__(...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j E Y г.' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j E Y г. G:i:s' YEAR_MONTH_FORMAT = 'F Y г.' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FO...
"""Define the menu contents, hotkeys, and event bindings. There is additional configuration information in the EditorWindow class (and subclasses): the menus are created there based on the menu_specs (class) variable, and menus not created are silently skipped in the code here. This makes it possible, for example, to...
import os import subprocess import textwrap import re BASE_DIR = os.path.join(os.path.dirname(__file__), "..") COMMAND_NAME = 'nirw-search' def patch_help_test(help_output): help_output = help_output.replace( 'usage: ' + COMMAND_NAME, 'usage::\n' '\n' ' ' + COMMAND_NAME, ...
import warnings from django.db.migrations.exceptions import ( CircularDependencyError, NodeNotFoundError, ) from django.db.migrations.graph import RECURSION_DEPTH_WARNING, MigrationGraph from django.test import SimpleTestCase from django.utils.encoding import force_text class GraphTests(SimpleTestCase): """ ...
""" Python 'unicode-internal' Codec Written by Marc-Andre Lemburg (<EMAIL>). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ import codecs ### Codec APIs class Codec(codecs.Codec): # Note: Binding these as C functions will result in the class not # converting them to methods. This is intended. ...
# -*- coding: utf-8 -*- import urlparse from openerp.http import request from openerp.osv import fields, osv class actions_server(osv.Model): """ Add website option in server actions. """ _name = 'ir.actions.server' _inherit = ['ir.actions.server'] def _compute_website_url(self, cr, uid, id, websit...
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import charade as chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1....
"""A module for the init command.""" import os import cr # The set of variables to store in the per output configuration. OUT_CONFIG_VARS = [ 'CR_VERSION', cr.Platform.SELECTOR, cr.BuildType.SELECTOR, cr.Arch.SELECTOR, 'CR_OUT_BASE', 'CR_OUT_FULL', ] class InitCommand(cr.Command): """The implementati...
""" The MIT License (MIT) Copyright (c) 2014 Jozef van Eenbergen 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,...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import os import signal import socket import sys from pants.java.nailgun_io import NailgunStreamReader from pants.java.nailgun_protocol import ChunkTyp...
referents = [] # list "object descriptor -> python object" freelist = None def store(x): "Store the object 'x' and returns a new object descriptor for it." global freelist p = freelist if p is None: p = len(referents) referents.append(x) else: freelist = referents[p] ...
#!/usr/bin/env python import subprocess, os, tempfile from ctypes import * PAGE_SIZE = 4096 class AssemblerFunction(object): def __init__(self, code, ret_type, *arg_types): # Run Nasm fd, source = tempfile.mkstemp(".S", "assembly", os.getcwd()) os.write(fd, code) os.close(fd) target = os...
# -*- coding: utf-8 -*- import fauxfactory import pytest from datetime import timedelta from cfme.optimize.bottlenecks import Bottlenecks from cfme.utils import conf from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.blockers import BZ from cfme.utils.timeutil import parsetime from cfme.ut...
import logging from django.conf import settings from django.db import models from geoserver.catalog import FailedRequestError, Catalog from geonode.base.models import ResourceBase from geonode.services.enumerations import SERVICE_TYPES, SERVICE_METHODS, GXP_PTYPES from geonode.layers.models import Layer from django.ut...
__doc__ = """External interface to the BeautifulSoup HTML parser. """ __all__ = ["fromstring", "parse", "convert_tree"] from lxml import etree, html from BeautifulSoup import \ BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableString def fromstring(data, beautifulsoup=None, makeelement=None, **bsarg...
import os import sys import unittest from compiler import GenerateSchema # If --rebase is passed to this test, this is set to True, indicating the test # output should be re-generated for each test (rather than running the tests # themselves). REBASE_MODE = False # The directory containing the input and expected out...
{ 'name': 'Cancel Journal Entries', 'version': '1.1', 'author': 'OpenERP SA', 'category': 'Accounting & Finance', 'description': """ Allows canceling accounting entries. ==================================== This module adds 'Allow Canceling Entries' field on form view of account journal. If set to ...
""" Error checking functions for GEOS ctypes prototype functions. """ import os from ctypes import c_void_p, string_at, CDLL from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOS_VERSION from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the...
try: import boto3 from botocore.exceptions import ClientError HAS_BOTO3 = True except ImportError: HAS_BOTO3 = Falsentry import traceback def main(): argument_spec = ec2_argument_spec() argument_spec.update( dict( filters=dict(default={}, type='dict') ) ) ...
from openerp.osv import osv from openerp.tools.translate import _ class analytic_plan_create_model(osv.osv_memory): _name = "analytic.plan.create.model" _description = "analytic.plan.create.model" def activate(self, cr, uid, ids, context=None): plan_obj = self.pool.get('account.analytic.plan.insta...
#!/usr/bin/python import sys, os, time, signal, random, string, subprocess from tempfile import NamedTemporaryFile from optparse import OptionParser sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'drivers', 'python'))) import rethinkdb as r client_script = os.path.join(os.path....
from __future__ import absolute_import, division, print_function import struct from cryptography import utils from cryptography.exceptions import ( AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import HMACBackend from cryptography.hazmat.backends.inter...
from config.api2_0_config import * from modules.logger import Log from on_http_api2_0 import ApiApi as api20 from on_http_api2_0 import rest from proboscis.asserts import assert_equal from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_true from proboscis.asserts import fail from probosc...
""" Labeled dice problem in Google CP Solver. From Jim Orlin 'Colored letters, labeled dice: a logic puzzle' http://jimorlin.wordpress.com/2009/02/17/colored-letters-labeled-dice-a-logic-puzzle/ ''' My daughter Jenn bough a puzzle book, and showed me a cute puzzle. There are 13 words as follows: BUOY, C...
# -*- coding: utf-8 -*- import sys import os # eventlet/gevent should not monkey patch anything. os.environ["GEVENT_NOPATCH"] = "yes" os.environ["EVENTLET_NOPATCH"] = "yes" os.environ["CELERY_LOADER"] = "default" this = os.path.dirname(os.path.abspath(__file__)) # If your extensions are in another directory, add it...
import sys from xtuml import navigate_one as one from bridgepoint import ooaofooa if len(sys.argv) < 2: print('') print(' usage: %s <path to bridgepoint model folder>' % sys.argv[0]) print('') sys.exit(1) m = ooaofooa.load_metamodel(sys.argv[1]) get_name = lambda inst: one(inst).S_DT[17]().N...
import re import logging from cattle import utils from cattle.lock import lock from cattle.utils import JsonObject log = logging.getLogger("agent") class BaseHandler(object): def __init__(self): pass def events(self): ret = [] for i in utils.events_from_methods(self): re...