content string |
|---|
"""Use:
curl http://localhost:9912/get_name_of_month?month=12
to use this service.
"""
host = '127.0.0.1'
port = 8000
import logging
from datetime import datetime
from spyne import Integer, Unicode, rpc, Service
class NameOfMonthService(Service):
@rpc(Integer(ge=1, le=12), _returns=Unicode)
def get_... |
import re
import os
import pexpect
import socket
import sys
import subprocess
import time
from scapy.all import Ether, ICMPv6PacketTooBig, IPv6, IPv6ExtHdrFragment, \
UDP, raw, sendp, srp1
from testrunner import run, check_unittests
RECV_BUFSIZE = 2 * 1500
TEST_SAMPLE = b"This is a test. Failur... |
import os
import urlparse
from fnmatch import fnmatch
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
import html5lib
import vcs
from item import Stub, ManualTest, WebdriverSpecTest, RefTest, TestharnessTest
from utils import rel_path_to_url, Contex... |
from testtools import matchers
from webob import exc
from neutron.common import exceptions as q_exc
from neutron import context
from neutron.extensions import portbindings
from neutron.tests.unit import _test_extension_portbindings as test_bindings
from neutron.tests.unit.nec import test_nec_plugin
from neutron.tests.... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.facts.collector import BaseFactCollector
class Network:
"""
This is a generic Network subclass of Facts. This should be further
subclassed to implement per platform. If you subclass this,
... |
from datetime import datetime, timedelta
from dj import times
def get_date(date=None):
if date and isinstance(date, str):
return times.localtime(datetime.strptime(date[0:10], '%Y-%m-%d'))
if not date:
return times.localtime(datetime.now()).replace(hour=0, second=0, minute=0, microsecond=0)
... |
from oslo_log import log as logging
from cinder.api import common
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model backup API responses as a python dictionary."""
_collection_name = "backups"
def __init__(self):
"""Initialize view builder."""
super(Vie... |
#!/usr/bin/env python3
import json
from pathlib import Path
from os import getenv
from sys import argv
if len(argv) != 2:
print("JSON info files script requires ouput file as argument")
exit(1)
output_path = Path(argv[1])
assert getenv("WORK_DIR"), "$WORK_DIR required"
work_dir = Path(getenv("WORK_DIR"))
... |
from __future__ import nested_scopes
__revision__ = "$Id$"
import unittest
from Crypto.SelfTest.st_common import list_test_cases, a2b_hex, b2a_hex
from Crypto.Util.py3compat import *
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP as PKCS
from Crypto.Hash import MD2,MD5,SHA as SHA1,SHA256,RIPE... |
import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import X... |
"""Kafka Dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.kafka.python.ops import kafka_op_loader # pylint: disable=unused-import
from tensorflow.contrib.kafka.python.ops import gen_dataset_ops
from tensorflow.python.data.... |
"""
PCA Reconstruction of a spectrum
--------------------------------
Figure 7.6
The reconstruction of a particular spectrum from its eigenvectors. The input
spectrum is shown in gray, and the partial reconstruction for progressively
more terms is shown in black. The top panel shows only the mean of the set of
spectra... |
# A collection of various utility functions
import logging
from datetime import datetime
logger = logging.getLogger(__name__)
# An epoch good for time axis labels - OceanSITES uses 1 Jan 1950
EPOCH_STRING = '1950-01-01'
EPOCH_DATETIME = datetime(1950, 1, 1)
def round_to_n(x, n):
'''
Round to n significant di... |
import os
import pytest
import pip.baseparser
from pip import main
from pip import cmdoptions
from pip.basecommand import Command
from pip.commands import commands_dict as commands
class FakeCommand(Command):
name = 'fake'
summary = name
def main(self, args):
index_opts = cmdoptions.make_option_g... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CreditProvider.provider_url'
db.add_column('credit_credit... |
from __future__ import unicode_literals
import datetime
from unittest import skipIf
from django.test import TestCase, override_settings
from django.utils import timezone
from .models import Article, Category, Comment
try:
import pytz
except ImportError:
pytz = None
class DateTimesTests(TestCase):
def ... |
"""Vispy configuration functions
"""
import os
from os import path as op
import json
import sys
import platform
import getopt
import traceback
import tempfile
import atexit
from shutil import rmtree
from .event import EmitterGroup, EventEmitter, Event
from .logs import logger, set_log_level, use_log_level
from ..ext.... |
import itertools
import os
from oslo_config import cfg
import six
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova.i18n import _
from nova import utils
ALIAS = "os-fping"
authorize = extension... |
import re
def find_uptime_field(a_pattern, uptime_str):
'''
If there is a match return the match group(1)
Else return 0
'''
a_check = re.search(a_pattern, uptime_str)
if a_check:
return int(a_check.group(1))
else:
return 0
class Uptime(object):
'''
Create an Upti... |
import shutil
from os import path
USERAGENT = 'ansible-httpget'
try:
from layman.api import LaymanAPI
from layman.config import BareConfig
HAS_LAYMAN_API = True
except ImportError:
HAS_LAYMAN_API = False
class ModuleError(Exception): pass
def init_layman(config=None):
'''Returns the initialize... |
from __future__ import absolute_import, division, print_function
from cryptography.hazmat.primitives.asymmetric.dsa import (
DSAParameterNumbers, DSAPrivateNumbers, DSAPublicNumbers
)
DSA_KEY_1024 = DSAPrivateNumbers(
public_numbers=DSAPublicNumbers(
parameter_numbers=DSAParameterNumbers(
... |
import sys
from lib.bucket import BUCKET_ID
from lib.subcommand import SubCommand
class StacktraceCommand(SubCommand):
def __init__(self):
super(StacktraceCommand, self).__init__(
'Usage: %prog stacktrace <dump>')
def do(self, sys_argv):
_, args = self._parse_args(sys_argv, 1)
dump_path = ar... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import datetime
import unittest
from airflow import configuration, DAG
from airflow.contrib.operators import mlengine_operator_utils
from airflow.contrib.operators.mlengine_operator_utils import create_evaluat... |
from __future__ import unicode_literals, division, absolute_import
import logging
import re
import urllib2
from flexget import plugin
from flexget.event import event
from flexget.plugins.plugin_urlrewriting import UrlRewritingError
from flexget.utils.tools import urlopener
from flexget.utils.soup import get_soup
log ... |
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... |
from smbclient import SambaClient
import os
from airflow.hooks.base_hook import BaseHook
class SambaHook(BaseHook):
'''
Allows for interaction with an samba server.
'''
def __init__(self, samba_conn_id):
self.conn = self.get_connection(samba_conn_id)
def get_conn(self):
samba = ... |
"""Tests for data_utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from itertools import cycle
import os
import tarfile
import threading
import unittest
import zipfile
import numpy as np
from six.moves.urllib.parse import urljoin
from six.moves.ur... |
import os
import re
import sys
def _SyncFilesToCloud(input_api, output_api):
"""Searches for .sha1 files and uploads them to Cloud Storage.
It validates all the hashes and skips upload if not necessary.
"""
# Because this script will be called from a magic PRESUBMIT demon,
# avoid angering it; don't pollut... |
#!/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 bind import BindColle... |
from scapy.fields import *
from scapy.packet import *
from scapy.layers.inet import UDP
from scapy.layers.dns import DNSQRField, DNSRRField, DNSRRCountField
"""
LLMNR (Link Local Multicast Node Resolution).
[RFC 4795]
"""
#############################################################################
### ... |
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... |
#-*- coding: utf-8 -*-
from easy_thumbnails.files import Thumbnailer
import os
import re
from filer import settings as filer_settings
# match the source filename using `__` as the seperator. ``opts_and_ext`` is non
# greedy so it should match the last occurence of `__`.
# in ``ThumbnailerNameMixin.get_thumbnail_name``... |
#!/usr/bin/env python
import random
import string
from tests.unit import unittest
import mock
import boto
RESPONSE_TEMPLATE = r"""
<InvalidationList>
<Marker/>
<NextMarker>%(next_marker)s</NextMarker>
<MaxItems>%(max_items)s</MaxItems>
<IsTruncated>%(is_truncated)s</IsTruncated>
%(inval_summaries)s
</... |
"""Options for BigMLer time series
"""
import sys
def int_or_none(value):
"""Casts to integer if the value is not None
"""
if value is not None:
return int(value)
return None
def range(value):
"""Creates a range from two comma-separated integers
"""
if "," not in value:
... |
"""
An alphabetical list of provinces and territories for use as `choices`
in a formfield., and a mapping of province misspellings/abbreviations to
normalized abbreviations
Source: http://www.canada.gc.ca/othergov/prov_e.html
This exists in this standalone file so that it's only imported into memory
when explici... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
from numpy import arange
"""
__author__: 'kmunve'
"""
def _temperature_plot(values, xticks=None, p_title=None, p_xlabel='Time', p_ylabel='Temperature'):
"""
TODO: add a check if the values are in Kelvin, Fahrenheit, or Celsi... |
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class DescribeSecurityGroupRulesAction(BaseAction):
action = 'DescribeSecurityGroupRules'
command = 'describe-security-group-rules'
usage = '%(prog)s -s <security_group_id> -r <security_group_r... |
"""A place to store TSIG keys."""
import base64
import dns.name
def from_text(textring):
"""Convert a dictionary containing (textual DNS name, base64 secret) pairs
into a binary keyring which has (dns.name.Name, binary secret) pairs.
@rtype: dict"""
keyring = {}
for keytext in textring:
... |
from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, ... |
'''
Implementation of Bitcoin's p2p protocol
'''
import random
import sys
import time
from twisted.internet import protocol
import p2pool
from . import data as bitcoin_data
from p2pool.util import deferral, p2protocol, pack, variable
class Protocol(p2protocol.Protocol):
def __init__(self, net):
p2protoc... |
def maximum_fill_value(obj):
"""
Return the minimum value that can be represented by the dtype of an object.
This function is useful for calculating a fill value suitable for
taking the maximum of an array with a given dtype.
Parameters
----------
obj : dtype
An object that can be ... |
# -*- coding: utf-8 -*-
from datetime import date
from odoo import models, fields, api
from odoo.exceptions import UserError
class BuySummaryGoodsWizard(models.TransientModel):
_name = 'buy.summary.goods.wizard'
_description = u'采购汇总表(按商品)向导'
@api.model
def _default_date_start(self):
return ... |
"""
A tool to generate a predetermined resource ids file that can be used as an
input to grit via the -p option. This is meant to be run manually every once in
a while and its output checked in. See tools/gritsettings/README.md for details.
"""
from __future__ import print_function
import os
import re
import sys
# R... |
"""Code generation utilities"""
from .utils import SchemaInfo, is_valid_identifier, indent_docstring, indent_arglist
import textwrap
import re
class CodeSnippet(object):
"""Object whose repr() is a string of code"""
def __init__(self, code):
self.code = code
def __repr__(self):
return se... |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **Getting shake data from local storage**
Contact : <EMAIL>
.. note:: 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 Fr... |
# -*- coding: utf-8 -*-
"""kolibri URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home... |
from django.test import TestCase
from core.forms import FieldMapperForm
from core.models import get_field_mapper_choices
class FieldMapperFormTestCase(TestCase):
def test_python_prohibited(self):
test_body = {
'name': 'Test Field Mapper',
'field_mapper_type': 'python',
}
... |
"""
Functional constructs for ORM configuration.
See the SQLAlchemy object relational tutorial and mapper configuration
documentation for an overview of how this module is used.
"""
from . import exc
from .mapper import (
Mapper,
_mapper_registry,
class_mapper,
configure_mappers,
reconstructor,
... |
"""Test per-peer message capture capability.
Additionally, the output of contrib/message-capture/message-capture-parser.py should be verified manually.
"""
import glob
from io import BytesIO
import os
from test_framework.p2p import P2PDataStore, MESSAGEMAP
from test_framework.test_framework import BitcoinTestFramewo... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
'''
Compat module for Python2.7's unittest module
'''
import sys
# Allow wildcard import because we really do want to import all of
# unittests's symbols into this compat shim
# pylint: disable=wildcard-import,unused-wildcard-imp... |
from openerp import api, fields, models, exceptions, _
from openerp.addons import decimal_precision as dp
class ProductConfigurator(models.AbstractModel):
_name = 'product.configurator'
product_tmpl_id = fields.Many2one(
comodel_name='product.template', string='Product Template',
auto_join=Tr... |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import pwd
import datetime
import sys
import traceback
import tables
import warnings
warnings.filterwarnings("ignore", module="plotly")
# pymzml has plotly in it and if you don't have a setup in your
# home directory, you get a w... |
import time
from openerp.report import report_sxw
class Parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(Parser, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
'get_no': self.get_no,
'get_basic':... |
__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 2014/09/27 12:51:43 garyo"
__doc__ = """
"""
import os
import re
from common import read_reg, debug
# Original value recorded by dcournapeau
_FRAMEWORKDIR_HKEY_ROOT = r'Software\Microsoft\.NETFramework\InstallRoot'
# On SGK's system
_FRAMEWORKDIR_HKEY_... |
import sys
__all__ = ['AutoFinalizedObject']
class _AutoFinalizedObjectBase(object):
"""
Base class for objects that get automatically
finalized on delete or at exit.
"""
def _finalize_object(self):
"""Actually finalizes the object (frees allocated resources etc.).
Returns: None... |
import time
from zope.interface import implements
from twisted.names import dns
from twisted.python import failure, log
from twisted.internet import interfaces, defer
import common
class CacheResolver(common.ResolverBase):
"""A resolver that serves records from a local, memory cache."""
implements(interfac... |
# $Id$
# Train a mixture of Gaussians to approximate a multi-mode dataset.
# It seems fairly easy to fall into some local minimum. Good solutions
# have errors around -200.
# This example reproduces Fig. 5.21 from Bishop (2006).
__author__ = 'Martin Felder'
import pylab as p
import numpy as np
from pybrain.structure.... |
import logging
import werkzeug
import openerp
from openerp.addons.auth_signup.res_users import SignupError
from openerp.addons.web.controllers.main import ensure_db
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class AuthSignupHo... |
"""
TXs a waveform (either from a file, or a sinusoid) in a frequency-hopping manner.
"""
import numpy
import argparse
import pmt
from gnuradio import gr
from gnuradio import blocks
from gnuradio import uhd
def setup_parser():
""" Setup the parser for the frequency hopper. """
parser = argparse.ArgumentParser... |
"""
Utility functions for handling images.
Requires PIL, as you might imagine.
"""
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def _get_width(self):
ret... |
import hmac
import hashlib
import re
import random
import string
from . import _hotp as hotp, _utils
'''
Implementation of OCRA
See also http://tools.ietf.org/html/draft-mraihi-mutual-oath-hotp-variants-14
'''
__all__ = (
'str2ocrasuite',
'StateException',
'OCRAChallengeResponseServer',
'OC... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
try:
import shade
HAS_SHADE = True
except ImportError:
HAS_SHADE = False
def _needs_update(params_dict, user):
for k, v in params_dict.items():
if k not ... |
'''tzinfo timezone information for Australia/Melbourne.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Melbourne(DstTzInfo):
'''Australia/Melbourne timezone definition. See datetime.tzinfo for details'''
zone = 'Australi... |
'''
Examines log generated by ccid_ctid.test.py, returns 0 if valid, 1 if not.
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses th... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.vyos.vyos import get_config, load_config
from ansible.module_utils.network.vyos.vyos import vy... |
"""Data Flow Operations."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes as _dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shap... |
#META: timeout=long
import pytest
from webdriver import error
from conftest import product, flatten
@pytest.mark.parametrize("value", [None, 1, "{}", []])
def test_invalid_capabilites(new_session, value):
with pytest.raises(error.InvalidArgumentException):
new_session({"capabilities": value})
@pytest.... |
"""All the database related entities are in this module."""
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import text
import numpy as np
import math
from scipy.stats import lognorm
from sqlalchemy.ext.hybrid import hybrid_property
db = SQLAlchemy()
class Ethnicity(db.Model):
"""Ethnicity Model. We wil... |
DEFAULT_VAPP_OPERATION = 'noop'
VAPP_STATUS = {
'Powered off': 'poweroff',
'Powered on': 'poweron',
'Suspended': 'suspend'
}
VAPP_STATES = ['present', 'absent', 'deployed', 'undeployed']
VAPP_OPERATIONS = ['poweron', 'poweroff', 'suspend', 'shutdown',
'reboot', 'reset', 'noop']
def ge... |
import csv
import shutil
import datetime
ORIGINAL = "rec-center-hourly.csv"
BACKUP = "rec-center-hourly-backup.csv"
DATE_FORMAT = "%m/%d/%y %H:%M"
def isTuesday(date):
return date.weekday() is 1
def withinOctober(date):
return datetime.datetime(2010, 10, 1) <= date < datetime.datetime(2010, 11, 1)
def run(... |
from tapiriik.settings import PULSSTORY_CLIENT_ID, PULSSTORY_CLIENT_SECRET
from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase
from tapiriik.services.service_record import ServiceRecord
from tapiriik.services.stream_sampling import StreamSampler
from tapiriik.services.auto_pause import Aut... |
from __future__ import absolute_import
import sys
from django.contrib.auth import authenticate, login, get_backends
from django.core.management.base import BaseCommand
from django.conf import settings
from django_auth_ldap.backend import LDAPBackend, _LDAPUser
# Run this on a cronjob to pick up on name changes.
de... |
import ansible.utils as utils
from ansible.utils import safe_eval
import ansible.errors as errors
from itertools import izip_longest
def flatten(terms):
ret = []
for term in terms:
if isinstance(term, list):
ret.extend(term)
elif isinstance(term, tuple):
ret.extend(term)... |
"""This includes some demos of platypus for use in the API proposal"""
__version__=''' $Id$ '''
import os
from reportlab.lib import colors
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.utils import recursiveImport, strTypes
from reportlab.platypus import... |
def get(prop, choices=None):
prompt = prop.verbose_name
if not prompt:
prompt = prop.name
if choices:
if callable(choices):
choices = choices()
else:
choices = prop.get_choices()
valid = False
while not valid:
if choices:
min = 1
... |
import opentuner
from opentuner import ConfigurationManipulator
from opentuner import IntegerParameter
from opentuner import MeasurementInterface
from opentuner import Result
import time
import sys
import re
class TransposeTune(MeasurementInterface):
def manipulator(self):
"""
Define the search sp... |
import c4d
from c4d import gui
#TakeSystem Example
def main():
takeData = doc.GetTakeData()
if takeData is None:
return
# This code creates a take with an override group for each selected material and adds the object "object" to the newly created group.
obj = doc.GetActiveObject()... |
ZULIP_USER = "<EMAIL>"
ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
# commit_notice_destination() lets you customize where commit notices
# are sent to with the full power of a Python function.
#
# It takes the following arguments:
# * path = the path to the svn repository on the server
# * commit = the commit... |
from __future__ import print_function, absolute_import
import copy
import weakref
from ..anyQt import QtGui, QtCore
#from ... import coralApp
#from ..._coral import ErrorObject
#from . import nodeView
class ConnectionHook(QtGui.QGraphicsItem):
def __init__(self,
parentAttributeUi, mode, shape, s... |
import numpy as np
import pdb
import sys
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers.convolutional import Convolution1D, Convolution2D, MaxPooling2D
from keras.layers.convolutional import Convolution3D, MaxPooling3D
# from keras.layers... |
"""Attention layers that can be used in sequence DNN/CNN models.
This file follows the terminology of https://arxiv.org/abs/1706.03762 Figure 2.
Attention is formed by three tensors: Query, Key and Value.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
... |
#!/usr/bin/env python
import os
import sys
import argparse
#list of known formats here can be added
"""
All format lists were taken from wikipedia, not all of them were added due to extensions
not being exclusive to one format such as webm, or raw
Audio - https://en.wikipedia.org/wiki/Audio_file_format
... |
#!/usr/bin/env python
r""" mglob - enhanced file list expansion module
Use as stand-alone utility (for xargs, `backticks` etc.),
or a globbing library for own python programs. Globbing the sys.argv is something
that almost every Windows script has to perform manually, and this module is here
to help with that task.... |
# -*- test-case-name: openid.test.test_xrires -*-
"""XRI resolution.
"""
from urllib import urlencode
from openid import fetchers
from openid.yadis import etxrd
from openid.yadis.xri import toURINormal
from openid.yadis.services import iterServices
DEFAULT_PROXY = 'http://proxy.xri.net/'
class ProxyResolver(object):... |
"""
The :mod:`sklearn.datasets` module includes utilities to load datasets,
including methods to load and fetch popular reference datasets. It also
features some artificial data generators.
"""
from .base import load_diabetes
from .base import load_digits
from .base import load_files
from .base import load_iris
from .... |
import unittest
import Mariana.layers as ML
import Mariana.initializations as MI
import Mariana.decorators as MD
import Mariana.costs as MC
import Mariana.regularizations as MR
import Mariana.scenari as MS
import Mariana.activations as MA
import theano.tensor as tt
import numpy
class DecoratorTests(unittest.TestCase... |
"""
Classes and functions to manage internal signal hooks and listeners.
arkOS Core
(c) 2016 CitizenWeb
Written by Jacob Cook
Licensed under GPLv3, see LICENSE.md
"""
from arkos import storage, logger
class Listener:
"""
Class representing a signal listener.
A signal listener is set up to track the emi... |
from django.conf import settings
from django.db import models
from django.shortcuts import reverse
from django_pdf.models import PDFModelMixin
from django_pdf import pdf_fields
class Report(PDFModelMixin, models.Model):
title = models.CharField(max_length=255)
introduction = models.CharField(max_length=255)
... |
from case import Case
class Case5_11(Case):
DESCRIPTION = """Send unfragmented Text Message after Continuation Frame with FIN = true, where there is nothing to continue, sent in octet-wise chops."""
EXPECTATION = """The connection is failed immediately, since there is no message to continue."""
def... |
import re
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
def _CreateXpathFunction(xpath):
return ('document.evaluate("%s",'
'document,'
'null,'
'XPathResul... |
import logging
from django.conf import settings
from horizon import exceptions
__all__ = ('APIResourceWrapper', 'APIDictWrapper',
'get_service_from_catalog', 'url_for',)
LOG = logging.getLogger(__name__)
class APIResourceWrapper(object):
""" Simple wrapper for api objects
Define _attrs o... |
"""
Implementation for `pmg config` CLI.
"""
import glob
import os
import shutil
import subprocess
import sys
from urllib.request import urlretrieve
from monty.serialization import dumpfn, loadfn
from pymatgen.core import SETTINGS_FILE
def setup_potcars(args):
"""
Setup POTCAR directirt,
:param args:... |
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# pylint: disable=C0330, R0903, R0912
u"""
flat-table
~~~~~~~~~~
Implementation of the ``flat-table`` reST-directive.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see linux/COPYING for details.
... |
""" Torrent Scrubber Plugin.
"""
from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin, validator
from flexget.event import event
from flexget.plugins.modify.torrent import TorrentFilename
from flexget.utils import bittorrent
log = logging.getLogger('torrent_scru... |
"""The 'grit xmb' tool.
"""
import getopt
import os
from xml.sax import saxutils
from grit import grd_reader
from grit import lazy_re
from grit import tclib
from grit import util
from grit.tool import interface
# Used to collapse presentable content to determine if
# xml:space="preserve" is needed.
_WHITESPACES_RE... |
import os
import subprocess
import ansible.constants as C
from ansible.inventory.host import Host
from ansible.inventory.group import Group
from ansible.module_utils.basic import json_dict_bytes_to_unicode
from ansible import utils
from ansible import errors
import sys
class InventoryScript(object):
''' Host inve... |
import os.path
import configparser
import logging
import traits.api as t
from matplotlib.cm import cmap_d
from hyperspy.misc.config_dir import config_path, os_name, data_path
from hyperspy.misc.ipython_tools import turn_logging_on, turn_logging_off
from hyperspy.ui_registry import add_gui_method
defaults_file = os.p... |
from unittest import mock
from rest_framework import generics, serializers, status
from rest_framework.test import APIRequestFactory
from olympia.amo.tests import TestCase
from olympia.api.pagination import (
CustomPageNumberPagination,
ESPageNumberPagination,
OneOrZeroPageNumberPagination,
)
class Pass... |
"""
OpenERP SXW2RML - The OpenERP's report engine
OpenERP SXW2RML is part of the OpenERP Report Project.
OpenERP Report is a module that allows you to render high quality PDF document
from an OpenOffice template (.sxw) and any relationl database.
"""
__version__ = '0.9'
import re
import string
import os
import zipfi... |
#!/usr/bin/env python3
# For security (and simplicity) reasons, only a limited kind of files can be
# present in /stdlib and /stubs directories, see README for detail. Here we
# verify these constraints.
# In addition, for various reasons we need the contents of certain files to be
# duplicated in two places, for exa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.