content string |
|---|
# encoding: UTF-8
import sys
from time import sleep
from PyQt4 import QtGui
from vnctptd import *
#----------------------------------------------------------------------
def print_dict(d):
"""按照键值打印一个字典"""
for key,value in d.items():
print key + ':' + str(value)
#------------------... |
from weboob.capabilities.torrent import ICapTorrent
from weboob.tools.backend import BaseBackend, BackendConfig
from weboob.tools.value import ValueBackendPassword, Value
from .browser import GazelleBrowser
__all__ = ['GazelleBackend']
class GazelleBackend(BaseBackend, ICapTorrent):
NAME = 'gazelle'
MAINTA... |
__author__ = 'duarte'
from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict
from modules.input_architect import EncodingLayer
from modules.net_architect import Network
from modules.io import set_storage_locations
from modules.signals import iterate_obj_list
from modules.analysis import sin... |
from __future__ import absolute_import
import ctypes
import re
import warnings
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional, Tuple
def glibc_version_string():
# type: () -> Optional[str]
"Returns glibc version string, or None if not using ... |
"""Search interface customizations."""
from __future__ import absolute_import, print_function |
"""
General testing utilities.
"""
import sys
from contextlib import contextmanager
from django.dispatch import Signal
from markupsafe import escape
from mock import Mock, patch
@contextmanager
def nostderr():
"""
ContextManager to suppress stderr messages
http://stackoverflow.com/a/1810086/882918
"""... |
from django.contrib.auth import models as auth_models
from django.utils import encoding
from rest_framework import generics, parsers, renderers, serializers, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework_json_api import utils
from example.api.se... |
#! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... |
from rally.verification.tempest import diff
from tests.unit import test
class DiffTestCase(test.TestCase):
def test_main(self):
results1 = {"test.NONE": {"name": "test.NONE",
"output": "test.NONE",
"status": "SKIPPED",
... |
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
class res_company(osv.osv):
_inherit = 'res.company'
_columns = {
'plafond_secu': fields.float('Plafond de la Securite Sociale', digits_compute=dp.get_precision('Payroll')),
'nombre_employes': fields.integer('No... |
# -*- 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 field 'Page.created'
db.add_column(u'pages_page', 'created',
self.gf('django.... |
import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def ... |
import os
from autotest_lib.client.bin import test, utils
# tests is a simple array of "cmd" "arguments"
tests = [["aio-dio-invalidate-failure", "poo"],
["aio-dio-subblock-eof-read", "eoftest"],
["aio-free-ring-with-bogus-nr-pages", ""],
["aio-io-setup-with-nonwritable-context-pointer", ""]... |
import cgi
import json
import logging
from lxml import etree
import re
import werkzeug.urls
import urllib2
from openerp.osv import osv
from openerp.addons.google_account import TIMEOUT
_logger = logging.getLogger(__name__)
class config(osv.osv):
_inherit = 'google.drive.config'
def get_google_scope(self):
... |
import fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from telemetry.core import command_line
from telemetry.core import discover
from telemetry.util import bootstrap
from telemetry.util import cloud_storage
from telemetry.util ... |
from __future__ import unicode_literals
from operator import attrgetter
from django.test import TestCase
from .models import Post, Question, Answer
class OrderWithRespectToTests(TestCase):
def test_basic(self):
q1 = Question.objects.create(text="Which Beatle starts with the letter 'R'?")
q2 = Q... |
import json
from django.core import exceptions, serializers
from . import PostgresSQLTestCase
from .models import HStoreModel
try:
from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import KeysValidator
except ImportErr... |
#!/usr/bin/env python
from ctypes import *
from ctypes.util import find_library
import sys
import os
# For unix the prefix 'lib' is not considered.
if find_library('svm'):
libsvm = CDLL(find_library('svm'))
elif find_library('libsvm'):
libsvm = CDLL(find_library('libsvm'))
else:
for i, binary in enumerate((
# I... |
#!/usr/bin/env python
# Created by Pearu Peterson, June 2003
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal, assert_array_equal,
assert_array_almost_equal, assert_allclose, assert_raises, TestCase... |
# -*- coding: utf-8 -*-
# Third Party Library Imports
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User
from django.test import RequestFactory, TestCase, override_settings
# First Party Library Imports
from shibauth_rit.compat import reverse
from shibauth_rit... |
import os
import subprocess
import sys
import BaseHTTPServer
import SimpleHTTPServer
import urlparse
import json
# Port to run the HTTP server on for Dromaeo.
TEST_SERVER_PORT = 8192
# Run servo and print / parse the results for a specific Dromaeo module.
def run_servo(servo_exe, tests):
url = "http://localhost... |
"""Unit tests for the retry module."""
from __future__ import absolute_import
import unittest
from builtins import object
from apache_beam.utils import retry
# Protect against environments where apitools library is not available.
# pylint: disable=wrong-import-order, wrong-import-position
# TODO(sourabhbajaj): Remo... |
"""setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwr... |
"""Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <<EMAIL>>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whitespace ch... |
from __future__ import unicode_literals
from frappe.model.document import Document
import frappe
from frappe.utils import getdate
import datetime
class FeeValidity(Document):
pass
def update_fee_validity(fee_validity, date, ref_invoice=None):
max_visit = frappe.db.get_value("Healthcare Settings", None, "max_visit")... |
'''
Created on 2014-11-12
@author: hongye
'''
import psutil
from core import regist_monitor_source
from core.MetricValue import MultiMetricValue, SingleMetricValue
from core.MonitorSource import SampleMonitorSource
class CpuTimesMonitorSource(SampleMonitorSource):
def sample(self, parms):
cpu = psutil.c... |
import copy
from types import GeneratorType
class MergeDict(object):
"""
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
If a key appears in more than one of the given dictionaries, only the
first occurrenc... |
# Python test set -- built-in functions
import test.test_support, unittest
import sys
import pickle
import warnings
warnings.filterwarnings("ignore", "integer argument expected",
DeprecationWarning, "unittest")
class XrangeTest(unittest.TestCase):
def test_xrange(self):
self.asser... |
"""Tests for convnet.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.contrib.kfac import layer_collection as lc
from tensorflow.contrib.kfac.examples import convnet
class ConvNetTest(tf.te... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
parse_iso8601,
int_or_none,
ExtractorError,
)
class TheInterceptIE(InfoExtractor):
_VALID_URL = r'https?://theintercept\.com/fieldofvision/(?P<id>[^/?#]+)'
... |
# -*- coding: utf-8 -*-
"""
Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
This file is part of fiware-pep-steelskin
fiware-pep-steelskin is free software: you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, eithe... |
"""
Wrapper for loading templates from the filesystem.
"""
import errno
import io
import warnings
from django.core.exceptions import SuspiciousFileOperation
from django.template import Origin, TemplateDoesNotExist
from django.utils._os import safe_join
from django.utils.deprecation import RemovedInDjango20Warning
fr... |
"""Helper functions to get data from APIs"""
from __future__ import unicode_literals
import logging
from django.core.cache import cache
from openedx.core.lib.cache_utils import zpickle, zunpickle
log = logging.getLogger(__name__)
def get_fields(fields, response):
"""Extracts desired fields from the API respon... |
from __future__ import division, print_function
import os
import os.path
import pickle
import numpy as np
from pkg_resources import resource_filename
from scipy.interpolate import LinearNDInterpolator as interpnd
try:
import pandas as pd
except ImportError:
pd = None
from isochrones.isochrone import Isochro... |
'''
Shows balancer chosen power limits on each socket over time.
'''
import pandas
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
import sys
import os
import argparse
from experiment import common_args
from experiment import plotting
def plot_lines(traces, label, analysis_dir):
if... |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^validate$', 'casia.cas.views.validate', name='cas_validate'),
url(r'^serviceValidate$', 'casia.cas.views.service_validate',
name='cas_service_validate'),
url(r'^login$', 'casia.cas.views.login', name='cas_login'),
url(... |
from m5.objects import *
# Base implementations of L1, L2, IO and TLB-walker caches. There are
# used in the regressions and also as base components in the
# system-configuration scripts. The values are meant to serve as a
# starting point, and specific parameters can be overridden in the
# specific instantiations.
c... |
from ctypes import c_char
from django.contrib.gis.geos.libgeos import GEOM_PTR, PREPGEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Prepared geometry constructor and destructors.
geos_prepare = GEOSFunc('GEOSPrepare')... |
import logging
import dcm.agent.plugins.api.base as plugin_base
import dcmdocker.utils as docker_utils
_g_logger = logging.getLogger(__name__)
class StartContainer(docker_utils.DockerJob):
protocol_arguments = {
"container": ("", True, str, None),
"port_bindings": ("", False, dict, None),
... |
# -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... |
from __future__ import absolute_import
from __future__ import print_function
import irc.bot
import logging
import re
import ssl
import time
logger = logging.getLogger(__name__)
class PlayBot(irc.bot.SingleServerIRCBot):
def __init__(self, channels, nickname, password, server, port=6667,
force_... |
"""
API views
"""
import hashlib
import itertools
import json
import random
import urllib
from datetime import date, timedelta
from django.core.cache import cache
from django.http import HttpResponse, HttpResponsePermanentRedirect
from django.shortcuts import render
from django.template.context import get_standard_pro... |
{
'name': 'Colombian - Accounting',
'version': '0.8',
'category': 'Localization/Account Charts',
'description': 'Colombian Accounting and Tax Preconfiguration',
'author': 'David Arnold BA HSG (devCO)',
'depends': [
'account',
'base_vat',
'account_chart',
],
'data'... |
#!/usr/bin/env python
from openni import xn
import cv
cvimage = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_8U, 3 )
cvdepth = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_16U, 1 )
cvlabel = cv.CreateImageHeader( (640, 480), cv.IPL_DEPTH_16U, 1 )
# v1 = xn.Version(0, 1, 1, 1)
# v2 = xn.Version(0, 1, 1, 1)
# pri... |
""" Functions providing implementation for CLI commands. """
import logging
import os
import sys
FORMAT = "json"
LOG = logging.getLogger('quantum.client.cli_lib')
class OutputTemplate(object):
""" A class for generating simple templated output.
Based on Python templating mechanism.
Templates can... |
import time
import random
from multiprocessing import Process, Queue, current_process, freeze_support
#
# Function run by worker processes
#
def worker(input, output):
for func, args in iter(input.get, 'STOP'):
result = calculate(func, args)
output.put(result)
#
# Function used to calculate resu... |
import base_gengo_translations
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FreesoundIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?freesound\.org/people/([^/]+)/sounds/(?P<id>[^/]+)'
_TEST = {
'url': 'http://www.freesound.org/people/miklovan/sounds/194503/',
'md5': '1228... |
"""Inplace operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_array_ops
from tensorflow.python.ops import math_ops
de... |
{'name': 'Magento Connector Option Active Products',
'version': '1.0.0',
'category': 'Connector',
'depends': ['magentoerpconnect',
],
'external_dependencies': {},
'author': "initOS GmbH & Co. KG,Odoo Community Association (OCA)",
'license': 'AGPL-3',
'website': 'http://www.odoo-magento-connector.com... |
"""
Twisted Python Roots: an abstract hierarchy representation for Twisted.
Maintainer: Glyph Lefkowitz
"""
# System imports
import types
from twisted.python import reflect
class NotSupportedError(NotImplementedError):
"""
An exception meaning that the tree-manipulation operation
you're attempting to per... |
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.basic import AnsibleModule
from ansible.module_utils.openstack im... |
#!/usr/bin/env python
import numpy as np
import scipy.special
from multiprocessing import Pool
_POISSON = .25
_N_PROCS = 4
def get_flexure_parameter(h, E, n_dim, gamma_mantle=33000.):
"""
Calculate the flexure parameter based on some physical constants. *h* is
the Effective elastic thickness of Earth's... |
"""This script is a command-line client of Online Prediction Framework (OPF).
It executes a single experiment.
"""
from nupic.frameworks.opf.experiment_runner import main
if __name__ == "__main__":
main() |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class account_period_close(osv.osv_memory):
"""
close period
"""
_name = "account.period.close"
_description = "period close"
_columns = {
'sure': fields.boolean('Check this box'),
}
def data_save(sel... |
from oslo_policy import policy
from nova.policies import base
BASE_POLICY_NAME = 'os_compute_api:os-evacuate'
POLICY_ROOT = 'os_compute_api:os-evacuate:%s'
evacuate_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'discoverable',
check_str=base.RULE_ANY),
policy.RuleDefault(
name... |
from flask import Flask, request, redirect, abort
import twilio.twiml
import twilio.rest
import twilio.util
import ConfigParser
import marrow.mailer
import sys
import json
import phonenumbers
config = ConfigParser.ConfigParser()
config.readfp(open('holdtheline.cfg'))
BLOCKED_NUMBERS = config.get('holdtheline', 'blocke... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import hashlib
import json
import socket
import struct
import traceback
import uuid
from functools import partial
from ansible.module_utils._text import to_bytes, to_text
from ansible.module_utils.common.json import Ansi... |
'''
A script to check that the (Linux) executables produced by gitian only contain
allowed gcc, glibc and libstdc++ version symbols. This makes sure they are
still compatible with the minimum supported Linux distribution versions.
Example usage:
find ../gitian-builder/build -type f -executable | xargs python con... |
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the gyp file changes.
"""
import os
import TestGyp
env_stack = []
def PushEnv():
env_copy = os.environ.copy()
env_stack.append(env_copy)
def PopEnv():
os.eniron=env_stack.pop... |
from time import time, mktime, strptime
try:
import Gnuplot
except:
print "Warning: gnuplot not available"
from knxmonitor.Knx.KnxPdu import KnxPdu
from knxmonitor.Knx.KnxAddressStream import KnxAddressStream
from knxmonitor.Knx.KnxAddressCollection import KnxAddressCollection
verbose = True
def printVerbose(str... |
from django.forms import NullBooleanSelect
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class NullBooleanSelectTest(WidgetTest):
widget = NullBooleanSelect()
def test_render_true(self):
self.check_html(self.widget, 'is_cool', True, html=... |
# -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 2 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <<EMAIL>>'
__docformat__ = 'restructuredtext en'
import urllib2
from contextlib import closing
... |
import uuid
from auth_backends.adfs.base import BaseADFS
class HelsinkiLibraryAskoADFS(BaseADFS):
"""Helsinki Libraries' ASKO ADFS authentication backend"""
name = 'helsinki_library_asko_adfs'
AUTHORIZATION_URL = 'https://askofs.lib.hel.fi/adfs/oauth2/authorize'
ACCESS_TOKEN_URL = 'https://askofs.lib... |
"""Mocks for testing.
"""
import Queue
import threading
from mod_pywebsocket import common
from mod_pywebsocket.stream import StreamHixie75
class _MockConnBase(object):
"""Base class of mocks for mod_python.apache.mp_conn.
This enables tests to check what is written to a (mock) mp_conn.
"""
def _... |
from __future__ import absolute_import
import mock
from bokeh.core.validation import check_integrity
from bokeh.models.layouts import LayoutDOM
from bokeh.models.tools import Toolbar, ToolbarBox
# TODO (bev) validate entire list of props
def test_Toolbar():
tb = Toolbar()
assert tb.active_drag == 'auto'
... |
#!/usr/bin/env python
"""Simple Qt4 example to manually test event loop integration.
To run this:
1) Enable the PyDev GUI event loop integration for qt
2) do an execfile on this script
3) ensure you have a working GUI simultaneously with an
interactive console
Ref: Modified from http://zetcode.com/tutorials/pyqt4/... |
"""Diagnose some common system configuration problems on Linux, and
suggest fixes."""
import os
import subprocess
import sys
all_checks = []
def Check(name):
"""Decorator that defines a diagnostic check."""
def wrap(func):
all_checks.append((name, func))
return func
return wrap
@Check("... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.business import CommandExecutionException
from tekton.gae.middleware.json_middleware import JsonResponse
from comportamento_app import facade
def index():
cmd = facade.list_comportamentos_cmd()
comportamento_list... |
from django import shortcuts
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.views import generic
from oscar.core.loading import get_model, get_classes
WeightBandForm, WeightBasedForm = get_classes(
'dashboard.shippin... |
#!/usr/bin/env python3
""" Python3 program which listens to sensor information over the network as port 2208.
The purpose of this server is to collect data and serve queries from other clients.
In the SuperLED project, this acts as a "syslog" server, listening for and recording
data from sensors (access cont... |
"""
Huber Loss Function
-------------------
Figure 8.8
An example of fitting a simple linear model to data which includes outliers
(data is from table 1 of Hogg et al 2010). A comparison of linear regression
using the squared-loss function (equivalent to ordinary least-squares
regression) and the Huber loss function, ... |
{"name": "Transport Information",
"summary": "Transport Information",
"version": "0.1",
"author": "Camptocamp,Odoo Community Association (OCA)",
"category": "Purchase Management",
"license": "AGPL-3",
'complexity': "easy",
"depends": ["purchase",
],
"data": ["view/transport_mode.xml",
"vi... |
"""Keras built-in loss functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Loss functions.
from tensorflow.python.keras._impl.keras.losses import binary_crossentropy
from tensorflow.python.keras._impl.keras.losses import categorical_crossentropy... |
#! /usr/bin/env jython
# -*- coding: utf-8 -*-
"""Preferences for Osmose tool
"""
from javax.swing import JPanel, JLabel, JTextField, JComboBox
from java.awt import GridLayout
from java.lang import Integer, NumberFormatException
class PrefsPanel(JPanel):
"""JPanle with gui for tool preferences
"""
def _... |
from __future__ import absolute_import
from builtins import object
from threadloop import ThreadLoop
import tornado
import tornado.httpclient
from tornado.httputil import url_concat
from .TUDPTransport import TUDPTransport
from concurrent.futures import Future
from thrift.transport.TTransport import TBufferedTransport
... |
"""Feed-forward Layers (not includeing ConvNet Layer)
This module contains feedforward layers for
+ Identity layer
+ Tanh layer
+ Sigmoid layer
+ ReLU layer
+ Softmax layer
"""
import theano.tensor as T;
import telaugesa.nnfuns as nnfuns;
from telaugesa.layer import Layer;
class IdentityLayer(Layer):
"""Ident... |
from cinderclient import base
from cinderclient import utils
class Extension(utils.HookableMixin):
"""Extension descriptor."""
SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
def __init__(self, name, module):
self.name = name
self.module = module
self._parse_exten... |
import os
import getpass
import psycopg2
from sets import Set
# Error threshold
eps = 0.5
# Get the environment variables
DBNAME = os.environ['DBNAME']
PGUSER = os.environ['PGUSER']
PGPASSWORD = os.environ['PGPASSWORD']
PGHOST = os.environ['PGHOST']
PGPORT = os.environ['PGPORT']
# Stanfard status
std = dict([])
st... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'curated'}
from ansible.module_utils.basic import *
from ansible.module_utils.azure_rm_common import *
try:
from msrestazure.azure_exceptions import CloudError
from azure.common impor... |
"""Tests for regularizers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.layers.python.layers import regularizers
from tensorflow.python.client import session
from tensorflow.python.framework import constant_... |
import nflgame
import math
import operator
from classes.league import *
from scipy.stats.stats import pearsonr
def statistical_correlation(statistics, performances):
stats_a = []
stats_b = []
for performance in performances:
stats_a.append(performance.statistics[statistics[0]])
stats_b.append(performance.statis... |
from optparse import OptionParser
from boto.services.servicedef import ServiceDef
from boto.services.submit import Submitter
from boto.services.result import ResultProcessor
import boto
import sys, os, StringIO
class BS(object):
Usage = "usage: %prog [options] config_file command"
Commands = {'reset' : 'Clea... |
"""
JP-specific Form helpers
"""
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japanese postcode.
Accepts 7 digits, wit... |
"""
Views for displaying database backups.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables as horizon_tables
from horizon.utils import filters
from horizon import views as horizon_views
from horizon impor... |
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Flavors(horizon.Panel):
name = _("Flavors")
slug = 'flavors'
permissions = ('openstack.services.compute',)
dashboard.Admin.register(Flavors) |
"""
RenderTarget
Copyright (c) 2015 tobspr <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... |
from msrest.serialization import Model
class UsageName(Model):
"""The Usage Names.
:param value: Gets a string describing the resource name.
:type value: str
:param localized_value: Gets a localized string describing the resource
name.
:type localized_value: str
"""
_attribute_map =... |
"""Support for Freebox devices (Freebox v6 and Freebox mini 4K)."""
from datetime import datetime
from typing import Dict
from homeassistant.components.device_tracker import SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.config_entries import Config... |
"""ES function to submit Celery tasks."""
from invenio.celery import celery
@celery.task
def index_records(sender, recid):
"""Celery function to index records."""
from flask import current_app
current_app.extensions.get("elasticsearch").index_records([recid])
#TODO: get_text seems async should be rep... |
"""
SQL functions reference lists:
http://www.gaia-gis.it/spatialite-2.4.0/spatialite-sql-2.4.html
http://www.gaia-gis.it/spatialite-3.0.0-BETA/spatialite-sql-3.0.0.html
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.1.html
"""
import re
import sys
from django.contrib.gis.db.backends.base.operations import \
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: vmware_host_config_facts
deprecated:
removed_in: '2.13'
why: Deprecated in favo... |
from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
mes... |
"""Module for managing the VARP configuration in EOS
This module provides an API for configuring VARP resources using
EOS and eAPI.
Arguments:
name (string): The interface name the configuration is in reference
to. The interface name is the full interface identifier
address (string): The interface I... |
# -*- encoding: utf-8 -*-
from abjad.tools import stringtools
from abjad.tools.lilypondparsertools.Music import Music
class ContextSpeccedMusic(Music):
r'''Abjad model of the LilyPond AST context-specced music node.
'''
### CLASS VARIABLES ###
__slots__ = (
#'context',
'context_name'... |
from twisted.internet import reactor, defer
from twisted.python import failure
from twisted.names import client, dns, error, server
import ConfigParser
import logging
import os
import time
import datetime
import socket
import signal
from twisted.internet.address import IPv4Address
import MySQLdb
class DynDDServerFac... |
from .requests_ntlm2 import HttpNtlm2Auth
from .exceptions import InvalidCredentialsError, NtlmAuthenticationError
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
... |
#-- GAUDI jobOptions generated on Fri Jul 17 16:30:35 2015
#-- Contains event types :
#-- 11102202 - 178 files - 3032774 events - 655.11 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
DTrace/SystemTAP backend.
"""
__author__ = "Lluís Vilanova <<EMAIL>>"
__copyright__ = "Copyright 2012, Lluís Vilanova <<EMAIL>>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ = "<EMAIL>"
... |
# encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .cbs import CBSBaseIE
from ..utils import (
parse_duration,
)
class CBSNewsIE(CBSBaseIE):
IE_DESC = 'CBS News'
_VALID_URL = r'https?://(?:www\.)?cbsnews\.com/(?:news|videos)/(?P<id>[\da-z_-]+)'
_TESTS = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.