content string |
|---|
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from horizon.templatetags import sizeformat
class AdminHypervisorsTable(tables.DataTable):
hostname = tables.WrappingColumn("hypervisor_hostname",
link="horizon:admin:hypervisors:detail",
... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : TopoViewer plugin for DB Manager
Description : Create a project to display topology schema on Qgis
Date : Sep 23, 2011
copyright : (C) 2011 by Giuseppe Suc... |
#!/usr/bin/python3
"""
Python script for finding PHP vulnerabilities and coding errors.
TODO
KNOWN ISSUES
Only supports variable assignment on a single line.
Only supports function declaration on a single line.
Does not support code outside functions after function declarations start.
Does not support variables ... |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter
class QuickshareCzFolder(Crypter):
__name__ = "QuickshareCzFolder"
__type__ = "crypter"
__version__ = "0.12"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?quickshare\.cz/slozka-\d+'
__confi... |
# Django settings for example project.
import django
from os.path import join, dirname, realpath
SRC_DIR = dirname(dirname(realpath(__file__)))
# Add parent path,
# Allow starting the app without installing the module.
import sys
sys.path.insert(0, dirname(SRC_DIR))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
... |
#!/usr/bin/env python
#
# Wrapper script for starting the biopet-sampleconfig JAR package
#
# This script is written for use with the Conda package manager and is copied
# from the peptide-shaker wrapper. Only the parameters are changed.
# (https://github.com/bioconda/bioconda-recipes/blob/master/recipes/peptide-shaker... |
#!/usr/bin/env python3
"""Generate an updated requirements_all.txt."""
import importlib
import os
import pkgutil
import re
import sys
COMMENT_REQUIREMENTS = (
'RPi.GPIO',
'rpi-rf',
'Adafruit_Python_DHT',
'fritzconnection',
'pybluez',
'bluepy',
'python-lirc',
'gattlib',
'pyuserinput'... |
"""
This module houses the ctypes function prototypes for GDAL DataSource (raster)
related data structures.
"""
from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p
from functools import partial
from django.contrib.gis.gdal.libgdal import GDAL_VERSION, std_call
from django.contrib.gis.gdal.prototypes.genera... |
import time
import os
from balsa import get_logger
import propmtime
import test_propmtime
log = get_logger("test_propmtime")
def get_mtimes(root_folder, file_path):
root_mtime = os.path.getmtime(root_folder)
file_mtime = os.path.getmtime(file_path)
log.info('%s mtime : %f' % (root_folder, root_mtime))
... |
from PyObjCTools.TestSupport import *
from CoreFoundation import *
try:
long
except NameError:
long = int
class TestNotificationCenter (TestCase):
def testTypes(self):
self.assertIsCFType(CFNotificationCenterRef)
def testTypeID(self):
self.assertIsInstance(CFNotificationCenterGetTy... |
'''Library to support geographical visualization.'''
import folium
import geopandas as gpd
import pandas as pd
import shapely.geometry as geom
from shapely.geometry import Polygon, Point, LineString
from typing import Tuple, Sequence, Optional, Dict, Text
import sys
import os
sys.path.append(os.path.dirname(os.path.... |
from __future__ import absolute_import
import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
... |
__all__ = ['PlayerOptionsDialog']
# imports
import Tkinter
# PySol imports
from pysollib.mfxutil import KwStruct, Struct
# Toolkit imports
from tkwidget import MfxDialog
from tkutil import bind
# ************************************************************************
# *
# ****************************************... |
__author__ = 'salvia'
import pickle
class ICPProtocolException(Exception):
pass
class BaseIPCProtocol(object):
"""
Class which handles how the data is passed through the socket.
This base class implements a very simple mechanism of pickling objects and
prefixing the message with `HEADER_SIZE` h... |
"""Write the theme xml based on a fixed string."""
# package imports
from ..shared.xmltools import fromstring, get_document_content
def write_theme():
"""Write the theme xml."""
xml_node = fromstring(
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n'
'<a:theme xmlns:a="http... |
"""Extends BaseHTTPRequestHandler with SSL certificate generation."""
import logging
import socket
import certutils
class SslHandshakeHandler:
"""Handles Server Name Indication (SNI) using dummy certs."""
def setup(self):
"""Sets up connection providing the certificate to the client."""
# One of: One o... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.data
~~~~~~~~~~~~~~~~~~~~
Lexers for data file format.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, LexerContext, \
... |
import ps_list
import ps_form
""" A special report, that is automatically formatted to look like the
screen contents of Form/List Views.
"""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
import logging
import time
import slackweb
WEBHOOK = None
logging.config.fileConfig('log.config')
logger = logging.getLogger('slackLogger')
def message(title, link):
attachments = [
{
'fallback': 'Save links to Evernote.',
'color': 'good',
'title': title,
... |
"""
termcolors.py
"""
from django.utils import six
color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
foreground = {color_names[x]: '3%s' % x for x in range(8)}
background = {color_names[x]: '4%s' % x for x in range(8)}
RESET = '0'
opt_dict = {'bold': '1', 'underscore': '4', 'blink... |
import create_bwc_index
import logging
import os
import random
import shutil
import subprocess
import sys
import tempfile
def fetch_version(version):
logging.info('fetching ES version %s' % version)
if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ... |
# encoding: utf-8
import datetime
import south.db
from south.db import dbs
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MachineConfig'
db = dbs['stats']
db.dry_run = south.db.db.dry_run
... |
import b2.build.type as type
import b2.build.generators as generators
import b2.build.virtual_target as virtual_target
import b2.build.toolset as toolset
import b2.build.targets as targets
from b2.manager import get_manager
from b2.util import bjam_signature
type.register("NOTFILE_MAIN")
class NotfileGenerator(gener... |
from muntjac.demo.sampler.APIResource import APIResource
from muntjac.demo.sampler.Feature import Feature, Version
from muntjac.terminal.gwt.server.web_browser import WebBrowser
class BrowserInformation(Feature):
def getDescription(self):
return ('Browser differences are mostly hidden by Muntjac but in s... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a de julio 1887'
TIME_FORMAT = 'H:i' # '18:59'
DATETIME_FORMAT = r'j\-\a \d\e F Y\,... |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Reporter(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField(... |
# -*- coding: utf-8 -*-
""" Update an Attendify schedule XLSX file with the currently accepted
talks.
Usage: manage.py attendify_schedule_xlsx ep2016 schedule.xlsx
Note that for Attendify you have to download the schedule before
running this script, since they add meta data to the downloaded
file ... |
from __future__ import unicode_literals
template = {
"Resources": {
"HostedZone": {
"Type": "AWS::Route53::HostedZone",
"Properties": {"Name": "my_zone"},
},
"my_health_check": {
"Type": "AWS::Route53::HealthCheck",
"Properties": {
... |
from openerp.workflow.service import WorkflowService
# The new API is in openerp.workflow.workflow_service
# OLD API of the Workflow
def clear_cache(cr, uid):
WorkflowService.clear_cache(cr.dbname)
def trg_write(uid, res_type, res_id, cr):
"""
Reevaluates the specified workflow instance. Thus if any cond... |
# This is the Twisted Fast Poetry Server, version 3.0
from zope.interface import implements
from twisted.python import usage, log
from twisted.plugin import IPlugin
from twisted.internet.protocol import ServerFactory, Protocol
from twisted.application import internet, service
# Normally we would import these classe... |
from openerp.osv import fields, osv
class purchase_config_settings(osv.osv_memory):
_inherit = 'purchase.config.settings'
_columns = {
'limit_amount': fields.integer('limit to require a second approval',required=True,
help="Amount after which validation of purchase is required."),
}
... |
"""Plot the mass and stiffness data from Sandia and VABS.
First, data from mass and stiffness matrices for the Sandia blade are written
to the file 'sandia_blade/blade_props_from_VABS.csv'
Then, these data are plotted against published data from Griffith & Resor 2011.
Usage
-----
Open an IPython terminal an... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: meraki_mr_l3_firewall
short_description: Manage MR access point layer 3 firewalls in t... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import pipes
import tempfile
from ansible import constants as C
from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean
from ansible.utils.hashing import checksum
from ansible.... |
""" Sahana Eden Automated Test - ORG010 Change User Roles
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 wi... |
#!/usr/bin/env python
from setuptools import setup
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = ""
packages = [
'editor'
]
requires = [
'numpy>=1.12.1'
'Kivy>=1.10.0'
'pillow>=2.1.0'
'cython'
]
setup(
... |
import pytest
from unittest import mock
from django.core.urlresolvers import reverse
from django.core import mail
from taiga.base.utils import json
from taiga.hooks.github import event_hooks
from taiga.hooks.github.api import GitHubViewSet
from taiga.hooks.exceptions import ActionSyntaxException
from taiga.projects.... |
{
'name': 'Guatemala - Accounting',
'version': '3.0',
'category': 'Localization/Account Charts',
'description': """
This is the base module to manage the accounting chart for Guatemala.
=====================================================================
Agrega una nomenclatura contable para Guatemala... |
from __future__ import nested_scopes
import re
from escape import utf8decode, SAFE_ASCII_DEC_SPECIAL_RE
from util import apply_target_encoding, str_util
from canvas import TextCanvas
try: True # old python?
except: False, True = 0, 1
def separate_glyphs(gdata, height):
"""return (dictionary of glyphs, utf8 requ... |
# -*- coding: utf-8 -*-
import unittest
from sorl.thumbnail.helpers import ThumbnailError
from sorl.thumbnail.parsers import parse_crop, parse_geometry
class CropParserTestCase(unittest.TestCase):
def test_alias_crop(self):
crop = parse_crop('center', (500, 500), (400, 400))
self.assertEqual(crop... |
"""
=================================
Gaussian Mixture Model Sine Curve
=================================
This example demonstrates the behavior of Gaussian mixture models fit on data
that was not sampled from a mixture of Gaussian random variables. The dataset
is formed by 100 points loosely spaced following a noisy ... |
"""
Defines an interface which all Auth handlers need to implement.
"""
from plugin import Plugin
class NotReadyToAuthenticate(Exception):
pass
class AuthHandler(Plugin):
capability = []
def __init__(self, host, config, provider):
"""Constructs the handlers.
:type host: string
:pa... |
"""
Clickjacking Protection Middleware.
This module provides a middleware that implements protection against a
malicious site loading resources from your site in a hidden frame.
"""
from django.conf import settings
from django.utils.deprecation import MiddlewareMixin
class XFrameOptionsMiddleware(MiddlewareMixin):
... |
from PWGJE.EMCALJetTasks.Tracks.analysis.base.Helper import NormaliseBinWidth
from PWGJE.EMCALJetTasks.Tracks.analysis.base.struct.ClusterTHnSparse import ClusterTHnSparseNew, ClusterTHnSparseOld
from PWGJE.EMCALJetTasks.Tracks.analysis.base.struct.TrackTHnSparse import TrackTHnSparseNew, TrackTHnSparseOld
from PWGJE.E... |
from __future__ import unicode_literals
import os
from subprocess import PIPE, Popen
import sys
from django.utils.encoding import force_text, DEFAULT_LOCALE_ENCODING
from django.utils import six
from .base import CommandError
def popen_wrapper(args, os_err_exc_type=CommandError):
"""
Friendly wrapper aroun... |
{
'name': 'CRM',
'version': '1.0',
'category': 'Customer Relationship Management',
'sequence': 2,
'summary': 'Leads, Opportunities, Phone Calls',
'description': """
The generic OpenERP Customer Relationship Management
====================================================
This application enables... |
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
)
class ARDIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:(?:www\.)?ardmediathek\.de|mediathek\.daserste\.de)/(?:.*/)(?P<video_id>[^/\?]+)(?:\?.*)?'
_TITLE = r'<h1(?: class="boxTopHeadline")?>(?P<title>.*)</h1>'
_ME... |
#! /usr/bin/env python
# Sample input data (piped into STDIN):
'''
118238@10 Sen.~^~Barack~^~Obama~^~and~^~his~^~wife~^~,~^~Michelle~^~Obama~^~,~^~have~^~released~^~eight~^~years~^~of~^~joint~^~returns~^~. O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~O~^~PERSON~^~PERSON~^~O~^~O~^~O~^~DURATION~^~DURATION~^~O~^~O~^~O~^~O
118238@12... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.parameters
~~~~~~~~~~~~~~~~~~~
This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec.
.. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5
"""
from urlparse import urlparse, urlunparse
from . import util... |
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
import mysql.connector
import pickle
import math
instrument = 'UBCSP2' #'UBCSP2' #ECSP2
instrument_locn = 'WHI' #'WHI' POLAR6
#this script will run through all the .ptxt files for the WHI data and put the info into the m... |
'''
Dumper is an extremely simple postprocessor file for the Path workbench. It is used
to dump the command list from one or more Path objects for simple inspection. This post
doesn't do any manipulation of the path and doesn't write anything to disk. It just
shows the dialog so you can see it. Useful for debugging... |
"""
Helper methods for use in profile image tests.
"""
from contextlib import contextmanager
import os
from tempfile import NamedTemporaryFile
from django.core.files.uploadedfile import UploadedFile
from PIL import Image
@contextmanager
def make_image_file(dimensions=(320, 240), extension=".jpeg", force_size=None):
... |
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
int_or_none,
str_to_int,
)
from ..aes import aes_decrypt_text
class Tube8IE(InfoExtractor):
_VALID_U... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ... |
"""Regularizers for use with layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numbers
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorflo... |
import unittest
import sqlite3 as sqlite
def func_returntext():
return "foo"
def func_returnunicode():
return u"bar"
def func_returnint():
return 42
def func_returnfloat():
return 3.14
def func_returnnull():
return None
def func_returnblob():
return buffer("blob")
def func_return... |
def filter_by_keywords(self, keywords_values_dict):
"""
Filter the rows based on dictionary of {"keyword":"value"}(applying 'and' operation on dictionary) from column holding xml string
Ex: keywords_values_dict -> {"SOPInstanceUID":"1.3.6.1.4.1.14519.5.2.1.7308.2101.234736319276602547946349519685", "Manufa... |
from __future__ import unicode_literals
from .common import InfoExtractor
from .zdf import extract_from_xml_url
class PhoenixIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?phoenix\.de/content/
(?:
phoenix/die_sendungen/(?:[^/]+/)?
)?
(?P<id>[0-9]+)'''
_TESTS = ... |
import copy
import logging
import time
import unittest2 as unittest
import cPickle
import numpy
from nupic.regions.PyRegion import RealNumpyDType
from nupic.algorithms.KNNClassifier import KNNClassifier
import pca_knn_data
LOGGER = logging.getLogger(__name__)
class KNNClassifierTest(unittest.TestCase):
"""Test... |
import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... |
from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
"""
Runs the bindings code generator for the given tasks.
"""
import optparse
import sys
import bind_gen
import web_idl
def parse_options():
parser = optparse.OptionParser(usage="%prog [options] TASK...")
parser.add_option("--web_idl_database", type="string",
help="filepath of the inpu... |
"""SCons.Warnings
This file implements the warnings framework for SCons.
"""
__revision__ = "src/engine/SCons/Warnings.py 5134 2010/08/16 23:02:40 bdeegan"
import sys
import SCons.Errors
class Warning(SCons.Errors.UserError):
pass
class WarningOnByDefault(Warning):
pass
# NOTE: If you add a new warnin... |
import mock
from datetime import datetime, timedelta
from nose.tools import * # noqa
from tests.base import OsfTestCase
from tests.factories import UserFactory
from scripts.triggered_mails import main, find_inactive_users_with_no_inactivity_email_sent_or_queued
from website import mails
class TestTriggeredMails(OsfT... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, 7):
pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from librar... |
#!/usr/bin/env python
"""Python-Pinboard
Python script for downloading your saved stories and saved comments on Hacker News
and converting them to a JSON format for easy use.
Originally written on Pythonista on iPad
"""
__version__ = "1.1"
__license__ = "BSD"
__copyright__ = "Copyright 2013-2014, Luciano Fiandesio"
... |
''' opts_unittest.py '''
import unittest2 as unittest
import heron.tools.cli.src.python.opts as opts
#pylint: disable=missing-docstring, no-self-use
class OptsTest(unittest.TestCase):
def setUp(self):
pass
def test_one_opt(self):
opts.clear_config()
opts.set_config('XX', 'xx')
self.assertEqual('x... |
"""Commandline scripts.
These scripts are called by the executables defined in setup.py.
"""
from __future__ import with_statement, print_function
import abc
import sys
from optparse import OptionParser
import rsa
import rsa.bigfile
import rsa.pkcs1
HASH_METHODS = sorted(rsa.pkcs1.HASH_METHODS.keys())
def keygen... |
from __future__ import print_function
# $example on$
from pyspark.ml.feature import PolynomialExpansion
from pyspark.ml.linalg import Vectors
# $example off$
from pyspark.sql import SparkSession
if __name__ == "__main__":
spark = SparkSession\
.builder\
.appName("PolynomialExpansionExample")\
... |
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... |
import unittest
class Empty(Exception):
pass
class Stack:
class _Node:
__slots__ = '_element', '_next'
def __init__(self, e, n):
self._element = e
self._next = n
def __init__(self):
self._head = self._Node(None, None)
self._length = 0
def __len... |
"""Functional tests for Pack Op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors_impl
fr... |
import mock
from os_brick.initiator import connector
from nova.tests.unit.virt.libvirt.volume import test_volume
from nova.virt.libvirt.volume import hgst
# Actual testing of the os_brick HGST driver done in the os_brick testcases
# Here we're concerned only with the small API shim that connects Nova
# so these wil... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
def main():
module = AnsibleModule(
argument_spec=dict(
list_all=dict(required=False, type='bool', default=False),
name=dict(type='str'),
... |
def should_throw(parser, harness, message, code):
parser = parser.reset();
threw = False
try:
parser.parse(code)
parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown: %s" % message)
def WebIDLTest(parser, harness):
# The [LenientSetter] extended a... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
# TODO: Disabled RETURN as it is breaking the build for docs. Needs to be fixed.
import json
... |
import cgi
import urllib, urllib2, Cookie
import cookielib
import re
import logging
from urlparse import urlparse
from django.utils import simplejson
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import... |
# coding: utf-8
import logging
import os
import tempfile
from django.conf import settings
from django.core.mail.message import EmailMessage
from excel_renderer import ExcelRenderer
log = logging.getLogger(__name__)
class GenerateExcelSheet:
def __init__(self, shifts, mailer):
if not shifts:
... |
import os
import imp
from nupic.data.dictutils import rUpdate
# This file contains utility functions that are used
# internally by the prediction framework and may be imported
# by description files. Functions that are used only by
# the prediction framework should be in utils.py
#
# This file provides support for t... |
"""
Author: Armon Dadgar
Date: June 11th, 2009
Description:
This simple script reads "code" from stdin, and runs safe.safe_check() on it.
The resulting return value or exception is serialized and written to stdout.
The purpose of this script is to be called from the main repy.py script so that the
memory used b... |
"""Tests for our `watches just_indices_stats` subcommand."""
import json
from subprocess import PIPE, Popen as popen
from secure_support import TestSecureSupport
class TestJustIndicesStats(TestSecureSupport):
def test_returns_index_per_line(self):
cmd = self.appendSecurityCommands(['watches', 'just_ind... |
"""Application factory."""
import tornado.web
import tornado.locale
import teamomatic.handlers
import logging
import os
# Routing table.
routes = [
(r'/', teamomatic.handlers.IndexHandler)
]
def create_app(config=None):
"""Instantiates and initializes the app according to config dict."""
if config == Non... |
"""Tests for the routing function op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.tensor_forest.hybrid.ops import gen_training_ops
from tensorflow.contrib.tensor_forest.hybrid.python.ops import training_ops
from tensorflow.cont... |
"""CherryPy tools. A "tool" is any helper, adapted to CP.
Tools are usually designed to be used in a variety of ways (although some
may only offer one if they choose):
Library calls
All tools are callables that can be used wherever needed.
The arguments are straightforward and should be detailed w... |
#!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test download.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1. examine the resu... |
"""DenseNet, implemented in Gluon."""
__all__ = ['DenseNet', 'densenet121', 'densenet161', 'densenet169', 'densenet201']
from ....context import cpu
from ...block import HybridBlock
from ... import nn
from ..custom_layers import HybridConcurrent, Identity
# Helpers
def _make_dense_block(num_layers, bn_size, growth_ra... |
"""Interface to handle end to end flow of U2F signing."""
import sys
class BaseAuthenticator(object):
"""Interface to handle end to end flow of U2F signing."""
def Authenticate(self, app_id, challenge_data,
print_callback=sys.stderr.write):
"""Authenticates app_id with a security key.
... |
from data import Access, Entry, EntryError
from Queue import Queue
class EntryQueue(Queue):
def __init__(self, transverse, maxsize=0):
self.reddit = transverse.reddit
self.events = transverse.events
Queue.__init__(self, maxsize)
def _init(self, maxsize):
Queue._init(self, maxs... |
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
clas... |
from __future__ import print_function
import sys
from random import Random
from pyspark.sql import SparkSession
numEdges = 200
numVertices = 100
rand = Random(42)
def generateGraph():
edges = set()
while len(edges) < numEdges:
src = rand.randrange(0, numVertices)
dst = rand.randrange(0, num... |
"""Python wrappers for training ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.training import gen_training_ops
# pylint: disabl... |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
from functools import partial
from PyQt5.Qt import QIcon, Qt
from calibre.gui2.actions import InterfaceAction
from calibre.gui2.prefe... |
#!/usr/bin/env python2
from distutils.core import setup, Extension
import os
import subprocess
import sys
def pkg_config(package):
if os.name == "nt":
if package == "MagickCore":
# pkg-config cannot be used, try to find needed libraries from the filesystem
import fnmatch
... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.netscaler import ConfigProxy, get_nitro_client, netscaler_common_arguments, log, loglines, get_immu... |
"""
Component to interface with binary sensors.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.helpers.entity_component import EntityComponen... |
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.org/issue5752
TODO(bradnelson): Consider dropping this when we drop XP support.
"""
import xml.dom.minidom
def _Replacement_write_data(writer, data, is_att... |
import wizard
import base_report_designer
import installer
import openerp_sxw2rml
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
"""
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... |
"""
@author: Andrew Case
@license: GNU General Public License 2.0
@contact: <EMAIL>
@organization:
"""
import socket
import volatility.obj as obj
import volatility.plugins.linux.common as linux_common
import volatility.plugins.linux.lsof as linux_lsof
import volatility.plugins.linux.pslist as linux_ps... |
from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_field_type(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.