content
stringlengths
4
20k
from openerp.osv import osv, fields class sale_order(osv.Model): _inherit = 'sale.order' # make the real method inheritable _payment_block_proxy = lambda self, *a, **kw: self._portal_payment_block(*a, **kw) _columns = { 'portal_payment_options': fields.function(_payment_block_proxy, type="ht...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import os.path import xml.dom.minidom import argparse class Config(): def __add_server(self, parent_node, settings, server_name): try: os.environ["TRAVIS_SECURE_ENV_VARS"] except KeyError: print "no secur...
''' Audio Gstplayer =============== .. versionadded:: 1.8.0 Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer` This player is the preferred player, using Gstreamer 1.0, working on both Python 2 and 3. ''' from kivy.lib.gstplayer import GstPlayer, get_gst_version from kivy.core.audio impor...
from os import path from django.core.management.base import BaseCommand, CommandError from django.core.files.storage import default_storage from django.conf import settings from apps.projects.models import ProjectImage class Command(BaseCommand): help = 'Deletes not used project images.' base_dir = 'project' ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from unittest import skipIf from django.db import models from django.test import TestCase from django.test.utils import isolate_apps from django.utils import six from .models import Article, InternationalArticle class SimpleTests(TestC...
{ 'name': 'Blogs', 'category': 'Website', 'website': 'https://www.odoo.com/page/blog-engine', 'summary': 'News, Blogs, Announces, Discussions', 'version': '1.0', 'description': """ OpenERP Blog ============ """, 'author': 'OpenERP SA', 'depends': ['knowledge', 'website_mail', 'w...
import re to_canonical = { 'BOND': ['bond'], 'ANGLE': ['angle'], 'UB': ['angle','urey_bradley'], 'DIHED': ['proper'], 'IMP': ['improper'], 'CMAP': ['cmap'], 'HBOND': ['h-bond'], 'VDWAALS': ['vdw_total'], '1-4 VDW': ['vdw_14'], 'EEL': ['coulomb_total'], '1-4 EEL': ['coul...
""" Contains model unit tests. """ from django.test import TestCase from wagtail.wagtailadmin.edit_handlers import ObjectList from ..models import ( EmailLink, ExternalLink, Link ) class TestLink(TestCase): def test_edit_handler(self): self.assertTrue( isinstance(Link.edit_handle...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, ExtractorError, ) class EscapistIE(InfoExtractor): _VALID_URL = r'^https?://?(www\.)?escapistmagazine\.com/videos/view/(?P<showname>[^/]+)/(?P<id>[0-9]+)-' _TEST = { ...
import numpy as np from numpy.testing import assert_array_equal try: from nose.tools import assert_is except ImportError: from landlab.testing.tools import assert_is from landlab import RasterModelGrid import landlab.grid.mappers as maps class TestLinkEndsToLink(): def test_max(self): rmg = Rast...
"""Generic interface to all dbm clones. Use import dbm d = dbm.open(file, 'w', 0o666) The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the type of database being opened (determined by the whichdb function) in the case of an existing dbm. If the dbm does not exist and the cr...
# coding=utf-8 """Disability related field groups. """ from safe.definitions.fields import ( disabled_ratio_field, disabled_count_field, disabled_displaced_count_field) from safe.utilities.i18n import tr __copyright__ = "Copyright 2017, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "<EMA...
# -*- coding: utf-8 -*- import collections import csv import sys import types from pymongo import MongoClient if __name__ == '__main__': prefix = sys.argv[1] db = MongoClient().aliexpress store_coll = db['{}store'.format(prefix)] product_coll = db['{}product'.format(prefix)] order_coll = db['{...
from sympy import Symbol, Function, exp, sqrt, Rational, I, cos, tan from sympy.utilities.pytest import XFAIL def test_add_eval(): a = Symbol("a") b = Symbol("b") c = Rational(1) p = Rational(5) assert a*b + c + p == a*b + 6 assert c + a + p == a + 6 assert c + a - p == a + (-4) assert...
# -*- coding: utf-8 -*- """ pygments.lexers.nimrod ~~~~~~~~~~~~~~~~~~~~~~ Lexer for the Nim language (formerly known as Nimrod). :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule try: from ansible.module_utils.network.avi.avi import ( avi_common_argument_spec, HAS_AVI, avi_ansible_api) except ...
from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from dateutil import parser import time from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DF class hr_evaluation_plan(osv.Model): _name = "...
from openerp import models, api class AssignManualQuants(models.TransientModel): _inherit = 'assign.manual.quants' @api.model def default_get(self, var_fields): move = self.env['stock.move'].browse(self.env.context['active_id']) if (move.raw_material_production_id and move...
# coding=utf-8 # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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 la...
""" .. dialect:: mysql+mysqldb :name: mysqlclient (maintained fork of MySQL-Python) :dbapi: mysqldb :connectstring: mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> :url: https://pypi.org/project/mysqlclient/ Driver Status ------------- The mysqlclient DBAPI is a maintained fork of the `MyS...
import random, logging from django.db.models import ForeignKey, ManyToManyField, OneToOneField from django_seed.exceptions import SeederException from django_seed.guessers import NameGuesser, FieldTypeGuesser from django.db.utils import IntegrityError from django.db import transaction class ModelSeeder(object): ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') fixture_data = {} def load_fixture(name): path = os....
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt from erpnext.accounts.utils import get_fiscal_year from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category \ import get_advance_vouchers, get_debit_note_amount def execute(filters=None): va...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'community'} import json try: import boto import boto.iam import boto.ec2 HAS_BOTO = True except ImportError: HAS_BOTO = False from ansible.module_utils.basic imp...
from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.gepetto import Viewer import stair_bauzil_hrp2_path as tp packageName = "hrp2_14_description" meshPackageName = "hrp2_14_description" rootJointType = "freeflyer" ## # Information to retrieve urd...
from __future__ import absolute_import import sys import time from django.conf import settings from django.db import transaction, connection, router from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature) fr...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: vmware_cluster_vsan short_description: Manages virtual storage area network (vSAN) con...
import inspect from copy import copy from django.conf import settings from django.utils import timezone from django.utils.functional import cached_property from django.utils.six.moves import range from .query_utils import QueryWrapper class RegisterLookupMixin(object): def _get_lookup(self, lookup_name): ...
#!/usr/bin/env python import tensorflow as tf import numpy as np trX = np.linspace(-1, 1, 101) trY = 2 * trX + np.random.randn(*trX.shape) * 0.33 # create a y value which is approximately linear but with some random noise X = tf.placeholder("float") # create symbolic variables Y = tf.placeholder("float") def model...
###################################################################### # This file should be kept compatible with Python 2.3, see PEP 291. # ###################################################################### import sys from ctypes import * _array_type = type(Array) def _other_endian(typ): """Return the type ...
"""Tests for bundle_shim.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import tensorflow as tf from tensorflow.contrib.session_bundle import bundle_shim from tensorflow.contrib.session_bundle import constants from tensorflow.contrib....
#!/usr/bin/env python """Creates the pin file for the nRF5.""" from __future__ import print_function import argparse import sys import csv SUPPORTED_FN = {"UART": ["RX", "TX", "CTS", "RTS"]} def parse_pin(name_str): """Parses a string and returns a pin-num.""" if len(name_str) < 1: raise ValueError...
"""distutils.command.register Implements the Distutils 'register' command (register with the repository). """ # created 2002/10/21, Richard Jones __revision__ = "$Id$" import urllib2 import getpass import urlparse from warnings import warn from distutils.core import PyPIRCCommand from distutils import log class r...
# -*- coding: utf-8 -*- from distutils.version import LooseVersion import sys from tempfile import mkdtemp import django gettext = lambda s: s HELPER_SETTINGS = { 'INSTALLED_APPS': [ 'djangocms_picture', 'djangocms_link', ], 'LANGUAGE_CODE': 'en', 'LANGUAGES': ( ('en', gettext(...
"""Tests for wheel binary packages and .dist-info.""" import os import pytest from mock import patch, Mock from pip._vendor import pkg_resources from pip import pep425tags, wheel from pip.exceptions import InvalidWheelFilename, UnsupportedWheel from pip.utils import unpack_file def test_get_entrypoints(tmpdir): ...
#!/bin/bash # -*- codign:utf-8 -*- # baseTools.common.common_Tools # Coded by Richard Polk, Jr # #---------------------------------------------------- #import sys #print __file__ + '\n' #print sys.argv #raw_input("Hit return to continue.") print ' |' + __name__ + '| ---' impLst = ["from baseTools.common...
""" Module for managing a sensor via KNX. It provides functionality for * reading the current state from KNX bus. * watching for state updates from KNX bus. """ from __future__ import annotations from typing import TYPE_CHECKING, Any, Iterator from xknx.remote_value import ( GroupAddressesType, RemoteValue,...
from __future__ import print_function import argparse def compute_mask(cpu): """ Given a CPU number, return a bitmask that can be used in /proc/irq to set the processor affinity for an interrupt. """ return 1<<cpu def write_irq_smp_affinity(irq, mask): """ Write the given process affin...
""" Boolean geometry extrusion. """ from __future__ import absolute_import from fabmetheus_utilities.geometry.creation import solid from fabmetheus_utilities.geometry.geometry_utilities.evaluate_elements import setting from fabmetheus_utilities.geometry.geometry_utilities import evaluate from fabmetheus_utilities.ge...
#!/usr/bin/python #Serendipity Brute Force (serendipity_admin.php) POC #Dork: "Powered by Serendipity" inurl:serendipity_admin.php #http://www.darkc0de.com #d3hydr8[at]gmail[dot]com import urllib2, sys, re, urllib print "\n d3hydr8[at]gmail[dot]com SerenBF v1.0" print "-------------------------------------------...
'''SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested wi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import unittest import re from libs.mock import * from runner.sensei import Sensei from runner.writeln_decorator import WritelnDecorator from runner.mockable_test_result import MockableTestResult from runner import path_to_enlightenment class AboutParrots: ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import re from ansible.errors import AnsibleConnectionFailure from ansible.module_utils._text import to_text, to_bytes from ansible.plugins.terminal import TerminalBase class TerminalModule(TerminalBase): termin...
from pyasm.security import * from pyasm.prod.biz import * from loader import * import unittest class TestHandler: def handle_node(my, name, node): if name == "special": print "special" return True class LoaderTest(unittest.TestCase): def setUp(my): batch = Batch...
from datetime import datetime, timedelta from operator import attrgetter # ============= enthought library imports ======================= from apptools.preferences.preference_binding import bind_preference from traits.api import Button, Instance, Str, Property from pychron.core.helpers.isotope_utils import sort_isot...
from collections import namedtuple from MySQLdb.constants import FIELD_TYPE from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.utils.datastructures import OrderedSet from django.utils.encoding import force_text FieldInfo = namedtuple('FieldInfo', Fi...
""" Functions for working with "safe strings": strings that can be displayed safely without further escaping in HTML. Marking something as a "safe string" means that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ f...
from xml4h import nodes, exceptions class XmlImplAdapter(object): """ Base class that defines how *xml4h* interacts with an underlying XML library that the adaptor "wraps" to provide additional (or at least different) functionality. This class should be treated as an abstract class. It provides s...
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen, ConfigList from Components.ActionMap import ActionMap from Components.Sources.StaticText import StaticText from Components.config import config, ConfigSubsection, ConfigBoolean, getConfigListEntry, ConfigSelection, ConfigYesNo, Config...
'''hooks for sending email push notifications This extension implements hooks to send email notifications when changesets are sent from or received by the local repository. First, enable the extension as explained in :hg:`help extensions`, and register the hook you want to run. ``incoming`` and ``changegroup`` hooks ...
import copy import pickle from datetime import datetime, timedelta from functools import partial from typing import TYPE_CHECKING, List, Iterable, Callable, Optional from loguru import logger from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Unicode, select from sqlalchemy.orm import relation from ...
from __future__ import division import math import os import sys import matplotlib from matplotlib import verbose from matplotlib.cbook import is_string_like, onetrue from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \ FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors from mat...
import unittest from mock import call from mock import MagicMock from airflow.contrib.hooks.gcp_dataflow_hook import DataFlowHook from airflow.contrib.hooks.gcp_dataflow_hook import _Dataflow try: from unittest import mock except ImportError: try: import mock except ImportError: mock = Non...
import abc from oslo_config import cfg from oslo_utils import importutils import six interface_map = { 'vsctl': 'neutron.agent.ovsdb.impl_vsctl.OvsdbVsctl', 'native': 'neutron.agent.ovsdb.impl_idl.OvsdbIdl', } OPTS = [ cfg.StrOpt('ovsdb_interface', choices=interface_map.keys(), ...
import github.GithubObject import github.GitAuthor class GitRelease(github.GithubObject.CompletableGithubObject): """ This class represents GitRelease as returned for example by https://developer.github.com/v3/repos/releases """ @property def body(self): """ :type: string ...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import json from powerline.lib.url import urllib_read, urllib_urlencode from powerline.lib.threaded import KwThreadedSegment from powerline.segments import with_docstring # XXX Warning: module name mus...
import os import sys import livestatus try: omd_root = os.getenv("OMD_ROOT") socket_path = "unix:" + omd_root + "/tmp/run/live" except: sys.stderr.write("This example is indented to run in an OMD site\n") sys.stderr.write("Please change socket_path in this example, if you are\n") sys.stderr.write("...
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Value from django.db.models.fields import FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance', ] ...
__author__ = 'bromix' import unittest from resources.lib import kodion from resources.lib.youtube.client import YouTube from resources.lib.youtube.helper.video_info import VideoInfo class TestClient(unittest.TestCase): TEST_ACCESS_TOKEN = '' def test_calc_next_page_token(self): """ client =...
# 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): # Adding field 'Project.skip' db.add_column('projects_project', 'skip', self.gf('django.db.models.fields.B...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'certified'} try: import boto.exception except ImportError: pass # Taken care of by ec2...
import types import urllib import locale import datetime import codecs from decimal import Decimal from django.utils.functional import Promise class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj UnicodeDecodeError.__init__(self, *args) ...
import arrow from OnePy.constants import EVENT from OnePy.sys_module.components.exceptions import (BacktestFinished, BlowUpError) from OnePy.sys_module.metabase_env import OnePyEnvBase from OnePy.sys_module.models.base_bar import BarBase from OnePy.sys_module.models....
data = ( 'bbweok', # 0x00 'bbweot', # 0x01 'bbweop', # 0x02 'bbweoh', # 0x03 'bbwe', # 0x04 'bbweg', # 0x05 'bbwegg', # 0x06 'bbwegs', # 0x07 'bbwen', # 0x08 'bbwenj', # 0x09 'bbwenh', # 0x0a 'bbwed', # 0x0b 'bbwel', # 0x0c 'bbwelg', # 0x0d 'bbwelm', # 0x0e 'bbwelb', # 0x...
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 import numpy as np import pandas as pd import pandas.util.testing as tm class TestIndexingCallable(object): def test_frame_loc_ix_callable(self): # GH 11485 df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': list('aabb'), ...
"""Various types of useful iterators and generators.""" __all__ = [ 'body_line_iterator', 'typed_subpart_iterator', 'walk', # Do not include _structure() since it's part of the debugging API. ] import sys from cStringIO import StringIO # This function will become a method of the Message class ...
from botocore.compat import six class DocStringParser(six.moves.html_parser.HTMLParser): """ A simple HTML parser. Focused on converting the subset of HTML that appears in the documentation strings of the JSON models into simple ReST format. """ def __init__(self, doc): self.tree = N...
from lib.common import log def compare_version(version_installed, versionlist): # Create seperate version lists versionlist_stable = versionlist['releases']['stable'] versionlist_rc = versionlist['releases']['releasecandidate'] versionlist_beta = versionlist['releases']['beta'] versionlist_alpha = ...
""" Run and manage servers for local development. """ from __future__ import print_function import sys import argparse from paver.easy import * from .utils.cmd import django_cmd from .utils.process import run_process, run_multi_processes DEFAULT_PORT = {"lms": 8000, "studio": 8001} DEFAULT_SETTINGS = 'devstack' def...
""" LMS Course Home page object """ from collections import OrderedDict from bok_choy.page_object import PageObject from bok_choy.promise import BrokenPromise from six import text_type from .bookmarks import BookmarksPage from .course_page import CoursePage from .courseware import CoursewarePage from .staff_view imp...
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, migrations from django.db.migrations.loader import AmbiguityError, MigrationLoader from django.db.migrations.migration import SwappableTuple from django.db.migrations.o...
from . import account_journal
"""A fast but lossy, totally generic object formatter.""" import types EASY_TYPES = (type(None), int, long, float, bool) META_TYPES = (type, types.ClassType) STRING_TYPES = (str, unicode) CONTAINER_TYPES = {tuple: ('(', ')'), list: ('[', ']'), dict: ('{', '}'), ...
import json from django.http import Http404, HttpResponse from django.utils.translation import ugettext as _ from .analysis import analysis_manager def deputies_time_distribution_json(request): data = analysis_manager.get_analysis('deputies_time_distribution') time_series = {'values': [], 'key': _('time in...
""" Account Chart Update Wizard """ from . import model from . import wizard
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import logging from oauthlib.common import Request from oauthlib.oauth2.rfc6...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.http import HttpResponse from rapidsms.webui.utils import render_to_response from django.views.decorators.cache import cache_page from django.contrib.auth.views import login as django_login from django.contrib.auth.views import logout as django_logout from...
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'TwitterAccount' db.delete_table('twitter_twitteraccount') # Deleting model 'TwitterApp' db.delete_table('twitter_twi...
"""WebBasket User Settings""" from invenio.base.i18n import _ from invenio.ext.template import render_template_to_string from flask_login import current_user from invenio.modules.dashboard.settings import Settings, UserSettingsStorage from invenio.legacy.webbasket.db_layer import get_all_personal_baskets_names class...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule try: from ansible.module_utils.network.avi.avi import ( avi_common_argument_spec, HAS_AVI, avi_ansible_api) except ...
import uuid import pytest from integration_tests.tests import utils from integration_tests import AgentlessTestCase pytestmark = pytest.mark.group_deployments @pytest.mark.usefixtures('cloudmock_plugin') class DeploymentsLabelsTest(AgentlessTestCase): def test_deployment_update_with_labels(self): deploy...
import struct import array range = xrange class DBCLoc: def __init__(self): self.Languages = [] for i in range(16): self.Languages.append("\0") self.LocMask = 0 def unpack(self,f,sDict): self.Languages = [] for i in range(16): t, = ReadInt(f) print i print sDict[t] self.Languages.append(sDi...
"""Module providing a factory for instantiating a CLA classifier.""" from nupic.algorithms.CLAClassifier import CLAClassifier from nupic.algorithms.cla_classifier_diff import CLAClassifierDiff from nupic.bindings.algorithms import FastCLAClassifier from nupic.support.configuration import Configuration class CLAClas...
import json from social.p3 import urlencode from social.tests.backends.oauth import OAuth2Test class StackoverflowOAuth2Test(OAuth2Test): backend_path = 'social.backends.stackoverflow.StackoverflowOAuth2' user_data_url = 'https://api.stackexchange.com/2.1/me' expected_username = 'foobar' access_token...
from __future__ import absolute_import import struct from mod_pywebsocket import common from mod_pywebsocket import stream def web_socket_do_extra_handshake(request): pass def web_socket_transfer_data(request): while True: line = request.ws_stream.receive_message() if line is None: ...
from __future__ import unicode_literals import mimetypes import posixpath try: from urllib.parse import quote except ImportError: from urllib import quote from django.utils import importlib from django.utils.encoding import smart_str from pipeline.conf import settings def to_class(class_str): if not c...
""" Key manager API """ import abc import six @six.add_metaclass(abc.ABCMeta) class KeyManager(object): """Base Key Manager Interface A Key Manager is responsible for managing encryption keys for volumes. A Key Manager is responsible for creating, reading, and deleting keys. """ @abc.abstractm...
from sqlalchemy.orm import exc from neutron.db import api as db from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils from neutron.plugins.ml2.drivers.cisco.nexus import constants as const from neutron.plugins.ml2.drivers.cisco.nexus import exceptions as c_exc from neutron....
"""Template tags used to sort a queryset. """ from django import template from django.http import Http404 from django.conf import settings register = template.Library() DEFAULT_SORT_UP = getattr(settings, 'DEFAULT_SORT_UP' , '&uarr;') DEFAULT_SORT_DOWN = getattr(settings, 'DEFAULT_SORT_DOWN' , '&darr;') INVALID_FIEL...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def...
""" Setup script for PyPI """ import os from setuptools import setup from ConfigParser import SafeConfigParser settings = SafeConfigParser() settings.read(os.path.realpath('automated_ebs_snapshots/settings.conf')) setup( name='automated-ebs-snapshots', version=settings.get('general', 'version'), license=...
#!/usr/bin/python # coding=utf-8 ########################################################################## from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from postfix import Postfi...
import time from datetime import date, datetime, timedelta from openerp.osv import fields, osv from openerp.tools import config, float_compare from openerp.tools.translate import _ class hr_payslip(osv.osv): ''' Pay Slip ''' _inherit = 'hr.payslip' _description = 'Pay Slip' _columns = { ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections from ansible.errors import AnsibleParserError from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable try: import os_client_config import shade import shade.inventory ...
import test import os from os.path import join, split def IsNumber(string): try: float(string) return True except ValueError: return False class BenchmarkTestCase(test.TestCase): def __init__(self, path, context, mode): super(BenchmarkTestCase, self).__init__(context, split(path), mode) se...
import urllib import urllib2 import xbmc import xbmcplugin import xbmcaddon import xbmcgui import sys import re import zlib, json from bs4 import BeautifulSoup addon = xbmcaddon.Addon('plugin.video.123movies') addon_version = addon.getAddonInfo('version') image_path = addon.getAddonInfo('path') + '/resources/images'...
from __future__ import print_function import copy import traceback import os import sys import time import subprocess from capstone import * from capstone.x86 import * from flags import flags flags_maks = { "CF": 0x00001, "PF": 0x00004, "AF": 0x00010, "ZF": 0x00040, "SF": 0x00080, "DF": 0x00400...
import pyboard import os def load_board_script(fw_version): with open(os.path.dirname(os.path.realpath(__file__)) + '/wipy_qa_test_board_script.py', 'rb') as input: remote_code = input.read() remote_code = remote_code.replace("{FW_VERSION}", fw_version) return remote_code def run_program_scrip...
from unittest import TestCase import mock from nose.tools import eq_, timed from minio import Minio from minio.api import _DEFAULT_USER_AGENT from .minio_mocks import MockConnection, MockResponse class ListObjectsV1Test(TestCase): @mock.patch('urllib3.PoolManager') def test_empty_list_objects_works(self, m...
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...