content string |
|---|
from nltk.sem.logic import ApplicationExpression, Operator, LogicParser
import tableau
import prover9
import mace
"""
A wrapper module that calls theorem provers and model builders.
"""
def get_prover(goal=None, assumptions=[], prover_name='Prover9'):
"""
@param goal: Input expression to prove
... |
"""Tests for monitoring."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from tensorflow.python.eager import monitoring
from tensorflow.python.eager import test
from tensorflow.python.framework import errors
from tensorflow.python.framework ... |
import pkg_resources
import contextlib
import sys
import inspect
import os
import shutil
import glob
import math
import textwrap
from PythonGists import PythonGists
from discord.ext import commands
from io import StringIO
from traceback import format_exc
from cogs.utils.checks import *
from contextlib imp... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
from ansible.module_utils.ansible_tower import TowerModule, tower_auth_config, tower_check_... |
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
'shared_library': '.dll',
}
def _GetLargePdbShimCcPath():
"""Returns the path of the large_pdb_shim.cc file."""
this_dir = os.path.abspath(os.path.dir... |
__author__ = 'Spencer'
from xml.sax.handler import ContentHandler
from xml.sax import parse
class PageMaker(ContentHandler):
passthrough = False
def startElement(self, name, attrs):
if name == 'page':
self.passthrough = True
self.out = open(attrs['name'] + '.html', 'w')
... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from collections import defaultdict
from twitter.common.collections import OrderedSet
from pants.backend.jvm.targets.jar_library import JarLibrary
from pan... |
'''
FBO Canvas
==========
This demonstrates a layout using an FBO (Frame Buffer Off-screen)
instead of a plain canvas. You should see a black canvas with a
button labelled 'FBO' in the bottom left corner. Clicking it
animates the button moving right to left.
'''
__all__ = ('FboFloatLayout', )
from kivy.graphics impo... |
#!/usr/bin/env python
"""Generate go-jstools.py"""
import sys
import textwrap
import virtualenv
filename = 'go-jstools.py'
after_install = """\
import os, subprocess
def after_install(options, home_dir):
etc = join(home_dir, 'etc')
## TODO: this should all come from distutils
## like distutils.sysconfig.g... |
import gc
import inspect
import os
import sys
import time
try:
import objgraph
except ImportError:
objgraph = None
import cherrypy
from cherrypy import _cprequest, _cpwsgi
from cherrypy.process.plugins import SimplePlugin
class ReferrerTree(object):
"""An object which gathers all referrers of an object ... |
# -*- coding: utf-8 -*-
__all__ = (
'PackStackError',
'InstallError',
'FlagValidationError',
'MissingRequirements',
'PluginError',
'ParamProcessingError',
'ParamValidationError',
'NetworkError',
'ScriptRuntimeError',
)
class PackStackError(Exception):
"""Default Exception c... |
"""Base email backend class."""
class BaseEmailBackend(object):
"""
Base class for email backend implementations.
Subclasses must at least overwrite send_messages().
"""
def __init__(self, fail_silently=False, **kwargs):
self.fail_silently = fail_silently
def open(self):
"""Op... |
# -*- coding: utf-8 -*-
"""
jsongit.wrappers
These classes provide limited interfaces to pygit2 and json_diff constructs.
"""
import json_diff
import itertools
import copy
class Commit(object):
"""A wrapper around :class:`pygit2.Commit` linking to a single key in the
repo.
"""
def __init__(self, re... |
import unittest
from resync.client_utils import count_true_args,parse_links,parse_link,parse_capabilities,parse_capability_lists
from resync.client import ClientFatalError
class TestClientUtils(unittest.TestCase):
def test01_count_true_args(self):
self.assertEqual( count_true_args(), 0 )
self.asse... |
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
from json import scanner
try:
from _json import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconstants():
_BYTES = '7FF800000000... |
"""Miscellaneous bsddb module test cases
"""
import os, sys
import unittest
from test_all import db, dbshelve, hashopen, test_support, get_new_environment_path, get_new_database_path
#----------------------------------------------------------------------
class MiscTestCase(unittest.TestCase):
def setUp(self):
... |
from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE
def to_genshi(walker):
text = []
for token in walker:
type = token["type"]
if type in ("Characters", "SpaceCharacters"):
... |
from django.test import SimpleTestCase
from ..utils import setup
class ListIndexTests(SimpleTestCase):
@setup({'list-index01': '{{ var.1 }}'})
def test_list_index01(self):
"""
List-index syntax allows a template to access a certain item of a
subscriptable object.
"""
... |
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
)
class MoeVideoIE(InfoExtractor):
IE_DESC = 'LetitBit video ser... |
"""Element OS Software Volume Manager"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
from ansible.module_utils.basic import AnsibleMod... |
import sys
from testrunner import run
def testfunc(child):
child.expect_exact("EEPROM registry (eepreg) test routine")
child.expect_exact("Testing new registry creation: reset check [SUCCESS]")
child.expect_exact("Testing writing and reading entries: add write add read [SUCCESS]")
child.expect_exact("... |
"""Test case that runs a checker on a file, matching errors against annotations.
Runs the given checker on the given file, accumulating all errors. The list
of errors is then matched against those annotated in the file. Based heavily
on devtools/javascript/gpylint/full_test.py.
"""
__author__ = ('<EMAIL> (Robert Wa... |
"""
Support for thr Free Mobile SMS platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.free_mobile/
"""
import logging
import voluptuous as vol
from homeassistant.components.notify import (
PLATFORM_SCHEMA, BaseNotificationService)
fro... |
from gnuradio import gr, gr_unittest
import ofdm_swig as ofdm
class qa_channel_equalizer_mimo (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_t (self):
# set up fg
self.tb.run ()
# check data
i... |
# -*- coding: utf-8-*-
import re
import facebook
WORDS = ["FACEBOOK", "NOTIFICATION"]
def handle(text, mic, profile):
"""
Responds to user-input, typically speech text, with a summary of
the user's Facebook notifications, including a count and details
related to each individual notificat... |
from __future__ import absolute_import, print_function, division
import unittest
import numpy
import theano
from theano import function, config
from theano import scalar
from theano.gof import FunctionGraph
from theano.gof.opt import out2in
from theano.tensor.opt_uncanonicalize import (
local_alloc_dimshuffle,
... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
class RabbitMqPolicy(object):
def __init__(self, module, name):
self._module = module
self._name = name
self._vhost = module.params['vhost']
self._patter... |
import sys
import os
def usage():
print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
print("")
print("PHYTYPES is a comma separated list of:")
print("A => A-PHY")
print("AG => Dual A-PHY G-PHY")
print("G => G-PHY")
print("LP => LP-PHY")
print("N ... |
from Components.NimManager import nimmanager
class ChannelNumbers:
def __init__(self):
pass
def getChannelNumber(self, frequency, nim):
f = int(self.getMHz(frequency))
descr = self.getTunerDescription(nim)
if "Europe" in descr:
if "DVB-T" in descr:
if 174 < f < 230: # III
d = (f + 1) % 7
... |
import json
from functools import wraps
from flask import Blueprint, request, Response, g, url_for, current_app
from flask.ext.babel import gettext as _
from sqlalchemy.sql.expression import desc
from geoalchemy2.functions import ST_AsGeoJSON, ST_Transform
from gbi_server.config import SystemConfig
from gbi_server.m... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" -- a versatile microsimulation free software"""
from setuptools import setup, find_packages
setup(
name = 'OpenFisca-France',
version = '0.5.4.dev0',
author = 'OpenFisca Team',
author_email = '<EMAIL>',
classifiers = [
"Development Sta... |
import re
from logging import warning
from weboob.browser.pages import HTMLPage, LoggedPage
class Message(object):
TIMESTAMP_REGEXP = re.compile(r'(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})')
def __init__(self, id, timestamp, login, message, is_me):
self.id = id
self.timestamp = timestamp
... |
{'name': 'Switzerland - Accounting',
'description': """
Swiss localization
==================
**Multilang swiss STERCHI account chart and taxes**
**Author:** Camptocamp SA
**Financial contributors:** Prisme Solutions Informatique SA, Quod SA
**Translation contributors:** brain-tec AG, Agile Business Group
... |
from unittest import mock
from barbican import queue
from barbican.queue import client
from barbican.tests import utils
class WhenUsingAsyncTaskClient(utils.BaseTestCase):
"""Test using the asynchronous task client."""
def setUp(self):
super(WhenUsingAsyncTaskClient, self).setUp()
# Mock ou... |
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
@linter(executable='licensecheck',
output_format='regex',
output_regex=r'.*: .*UNKNOWN$',
result_message='No license found.')
class Licens... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
from collections import defaultdict
from contextlib import contextmanager
from textwrap import dedent
from six.moves import range
from twitter.com... |
"""Tests for TensorFlow Debugger (tfdbg) Utilities."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.python.debug.lib import de... |
from .stochastic_gradient import BaseSGDClassifier
from ..feature_selection.from_model import _LearntSelectorMixin
class Perceptron(BaseSGDClassifier, _LearntSelectorMixin):
"""Perceptron
Read more in the :ref:`User Guide <perceptron>`.
Parameters
----------
penalty : None, 'l2' or 'l1' or 'ela... |
"""
This an example script inserting a pylearn2 yaml code into a jobman database.
The code below defines a yaml template string in state.yaml_template,
and the values of its hyper-parameters in state.hyper_parameters, and
run the code that is located in state.extract_results on this model
using jobman.
Actually, we a... |
from _version import __version__
version = __version__ # backward compat.
import util
import useragent
import flashpolicy
import httpstatus
import utf8validator
import xormasker
import websocket
import resource
import prefixmap
import wamp |
import fixtures
from oslo_context import context
class ClearRequestContext(fixtures.Fixture):
"""Clears any cached RequestContext
This resets RequestContext at the beginning and end of tests that
use this fixture to ensure that we have a clean slate for running
tests, and that we leave a clean slate... |
import price
import workcenter_load
import bom_structure
import mrp_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from __future__ import absolute_import, division, unicode_literals
from six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys m... |
"""Run Inspector's perf tests in perf mode."""
import os
import json
import logging
import optparse
import time
import datetime
from webkitpy.common import find_files
from webkitpy.common.checkout.scm.detection import SCMDetector
from webkitpy.common.config.urls import view_source_url
from webkitpy.common.host import... |
import os
import json
import sys
from botocore.compat import six
from cement.utils.misc import minimal_logger
from ..core import fileoperations
from ..lib import utils
from ..objects.exceptions import ValidationError, CommandError
from ..resources.strings import strings
EXPOSE_CMD = 'EXPOSE'
FROM_CMD = 'FROM'
LATES... |
from datetime import datetime
from dateutil.relativedelta import relativedelta
import openerp
from openerp import osv
import time
from openerp.report.interface import report_int
from openerp.report.render import render
import stock_graph
import StringIO
import unicodedata
class external_pdf(render):
def __init__... |
'''
altgraph - a python graph library
=================================
altgraph is a fork of `graphlib <http://pygraphlib.sourceforge.net>`_ tailored
to use newer Python 2.3+ features, including additional support used by the
py2app suite (modulegraph and macholib, specifically).
altgraph is a python based graph (ne... |
import sys
from django.core.management.color import color_style
from django.utils.itercompat import is_iterable
class ModelErrorCollection:
def __init__(self, outfile=sys.stdout):
self.errors = []
self.outfile = outfile
self.style = color_style()
def add(self, context, error):
... |
import io
import logging
import os
import subprocess
import sys
import time
import unittest
import avro.io
import avro.test.mock_tether_parent
import avro.test.word_count_task
import avro.tether.tether_task
import avro.tether.tether_task_runner
import avro.tether.util
class TestTetherTaskRunner(unittest.TestCase):
... |
# -*- coding: utf-8 -*-
"""
Shelter Registry - Controllers
"""
# @ToDo Search shelters by type, services, location, available space
# @ToDo Tie in assessments from RAT and requests from RMS.
# @ToDo Associate persons with shelters (via presence loc == shelter loc?)
module = request.controller
resourcename = reque... |
# Definition for a binary tree node.
from typing import Dict, List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def lcaDeepestLeaves1(self, root: TreeNode) -> TreeNode:
self.parent: Dict[TreeNode, TreeNode] = {}
... |
import logging
import cmapPy.clue_api_client.setup_logger as setup_logger
import cmapPy.clue_api_client.clue_api_client as clue_api_client
__authors__ = "David L. Lahr"
__email__ = "<EMAIL>"
logger = logging.getLogger(setup_logger.LOGGER_NAME)
class MockClueApiClient(clue_api_client.ClueApiClient):
def __init_... |
try:
import pyodbc
except ImportError:
pyodbc_found = False
else:
pyodbc_found = True
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
class NotSupportedError(Exception):
pass
class CannotDropError(Exception):
pass
# module specific ... |
### Will be populated by the UI with it's own value
app = None
import time
from shinken.webui.bottle import redirect
from shinken.modules.webui_broker.helper import hst_srv_sort
from shinken.util import safe_print
try:
import json
except ImportError:
# For old Python version, load
# simple json (it can be... |
"""
TrueType Font parser.
Documents:
- "An Introduction to TrueType Fonts: A look inside the TTF format"
written by "NRSI: Computers & Writing Systems"
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08
Author: Victor Stinner
Creation date: 2007-02-08
"""
from hachoir_parser import... |
import sys, math
from twisted.python import log
from twisted.internet import reactor, defer
from twisted.web.server import Site
from twisted.web.static import File
from autobahn.twisted.websocket import listenWS
from autobahn.wamp1.protocol import exportRpc, \
WampServerFactory, \
... |
"""
A Fake Data API for testing purposes.
"""
import copy
import datetime
_DEFAULT_FAKE_MODE = {
"slug": "honor",
"name": "Honor Code Certificate",
"min_price": 0,
"suggested_prices": "",
"currency": "usd",
"expiration_datetime": None,
"description": None
}
_ENROLLMENTS = []
_COURSES = [... |
#!/usr/bin/env python
# -*- coding: Utf-8 -*-
#
# WIRELESS ACCESS POINT FUCKER
# Interactive, Multifunction, Destruction Mode Included
#
# Thanks to BackTrack crew, especially ShamanVirtuel and ASPJ
#
# USAGE: Launch the script as root using "python AP-Fucker.py", follow instructions, enjoy!
# Prerequisites: Have mdk3 ... |
# -*- coding: utf-8 -*-
import pytest
from parglare import Parser, Grammar
from parglare.grammar import ASSOC_LEFT, ASSOC_RIGHT, DEFAULT_PRIORITY
from parglare.exceptions import GrammarError, ParseError
def test_single_terminal():
"""
Test that grammar may be just a single terminal.
"""
grammar = r"""... |
import pytest
from distutils.version import LooseVersion
import pandas as pd
from pandas.core.computation.engines import _engines
import pandas.core.computation.expr as expr
from pandas.core.computation import _MIN_NUMEXPR_VERSION
def test_compat():
# test we have compat with our version of nu
from pandas.... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import wx
from .common import update_class
class Choice(wx.Choice):
def __init__(self, parent, items=[]):
wx.Choice.__init__(self, parent.get_container(), -1,
wx.Defaul... |
import os, sys, re,string,FCFileTools
verbose = 0
dcount = fcount = 0
def replaceTemplate(dirName, oldName, newName):
"""
modify contents from dirName and below, replace oldName by newName
"""
for file in os.listdir(dirName):
pathName = os.path.join(dirName, file)
if not os.path.isdir(pathName):
... |
from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Inner, OuterA, OuterB, Poll
class NullQueriesTests(TestCase):
def test_none_as_null(self):
"""
Regression test for the use of None as a query value.... |
"""
A clone of 'pmap' utility on Linux, 'vmmap' on OSX and 'procstat -v' on BSD.
Report memory map of a process.
$ python examples/pmap.py 32402
pid=32402, name=hg
Address RSS Mode Mapping
0000000000400000 1200K r-xp /usr/bin/python2.7
0000000000838000 4K r--p /usr/bin/python2.... |
"""
This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use... |
"""Implementation of Cluster Resolvers for GCE Instance Groups."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.cluster_resolver.python.training.cluster_resolver import ClusterResolver
from tensorflow.python.training.server_lib i... |
import sys
import warnings
import numpy as np
from numpy.testing import *
warnings.filterwarnings('ignore',
'Casting complex values to real discards the imaginary part')
types = [np.bool_, np.byte, np.ubyte, np.short, np.ushort, np.intc, np.uintc,
np.int_, np.uint, np.longlong, np.ulonglong,
... |
from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import M... |
"""
EC2 Container Service wrapper for Luigi
From the AWS website:
Amazon EC2 Container Service (ECS) is a highly scalable, high performance
container management service that supports Docker containers and allows you
to easily run applications on a managed cluster of Amazon EC2 instances.
To use ECS, you create... |
# -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, highlight
fro... |
import unittest
import tempfile
import uuid as _uuid
import pathlib
import io
from qiime2.core.testing.type import IntSequence1
from qiime2.core.testing.format import IntSequenceDirectoryFormat
from qiime2.core.archive.archiver import _ZipArchive, ArchiveRecord
from qiime2.core.archive.format.v0 import ArchiveFormat
... |
from django.db import models
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import UserManager
import hashlib
class User(models.Model):
USER_TYPE = (
(1, 'student'),
(2, 'business'),
(3, 'non... |
"""
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... |
"""Xception Keras application."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.keras.python.keras.applications.xception import decode_predictions
from tensorflow.contrib.keras.python.keras.applications.xception import preprocess_i... |
"""
Support for ATLAS as toolchain linear algebra library.
:author: Stijn De Weirdt (Ghent University)
:author: Kenneth Hoste (Ghent University)
"""
from easybuild.tools.toolchain.linalg import LinAlg
TC_CONSTANT_ATLAS = 'ATLAS'
class Atlas(LinAlg):
"""
Provides ATLAS BLAS/LAPACK support.
LAPACK is a ... |
from pip._vendor.packaging.version import parse as parse_version
class InstallationCandidate(object):
def __init__(self, project, version, location):
self.project = project
self.version = parse_version(version)
self.location = location
self._key = (self.project, self.version, self... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import logging
def find_library_nt(name):
# modified from ctypes.util
# ctypes.util.find_library just returns first result he found
# but we want to try them all
# because on Windows, users may have both ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sys
from contextlib import contextmanager
from textwrap import dedent
from pants.backend.core.tasks.repl_task_mixin import ReplTaskMixin
from pants.b... |
__author__ = 'tonycastronova'
import numpy
from osgeo import ogr
import stdlib
from emitLogging import elog
def fromWKB(wkb):
"""
Builds a stdlib.Geometry object from a WKB string
:param wkb: wkb string
:return: stdlib.Geometry
"""
geom = None
# parse the wkt string into ogr
ogrgeo... |
"""Module containing AWS credential file installation and cleanup helpers.
AWS credentials consist of a secret access key and its ID, stored in a single
file. Following PKB's AWS setup instructions (see
https://github.com/GoogleCloudPlatform/PerfKitBenchmarker#install-aws-cli-and-setup-authentication),
the default loc... |
#!/usr/bin/python
'''
Utility scripts for contacts
Copyright (C) 2012 Alex Safatli, Christian Blouin, Jose Sergio Hleap
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... |
# -*- coding: utf-8 -*-
import re
from cached_property import cached_property
from collections import namedtuple
from datetime import date, datetime
import multimethods as mm
from fixtures.pytest_store import store
def get_product_version(ver):
"""Return product version for given Version obj or version string
... |
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import models
class CustomUserNonUniqueUsername(AbstractBaseUser):
"""
A user with a non-unique username.
This model is not invalid if it is used with a custom authentication
backend which supports non-unique username... |
from osv import osv, fields
class partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'charge_revenue_stamp': fields.boolean('Revenue stamp Charged in Invoice', help="In case VAT free, revenue stamp's cost will be charged in invoices."),
'charge_invoice_cost': fields.boolean('Costs Charged... |
# -*- 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):
# Adding model 'Donation'
db.create_table('shoppingcart_donation', (
('orderitem_ptr', self.gf('... |
# -*- coding: UTF-8 -*-
logger.info("Loading 78 objects to table countries_place...")
# fields: id, parent, name, country, zip_code, type, show_type, inscode
loader.save(create_countries_place(1,None,['Eupen', '', ''],u'BE',u'4700',u'50',False,u'63023'))
loader.save(create_countries_place(2,1,['Nispert', '', ''],u'BE',... |
"""Contains the logic for `aq show organization`."""
from aquilon.worker.broker import BrokerCommand # pylint: disable=W0611
from aquilon.worker.commands.show_location_type import CommandShowLocationType
class CommandShowOrganizationAll(CommandShowLocationType):
required_parameters = []
def render(self, ... |
"""Simple, end-to-end, LeNet-5-like convolutional MNIST model example.
This should achieve a test error of 0.7%. Please keep this model as simple and
linear as possible, it is meant as a tutorial for simple convolutional models.
Run with --self_test on the command line to execute a short self-test.
"""
from __future__ ... |
"""Adagrad Dual Averaging for TensorFlow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.op... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.azure_rm_common import AzureRMModuleBase
try:
from msrestazure... |
"""distutils.file_util
Utility functions for operating on single files.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: file_util.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose ou... |
"""Helper classes for tests."""
import copy
import functools
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.element import (
Comment,
Doctype,
SoupStrainer,
)
from bs4.builder import HTMLParserTreeBuilder
default_builder = HTMLParserTreeBuilder
class SoupTest(unitte... |
"""Support for Actions on Google Assistant Smart Home Control."""
import logging
from typing import Any, Dict
import voluptuous as vol
# Typing imports
from homeassistant.const import CONF_API_KEY, CONF_NAME
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation ... |
"""Tests for combined DNN + GBDT estimators."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
from tensorflow.contrib.boosted_trees.estimator_batch import dnn_tree_combined_estimator as estimator
from tensorflow.contrib.boosted_t... |
from Converter import Converter
from time import localtime, strftime
from Components.Element import cached
class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
IN_MINUTES = 2
DATE = 3
FORMAT = 4
AS_LENGTH = 5
TIMESTAMP = 6
FULL = 7
SHORT_DATE = 8
LONG_DATE = 9
VFD = 10
AS_LENGTHHOURS = 11
AS... |
import numpy as np
from matplotlib import pyplot
from spm1d import rft1d
eps = np.finfo(float).eps
def here_anova1(Y, X, X0, Xi, X0i, df):
Y = np.matrix(Y)
### estimate parameters:
b = Xi*Y
eij = Y - X*b
R = eij.T*eij
### reduced design:
b0 = X0i*Y
eij0 = Y ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import logging
import re
import os
import socket
import traceback
from ansible import constants as C
from ansible.errors import AnsibleConnectionFailure
from ansible.module_utils.six import BytesIO, PY3
from ansible.mo... |
"""
Txc proxy.
This proxy handles all communication between the Txc and the
shell programs
"""
from shell.proxies.baseProxy import baseProxy
import os,re
import time
from xmlrpclib import ServerProxy
import siteconfig
class txcProxy(baseProxy):
def __init__(self,experiment):
baseProxy.__init__(self,'txc... |
from __future__ import unicode_literals
__author__ = "mozman <<EMAIL>>"
from contextlib import contextmanager
from .graphics import none_subclass, entity_subclass, ModernGraphicEntity
from ..lldxf.types import convert_tags_to_text_lines, convert_text_lines_to_tags
from ..lldxf.classifiedtags import ClassifiedTags
fro... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
BasicStatistics.py
---------------------
Date : November 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
************... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.