content string |
|---|
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.tools.safe_eval import safe_eval as eval
class crm_lead(osv.osv):
_inherit = 'crm.lead'
def get_interested_action(self, cr, uid, interested, context=None):
try:
model, action_id = self.pool.get('ir.model.data')... |
"""1D quantum particle in a box."""
from __future__ import print_function, division
from sympy import Symbol, pi, sqrt, sin, Interval, S
from sympy.physics.quantum.operator import HermitianOperator
from sympy.physics.quantum.state import Ket, Bra
from sympy.physics.quantum.constants import hbar
from sympy.functions.... |
#!/usr/bin/python
import dbus
import sys, os
import time
WPAS_DBUS_SERVICE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_INTERFACE = "fi.epitest.hostap.WPASupplicant"
WPAS_DBUS_OPATH = "/fi/epitest/hostap/WPASupplicant"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.epitest.hostap.WPASupplicant.Interface"
WPAS_DBUS_INTERFACES... |
"""Wrapper object for the file system / source tree."""
import codecs
import errno
import exceptions
import glob
import hashlib
import os
import shutil
import sys
import tempfile
import time
class FileSystem(object):
"""FileSystem interface for webkitpy.
Unless otherwise noted, all paths are allowed to be ei... |
import urllib
from devserver.modules import DevServerModule
class SessionInfoModule(DevServerModule):
"""
Displays information about the currently authenticated user and session.
"""
logger_name = 'session'
def process_request(self, request):
self.has_session = bool(getattr(request, 'se... |
"""Class representing a TLS session."""
from utils.compat import *
from mathtls import *
from constants import *
class Session:
"""
This class represents a TLS session.
TLS distinguishes between connections and sessions. A new
handshake creates both a connection and a session. Data is
transmitt... |
from __future__ import unicode_literals
import logging
import os
from django.utils.translation import ugettext_lazy as _
import paramiko
from reviewboard.ssh.errors import MakeSSHDirError, UnsupportedSSHKeyError
class SSHStorage(object):
def __init__(self, namespace=None):
self.namespace = namespace
... |
import xml.sax
from Tools.Directories import crawlDirectory, resolveFilename, SCOPE_CONFIG, SCOPE_SKIN, copyfile, copytree
from Components.NimManager import nimmanager
from Components.Ipkg import IpkgComponent
from Components.config import config, configfile
from Tools.HardwareInfo import HardwareInfo
from enigma impor... |
class AssertStateVariable():
""" Abstract asserted state variable. """
def __init__(self, parent, state):
self.parent = parent
self.state = state
def variable_name(self):
return '{}.{}'.format(self.parent.prefix, self.state)
def variable(self, solver):
return solver.ge... |
from django.utils.translation import ugettext_lazy as _
import horizon
class Tenants(horizon.Panel):
name = _("Projects")
slug = 'projects'
policy_rules = (("identity", "identity:list_projects"),
("identity", "identity:list_user_projects")) |
'''
Test mixed layer, projections and operators.
'''
from paddle.trainer_config_helpers import *
settings(batch_size=1000, learning_rate=1e-4)
din = data_layer(name='test', size=100)
din = embedding_layer(input=din, size=256)
with mixed_layer(size=100) as m1:
m1 += full_matrix_projection(input=din)
with mixed_... |
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
from __future__ import absolute_import
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from nt... |
"""
_compat module (imdb package).
This module provides compatibility functions used by the imdb package
to deal with unusual environments.
Copyright 2008-2010 Davide Alberani <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
# -*- coding: utf-8 -*-
"""
simplewiki.actions
~~~~~~~~~~~~~~~~~~
The per page actions. The actions are defined in the URL with the
`action` parameter and directly dispatched to the functions in this
module. In the module the actions are prefixed with 'on_', so be
careful not to name any othe... |
"""Shared utilities for writing scripts for Google Test/Mock."""
__author__ = '<EMAIL> (Zhanyong Wan)'
import os
import re
# Matches the line from 'svn info .' output that describes what SVN
# path the current local directory corresponds to. For example, in
# a googletest SVN workspace's trunk/test directory, the... |
from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
SubmitField
from wtforms.validators import Required, Length, Email, Regexp
from wtforms import ValidationError
from ..models import Role, User
class NameForm(Form):
name = StringField('What is your name?... |
"""
Serialize data to/from JSON
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
import datetime
import decimal
import json
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSerializer
from django.... |
from protocol import *
from dispatcher import PlugIn
import base64
class IBB(PlugIn):
def __init__(self):
PlugIn.__init__(self)
self.DBG_LINE='ibb'
self._exported_methods=[self.OpenStream]
self._streams={}
self._ampnode=Node(NS_AMP+' amp',payload=[Node('rule',{'condition':'d... |
from tools.load import LoadMatrix
from sg import sg
lm=LoadMatrix()
traindna=lm.load_dna('../data/fm_train_dna.dat')
testdna=lm.load_dna('../data/fm_test_dna.dat')
trainlabel=lm.load_labels('../data/label_train_dna.dat')
parameter_list=[[traindna,testdna,trainlabel,10,2,True,True,3,0,'n'],
[traindna,testdna,trainlab... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import socket
from ansible.module_utils.six import StringIO
from ansible.module_utils.six.moves.http_cookiejar import Cookie
from ansible.module_utils.six.moves.http_client import HTTPMessage
from ansible.module_utils.urls import fe... |
from __future__ import unicode_literals
from django.contrib.gis.db.models import F, Collect, Count, Extent, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point
from django.db import connection
from django.test import TestCase, skipUnlessDBF... |
"""
This module is here for handling compatibility with other version of dependencies than the one we used at first
Ideally the code must be directly adapted, this module should use for ease transitioning.
"""
from __future__ import absolute_import, print_function, unicode_literals, division
from functools import wra... |
from PIL import Image
from PIL import ImageOps
import re
import os
class EPDError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class EPD(object):
"""EPD E-Ink interface
to use:
from EPD import EPD
epd = EPD([path='/path/to/e... |
"""
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 2
of the License, or (at your option) any l... |
"""
Django settings for kohrsupply project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import... |
# -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes... |
def curry(_curried_func, *args, **kwargs):
def _curried(*moreargs, **morekwargs):
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs))
return _curried
### Begin from Python 2.5 functools.py ########################################
# Summary of changes made to the Python 2.5 code below:... |
"""
LPC plot with DFT, showing two formants (magnitude peaks)
"""
from audiolazy import sHz, sin_table, str2freq, lpc
import pylab
rate = 22050
s, Hz = sHz(rate)
size = 512
table = sin_table.harmonize({1: 1, 2: 5, 3: 3, 4: 2, 6: 9, 8: 1}).normalize()
data = table(str2freq("Bb3") * Hz).take(size)
filt = lpc(data, ord... |
"""
hades_logs
----------
This module provides access to Hades' radius logs utilizing its celery
RPC api.
"""
import logging
from celery.exceptions import TimeoutError as CeleryTimeoutError
from flask.globals import current_app
from werkzeug import LocalProxy
from .app import HadesCelery
from .exc import HadesConfig... |
from social.backends.oauth import BaseOAuth2
class GoClioOAuth2(BaseOAuth2):
name = 'goclio'
AUTHORIZATION_URL = 'https://app.goclio.com/oauth/authorize/'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://app.goclio.com/oauth/token/'
REDIRECT_STATE = False
STATE_PARAMETER = False
d... |
# -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import 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.x
is_py31 =... |
import mock
from shade_janitor import cleanup
from shade_janitor.tests.unit import base
class TestCleanupSubnet(base.BaseTestCase):
def setUp(self):
super(TestCleanupSubnet, self).setUp()
self.cloud.delete_subnet = mock.Mock()
self.subnet = mock.Mock()
def add_single(self):
... |
import pytest
from selenium.webdriver.common.by import By
from selenium.common.exceptions import ElementNotVisibleException
from selenium.common.exceptions import NoAlertPresentException
import unittest
@pytest.mark.ignore_opera
class AlertsTest(unittest.TestCase):
def testShouldBeAbleToOverrideTheWindowAlertMet... |
import base_report
from openerp.osv import osv
class bilan(base_report.base_report):
def __init__(self, cr, uid, name, context):
super(bilan, self).__init__(cr, uid, name, context)
def set_context(self, objects, data, ids):
super(bilan, self).set_context(objects, data, ids)
self._lo... |
import account_analytic_default
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from __future__ import print_function
import sys
from theano.compat.six.moves import xrange
def usage():
print("""usage: python make_submission.py model.pkl submission.csv)
Where model.pkl contains a trained pylearn2.models.mlp.MLP object.
The script will make submission.csv, which you may then upload to the
kagg... |
import cPickle as pickle
import numpy as np
import os
from PIL import Image
import six
train_files = ['data_batch_{}'.format(i + 1) for i in six.moves.range(5)]
test_files = ['test_batch']
def load_file(file_path):
with open(file_path, 'rb') as f:
data = pickle.load(f)
return data['data'].... |
'''
Plot weight matrices example
----------------------------
This example demonstrates how to extract the connection strength
for all the synapses among two populations of neurons and gather
these values in weight matrices for further analysis and visualization.
All connection types between these populations are con... |
from pyprint.ClosableObject import ClosableObject
class HTMLWriter(ClosableObject):
"""
Printer for outputting HTML Log files.
:param filename: the name of the file to put the data into
(string).
:param indentation_per_tag: spaces used to indent every subseq... |
{'name': 'Stock picking no confirm split',
'version': 'version',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'stock',
'complexity': "normal", # easy, normal, expert
'depends': ['stock'],
'description': """
Split picking without delivery
------------------------------
This addon adds a "Spli... |
import os
from utils import show_valid, warn, note
from clint.textui import puts, indent
from urlparse import urlparse
def import_settings(quiet=True):
"""This method takes care of importing settings from the environment, and config.py file.
Order of operations:
1. Imports all WILL_ settings from the env... |
import unittest
from log import Log
class LogTest(unittest.TestCase):
def test_get_last_logs_one(self):
file = '/var/log/siege.log'
content = Log.get_last_logs(file, 121)
content_list = content.split(",")
self.assertEqual(len(content_list), 10)
def test_get_last_logs_three(sel... |
"""Test modules.py code."""
from sympy.polys.agca.modules import FreeModule, ModuleOrder, FreeModulePolyRing
from sympy.polys import CoercionFailed, QQ, lex, grlex, ilex, ZZ
from sympy.abc import x, y, z
from sympy.utilities.pytest import raises
from sympy import S
def test_FreeModuleElement():
M = QQ.old_poly_r... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
from collections import OrderedDict
import json
import os
import click
import unicodecsv
"""
Convert a ScanCode JSON scan file to a nexb-toolkit-like CSV.
Ensure you are in the scancode ... |
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from cloudkittydashboard.api import cloudkitty as api
def get_detail_link(datum):
if datum.script_id:
url = "horizon:admin:pyscripts:script_details"
return reverse(url, ... |
# import cloudstack common
from ansible.module_utils.cloudstack import *
class AnsibleCloudStackCluster(AnsibleCloudStack):
def __init__(self, module):
super(AnsibleCloudStackCluster, self).__init__(module)
self.returns = {
'allocationstate': 'allocation_state',
'hyp... |
from django_future.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_POST
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.urlresolvers import reverse
from django.http import HttpResponse
import json
impor... |
#!/usr/bin/python
#
# Python utilities shared by the build scripts.
#
import datetime
import json
class BitEncoder:
"Bitstream encoder."
_bits = None
def __init__(self):
self._bits = []
def bits(self, x, nbits):
if (x >> nbits) != 0:
raise Exception('input value has too many bits (value: %d, bits: %d)'... |
import os
from qtpy import QtGui, compat
from glue.viewers.common.tool import Tool, CheckableTool
from glue.config import viewer_tool
from vispy import app, io
RECORD_START_ICON = os.path.join(os.path.dirname(__file__), 'glue_record_start.png')
RECORD_STOP_ICON = os.path.join(os.path.dirname(__file__), 'glue_reco... |
nltkStops = {
'.': True,
',': True,
':': True,
'a': True,
"a's": True,
'able': True,
'about': True,
'above': True,
'according': True,
'accordingly': True,
'across': True,
'actually': True,
'after': True,
'afterwards': True,
'again': True,
'against': True,
"ain't": True,
'all': True,
'allow': True,
'... |
"""Tool for uploading Google Code issues to GitHub.
Issue migration from Google Code to GitHub.
This tools allows you to easily move your downloaded Google Code issues to
GitHub.
To use this tool:
1. Follow the instructions at https://code.google.com/p/support-tools/ to
download your issues from Google... |
"""Defines Sanitizer class for sanitizing tensors.
A sanitizer first limits the sensitivity of a tensor and then adds noise
to the tensor. The parameters are determined by the privacy_spending and the
other parameters. It also uses an accountant to keep track of the privacy
spending.
"""
from __future__ import divisio... |
import sys
from virtualization import support
actions = {
'shutdown' : support.shutdown,
'start' : support.start,
'suspend' : support.suspend,
'resume' : support.resume,
'reboot' : support.reboot,
'... |
from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class Command(BaseCommand):
help = ("Output the contents of the database as a fixture of the given ... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
NO_DEFAULT,
str_to_int,
)
class DrTuberIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?drtuber\.com/(?:video|embed)/(?P<id>\d+)(?:/(?P<display_id>[\w-]+))?'
_TESTS = [{
'url': 'http... |
from selenium.webdriver.support.ui import Select
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def open_new_address(self):
wd = self.app.wd
wd.find_element_by_link_text("add new").click()
def create(self, contact):
... |
import datetime
import errno
import logging
import os
import shutil
import tempfile
from django.conf import settings
from django.contrib.sessions.backends.base import (
VALID_KEY_CHARS, CreateError, SessionBase,
)
from django.contrib.sessions.exceptions import InvalidSessionKey
from django.core.exceptions import I... |
"""
Classes in this file define additional actions that need to be taken to run a
test under some kind of runtime error detection tool.
The interface is intended to be used as follows.
1. For tests that simply run a native process (i.e. no activity is spawned):
Call tool.CopyFiles().
Prepend test command line with t... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class showdiff(osv.osv_memory):
""" Disp[ay Difference for History """
_name = 'blog.post.history.show_diff'
def get_diff(self, cr, uid, context=None):
if context is None:
context = {}
history = self.po... |
# -*- 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... |
import collections
import mock
import netaddr
from django.test.utils import override_settings
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
class NetworkApiNeutronTests(test.APIMockTestCase):
def setUp(self):
super(NetworkApiNeutronTests, self).setUp()
... |
"""Tensorflow set operations.
@@set_size
@@set_intersection
@@set_union
@@set_difference
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.ops.sets_impl import *
# pylint: e... |
"""Import hook support.
Consistent use of this module will make it possible to change the
different mechanisms involved in loading modules independently.
While the built-in module imp exports interfaces to the built-in
module searching and loading algorithm, and it is possible to replace
the built-in function ... |
"""
weakref_backports is a partial backport of the weakref module for python
versions below 3.4.
Copyright (C) 2013 Python Software Foundation, see license.python.txt for
details.
The following changes were made to the original sources during backporting:
* Added `self` to `super` calls.
* Removed `from None` when... |
from json.tests import PyTest, CTest
# 2007-10-05
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_checker/test/fail3.json
'{unqu... |
import unittest
import numpy as np
from ..join_counts import Join_Counts
from ...weights import lat2W
from ...common import pandas
PANDAS_EXTINCT = pandas is None
class Join_Counts_Tester(unittest.TestCase):
"""Unit test for Join Counts"""
def setUp(self):
self.w = lat2W(4, 4)
self.y = np.one... |
import sys
import argparse
def evaluateIdentifier(gold, pred):
"""
Performs an intrinsic evaluation of a Complex Word Identification approach.
@param gold: A vector containing gold-standard labels.
@param pred: A vector containing predicted labels.
@return: Precision, Recall and F-1.
"""
#Initialize variable... |
from autothreadharness.harness_case import HarnessCase
import unittest
class Router_5_3_4(HarnessCase):
role = HarnessCase.ROLE_ROUTER
case = '5 3 4'
golden_devices_required = 6
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main() |
from page_sets import android_screen_restoration_shared_state
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class KeyIdlePowerPage(page_module.Page):
def __init__(self, url, page_set, turn_screen_off,
shared_page_state_class=... |
data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'e', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'[?]', # 0x12
'o', # ... |
from bs4 import BeautifulSoup, SoupStrainer
from html.parser import *
import http.client
import urllib.request
from urllib.request import urlopen, Request
#99 questions
yes = ['y','ye','yes']
search_term = str(input('Bing Image Search: ')).replace(" ", "+")
link_limit = int(input("Enter link limit (1-100): "))
sav... |
"""
Creates the swig_doc.i SWIG interface file.
Execute using: python swig_doc.py xml_path outputfilename
The file instructs SWIG to transfer the doxygen comments into the
python docstrings.
"""
import sys
try:
from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
except ImportError... |
from __future__ import unicode_literals
from os.path import dirname, abspath, join
import textx.scoping.providers as scoping_providers
from textx import metamodel_from_file
from textx.scoping import is_file_included
def test_inclusion_check_1():
"""
Test to demonstrate how to check if a file is used by a mod... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
wrappers_map_theme.py - Map theme widget wrappers
---------------------
Date : August 2017
Copyright : (C) 2017 by OPENGIS.ch
Email : <EMAIL>
***********... |
from __future__ import print_function
from six import text_type
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from contentstore.utils import delete_course
from xmodule.contentstore.django import contentstore
from xm... |
"""Install perl packages using CPAN and cpanminus (cpanm).
"""
import os
from fabric.api import cd, settings
from cloudbio.flavor.config import get_config_file
from cloudbio.fabutils import find_cmd
from cloudbio.package.shared import _yaml_to_packages
from cloudbio.custom import shared as cshared
def install_packag... |
# -*- coding: utf-8 -*-
import re,urlparse,urllib
from liveresolver.modules import client,decryptionUtils
from liveresolver.modules.log_utils import log
def resolve(url):
try:
referer = urlparse.parse_qs(urlparse.urlparse(url).query)['referer'][0]
headers = { 'referer': referer,
... |
from sympy import Matrix, zeros, ones, Integer
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse, matrix_tensor_product,
matrix_to_zero
)
m = Matrix([[1,2],[3,4]])
def test_sympy_to_sympy():
assert to_sympy(m) == m
def test_matrix_to_zero():
assert matrix_to_zero(... |
# coding: utf-8
import sys
import numpy
import matplotlib.pyplot
def analyse(filename, outfile=None):
"""Load data and create plots.
Subplots with placeholders, with set lables, layout tight
"""
data = numpy.loadtxt(fname=filename, delimiter=',')
# Create a wide figure to hold the subplots... |
"""
netact_cm_command unit tests
"""
# -*- coding: utf-8 -*-
# (c) 2017, Nokia
# This file is part of Ansible
#
# Ansible 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
... |
"""Widget captioning input pipeline."""
from absl import flags
import tensorflow as tf
# Constants for embeddings.
PADDING = 0
EOS = 1
UKN = 2
START = 3
FLAGS = flags.FLAGS
def _produce_target_phrase(phrases):
"""Randomly selects one phrase as the target phrase for training."""
with tf.variable_scope('produce_... |
"""Import router for file_io."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=unused-import
from tensorflow.python.lib.io.file_io import copy as Copy
from tensorflow.python.lib.io.file_io import create_dir as MkDir
from tensorflow.python... |
import six
import json
import copy
import warnings
from collections import MutableMapping
from importlib import import_module
from scrapy.utils.deprecate import create_deprecated_class
from scrapy.exceptions import ScrapyDeprecationWarning
from . import default_settings
SETTINGS_PRIORITIES = {
'default': 0,
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.six import string_types
from ansible.module_utils.common._collections_compat import Iterable
from ansible.template.safe_eval import safe_eval
__all__ = ['listify_lookup_plugin_terms']
def listify_looku... |
import payment_method
import account_move_line
import account_invoice
import account_voucher
import res_partner |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMware Inventory Script
=======================
Retrieve information about virtual machines from a vCenter server or
standalone ESX host. When `group_by=false` (in the INI file), host systems
are also returned in addition to VMs.
This script will attempt to read conf... |
import scipy
from gnuradio import filter
from PyQt4 import QtGui
# Filter design functions using a window
def design_win_lpf(fs, gain, wintype, mainwin):
ret = True
pb,r = mainwin.gui.endofLpfPassBandEdit.text().toDouble()
ret = r and ret
sb,r = mainwin.gui.startofLpfStopBandEdit.text().toDouble()
... |
# -*- coding: utf-8 -*-
"""
This module contains common functions
for the mangrove crawler.
Wim Muskee, 2013-2018
<EMAIL>
License: GPL-3
"""
def getConfig(configfile,section):
import json
with open(configfile, "r") as f:
configdata = json.loads(f.read())
config = {}
config.update(configdata["common"])
config... |
import os, sys, subprocess, time
from rainbowhatwrapper.handlers import *
#CONSTANTS
BUTTON_A_STATE = False
BUTTON_B_STATE = False
BUTTON_C_STATE = False
def showUptime():
while True:
test = subprocess.Popen(["uptime"], stdout=subprocess.PIPE)
output = test.communicate()[0].split()[0].split(':')
... |
from setuptools import setup, find_packages
import os
description = ""
if os.path.exists('README.md'):
description = open('README.md').read()
setup(
name="c7n_salactus",
version='0.3.0',
description="Cloud Custodian - Salactus S3",
long_description=description,
classifiers=[
"Topic :: ... |
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_raises
... |
"""Generates dart source files from a mojom.Module."""
import os
import re
import shutil
import sys
import mojom.generate.constant_resolver as resolver
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom.generate.pack as pack
from mojom.generate.template_expander import Use... |
# -*- coding: utf-8 -*-
import tempfile
from odoo import api, models
import logging
_logger = logging.getLogger(__name__)
try:
import pysftp
except ImportError:
_logger.debug('saas_server_backup_ftp requires the python library pysftp which is not found on your installation')
class SaasServerClient(models.Mode... |
from django.test import SimpleTestCase
from base.utils import operator
class TestIsYearLower(SimpleTestCase):
def test_should_return_false_when_base_year_is_none(self):
self.assertFalse(
operator.is_year_lower(None, 2025)
)
def test_should_return_true_when_year_to_compare_to_is_n... |
import mox
import os
import tempfile
from nova import test
from nova import flags
from nova.openstack.common import log
from nova import utils
from nova.virt import configdrive
from nova.virt.libvirt import utils as virtutils
FLAGS = flags.FLAGS
LOG = log.getLogger(__name__)
class ConfigDriveTestCase(test.TestCa... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
from collections import UserString
from distutils.version import LooseVersion
# Pylint doesn't understand Python3 namespace modules.
from ..commands import Command # pylint: disable=relative-beyond-top-level
from .. i... |
from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sess... |
"""TXT-like base class."""
import dns.exception
import dns.rdata
import dns.tokenizer
class TXTBase(dns.rdata.Rdata):
"""Base class for rdata that is like a TXT record
@ivar strings: the text strings
@type strings: list of string
@see: RFC 1035"""
__slots__ = ['strings']
def __init__(self, ... |
"""Tests for the experimental input pipeline ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.util import nest
from tensorflow.python.framework import e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.