content stringlengths 4 20k |
|---|
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.loadbalancers import tables
class PoolsTab(tabs.TableTab):
table_classes = (tables.PoolsTable,)
name = _("Pools")
... |
import re
from django.conf import settings
from django.http import HttpResponsePermanentRedirect
from django.utils.deprecation import MiddlewareMixin
class SecurityMiddleware(MiddlewareMixin):
def __init__(self, get_response=None):
self.sts_seconds = settings.SECURE_HSTS_SECONDS
self.sts_include_... |
# encoding: 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):
# Removing unique constraint on 'Executable', fields ['name']
db.delete_unique('codespeed_executable', ['n... |
# -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES
from django.contrib.localflavor.es.es_regions import REGION_CHOICES
from django.core.validators import EMPTY_VALUES
... |
"""find all related objects - skiping extensible fields
this script is to assist in further coding - not for end user
Will assist in:
- discovering useful functions to add to EpBunch using addfunctions
"""
# was designed to run from ../../docs
# to run from here change some of the file paths below
# run as
# python... |
"""Skeleton for 'StringIO' stdlib module."""
import StringIO as _StringIO
class StringIO(object):
"""Reads and writes a string buffer (also known as memory files)."""
def __init__(self, buffer=None):
"""When a StringIO object is created, it can be initialized to an existing
string by passin... |
#pylint: disable=no-init,too-few-public-methods
from __future__ import (absolute_import, division, print_function)
import stresstesting
from mantid.api import AnalysisDataService
from ISISCommandInterface import *
from SANSBatchMode import *
# test batch mode with sans2d and selecting a period in batch mode
class ... |
#!/usr/bin/env python
# by teknohog
# Python wrapper for Xilinx Serial Miner
user = "teknohog.spartan"
password = "nexys2"
host = "api2.bitcoin.cz"
http_port = "8332"
serial_port = "/dev/ttyS0"
askrate = 5
###############################################################################
from jsonrpc import Service... |
try:
import collections
from pyVmomi import vim, vmodl
HAS_PYVMOMI = True
except ImportError:
HAS_PYVMOMI = False
class VMwareDvsHost(object):
def __init__(self, module):
self.module = module
self.dv_switch = None
self.uplink_portgroup = None
self.host = None
... |
"""
Discrete Fourier Transforms - basic.py
"""
# Created by Pearu Peterson, August,September 2002
from __future__ import division, print_function, absolute_import
__all__ = ['fft','ifft','fftn','ifftn','rfft','irfft',
'fft2','ifft2']
from numpy import zeros, swapaxes
import numpy
from . import _fftpack
im... |
"""brainfuck interpreter adapted from (public domain) code at
http://brainfuck.sourceforge.net/brain.py"""
import re
import asyncio
import random
from cloudbot import hook
BUFFER_SIZE = 5000
MAX_STEPS = 1000000
@asyncio.coroutine
@hook.command("brainfuck", "bf")
def bf(text):
"""<prog> - executes <prog> as Bra... |
import unittest
from datetime import datetime, timedelta
from fs.memoryfs import MemoryFS
from mock import Mock, patch
from xblock.runtime import KvsFieldData, DictKeyValueStore
import xmodule.course_module
from xmodule.modulestore.xml import ImportSystem, XMLModuleStore
from opaque_keys.edx.locations import SlashS... |
class SimpleResultSet(list):
"""
ResultSet facade built from a simple list, rather than via XML parsing.
"""
def __init__(self, input_list):
for x in input_list:
self.append(x)
self.is_truncated = False |
"""
Support for Tellstick switches using Tellstick Net.
This platform uses the Telldus Live online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.tellduslive/
"""
import logging
from homeassistant.components.tellduslive import TelldusL... |
#!/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 compare_rendered_pictures.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1.... |
from odoo import models
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
def _compute_is_mto(self):
super(SaleOrderLine, self)._compute_is_mto()
for line in self:
if not line.display_qty_widget or line.is_mto:
continue
product_routes = li... |
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
from error import *
from nodes import *
import datetime
try:
set
except NameError:
from sets import Set as set
import sys, copy_reg, types
class RepresenterError(YAMLError):
pass
class BaseRepresenter(object):
... |
"""
Additive Wave
by Daniel Shiffman.
(Rewritten in Python by Jonathan Feinberg.)
Create a more complex wave by adding two waves together.
"""
xspacing = 8 # How far apart should each horizontal location be spaced
maxwaves = 4 # total # of waves to add together
amplitude = [] # Height of wave
dx = [] ... |
import sys
import rclpy
from time import sleep
from std_msgs.msg import String
from example_interfaces.srv import AddTwoInts
node = None
def cleanup():
global node
node.destroy_node()
rclpy.shutdown()
def callback(request, response):
response.sum = request.a + request.b
return response
def main():
globa... |
"""
This module contains the following classes:
* :class:`~aeneas.language.Language`, an enumeration of the supported languages.
"""
class Language(object):
"""
Enumeration of the supported languages.
A language is supported by ``aeneas`` if at least one of the built-in
TTS engine wrappers supports ... |
# -*- coding: utf-8 -*-
"""
@author: Fabio Erculiani <<EMAIL>>
@contact: <EMAIL>
@copyright: Fabio Erculiani
@license: GPL-2
B{Entropy Command Line Client}.
"""
import sys
import argparse
from entropy.i18n import _
from entropy.output import darkred, blue, brown, darkgreen
from entropy.client.i... |
import os
import dbus.service
from coalib.output.dbus.DbusApp import DbusApp
class DbusServer(dbus.service.Object):
interface = "org.coala_analyzer.v1"
def __init__(self, bus, path, on_disconnected=None):
"""
Creates a new DbusServer class which handles the dynamic creation and
dispo... |
from __future__ import absolute_import, division, print_function
import os
import pytest
from cryptography.hazmat.primitives import hashes
from .utils import generate_hash_test, generate_long_string_hash_test
from ...utils import load_hash_vectors
@pytest.mark.supported(
only_if=lambda backend: backend.hash_s... |
#!/usr/bin/env python3
import os
import re
SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src'))
libs = [
'libbitcoin_cli',
'libbitcoin_common',
'libbitcoin_crypto',
'libbitcoin_server',
'libbitcoin_util',
'libbitcoin_wallet',
'libbitcoin_zmq',
]
ignore_list ... |
from __future__ import unicode_literals
import os
import shutil
import tempfile
import unittest
from StringIO import StringIO
from mozunit import main
from mozbuild.controller.clobber import Clobberer
from mozbuild.controller.clobber import main as clobber
class TestClobberer(unittest.TestCase):
def setUp(sel... |
# -*- encoding: utf-8 -*-
"""Implements different locators for UI"""
from selenium.webdriver.common.by import By
from .model import LocatorDict
locators = LocatorDict({
# Login
"login.username": (By.ID, 'username'),
"login.password": (By.ID, 'password'),
"login.submit": (By.ID, '_eventId_submit'),
... |
import regex
def separate_string(string):
"""
>>> separate_string("test <2>")
(['test ', ''], ['2'])
"""
string_list = regex.split(r'<(?![!=])', regex.sub(r'>', '<', string))
return string_list[::2], string_list[1::2] # Returns even and odd elements
def overlapping(start1, end1, start2, end2... |
from __future__ import unicode_literals
import copy
import pickle
import sys
from unittest import TestCase
from django.utils import six
from django.utils.functional import LazyObject, SimpleLazyObject, empty
class Foo(object):
"""
A simple class with just one attribute.
"""
foo = 'bar'
def __eq... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.project.images_and_snapshots \
.images.tables import (ImagesTable, CreateImage, EditImage,
DeleteImage)
class AdminCreateImage(CreateImage):
url = "horizon:project:image... |
"""Tests for the GroupByWindow serialization."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.data.experimental.kernel_tests.serialization import dataset_serialization_test_base
from tensorflow.python.data.experi... |
"""SiteCompare module for simulating mouse input.
This module contains functions that can be used to simulate a user
navigating using a pointing device. This includes mouse movement,
clicking with any button, and dragging.
"""
import time # for sleep
import win32api # for mouse_event
impo... |
"""Generic utilities for C++ parsing."""
__author__ = '<EMAIL> (Neal Norwitz)'
import sys
# Set to True to see the start/end token indices.
DEBUG = True
def ReadFile(filename, print_error=True):
"""Returns the contents of a file."""
try:
fp = open(filename)
try:
return fp.read... |
"""Smoke test for reading records from GCS to TensorFlow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import sys
import time
import numpy as np
import tensorflow as tf
from tensorflow.core.example import example_pb2
from tensorflow.pyth... |
from __future__ import unicode_literals
import frappe
import os
from frappe.utils import get_files_path
from frappe.utils.file_manager import get_content_hash, get_file
def execute():
frappe.reload_doc('core', 'doctype', 'file_data')
for name, file_name, file_url in frappe.db.sql(
"""select name, file_name, fil... |
"""
run as -
$ python web2py.py -S vita -M -R applications/vita/tests/unit/orgAuthTest.py
"""
import sys
import glob
import unittest
from gluon.globals import Request
# Pre-requisites & settings
# -----------------------------------------------------------------------------
APP_NAME=request.application
sys.pa... |
"""
This module contains deprecation messages and bits of code used elsewhere in the codebase
that is planned to be removed in the next pytest release.
Keeping it in a central location makes it easy to track what is deprecated and should
be removed when the time comes.
All constants defined in this module should be e... |
"""
Support for IP Webcam settings.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.android_ip_webcam/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DAT... |
from xml.etree import ElementTree as ET
class GrAFtree:
def __init__(self,f):
self.textd = {}
self.edged = {}
self.meaningd = {}
self.edgeclosured = {}
self.f = f
try:
self.tree = ET.parse(f)
except IOError:
self.tree = None
return
self.root = self.tree.getroot()
self.an... |
# -*- coding: utf-8 -*-
import os
from hashlib import md5
from io import BytesIO
from lxml import etree
from datetime import datetime
from scrapy.selector import Selector
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
#... |
import datetime
import warnings
from xml.dom import minidom
from django.contrib.syndication import feeds, views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
from models import ... |
try:
from distutils.version import LooseVersion
HAS_LOOSE_VERSION = True
except:
HAS_LOOSE_VERSION = False
AWS_REGIONS = [
'ap-northeast-1',
'ap-southeast-1',
'ap-southeast-2',
'cn-north-1',
'eu-central-1',
'eu-west-1',
'eu-central-1',
'sa-east-1',
'us-east-1',
'us-w... |
import sickbeard
from sickbeard.event_queue import Events
class Restart:
def __init__(self):
pass
@staticmethod
def restart(pid):
if str(pid) != str(sickbeard.PID):
return False
sickbeard.events.put(Events.SystemEvent.RESTART)
return True |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.... |
ANSIBLE_METADATA = {
'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'
}
import time
import re
try:
from objectpath import Tree
HAS_OBJPATH = True
except ImportError:
HAS_OBJPATH = False
from ansible.module_utils.basic import BOOLEANS_TRUE
from ansible.module_utils... |
try:
from unittest2 import TestCase
except ImportError:
from unittest import TestCase
#import tornado.testing
from hacheck import mysql
class TestMySQLHelpers(TestCase):
def test_sxor(self):
self.assertEqual(b'\0\0', mysql._sxor(b'00', b'00'))
self.assertEqual(b'\f\f', mysql._sxor(b'\f\f... |
import bisect
import mmap
import tempfile
import os
import sys
import threading
import itertools
import _multiprocessing
from multiprocessing.util import Finalize, info
from multiprocessing.forking import assert_spawning
__all__ = ['BufferWrapper']
#
# Inheirtable class which wraps an mmap, and from which blocks can... |
class ObjDictWrapper(dict):
"""ObjDictWrapper is a container that provides both dictionary-like and
object-like attribute access.
"""
def __getattr__(self, item):
if item in self:
return self[item]
else:
raise AttributeError(item)
def __setattr__(self, item, ... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
ExtractorError,
int_or_none,
urlencode_postdata,
)
class HostingBulkIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://... |
from django.utils import timezone
from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views import generic
from blog.models import Post
class PostView(generic.ListView):
template_name = 'blog/posts.html'
... |
from nailgun.api.v1.validators.base import BasicValidator
from nailgun.api.v1.validators.json_schema import base_types
from nailgun.api.v1.validators.json_schema import tasks
from nailgun import consts
from nailgun.errors import errors
from nailgun import objects
from nailgun.orchestrator import deployment_graph
clas... |
from .utils import validator
@validator
def ipv4(value):
"""
Return whether or not given value is a valid IP version 4 address.
This validator is based on `WTForms IPAddress validator`_
.. _WTForms IPAddress validator:
https://github.com/wtforms/wtforms/blob/master/wtforms/validators.py
... |
# Simple output device
#
import time
from machine import Pin
from uiot.device import Device
####### simple LEDs, other Output (switches)
class Output(Device):
# Handle output devices
def __init__(self, name, pin, *args, high_command='on', low_command='off',
ignore_case=True, on_change=None, ... |
import unittest
from heron.common.src.python.utils.metrics import (CountMetric, MultiCountMetric,
MeanReducedMetric, MultiMeanReducedMetric)
class MetricsTest(unittest.TestCase):
def test_count_metric(self):
metric = CountMetric()
for _ in range(10):
... |
import sys
import re
import fnmatch
import os
import shutil
import zipfile
from pip.util import display_path, backup_dir, rmtree
from pip.log import logger
from pip.exceptions import InstallationError
from pip.basecommand import Command
class ZipCommand(Command):
"""Zip individual packages."""
name = 'zip'
... |
"""Tests for window_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from tensorflow.contrib.signal.python.kernel_tests import test_util
from tensorflow.contrib.signal.python.ops import window_ops
from tensorflow... |
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import IntegrityError
from django.shortcuts import render, redirect
from django.contrib import messages
from django import forms as django_forms
from django.views.decorators.cache import cache_page
from django... |
import time
from openerp.osv import fields, osv
class account_budget_report(osv.osv_memory):
_name = "account.budget.report"
_description = "Account Budget report for analytic account"
_columns = {
'date_from': fields.date('Start of period', required=True),
'date_to': fields.date('End of ... |
"""
The ``agar.counter`` module contains classes to help work with scalable counters.
"""
import datetime
import re
import time
from google.appengine.api import memcache, taskqueue
from google.appengine.ext import db, deferred
from pytz import utc
def get_interval_number(ts, duration):
"""
Returns the numb... |
"""Trust Region Reflective algorithm for least-squares optimization.
The algorithm is based on ideas from paper [STIR]_. The main idea is to
account for presence of the bounds by appropriate scaling of the variables (or
equivalently changing a trust-region shape). Let's introduce a vector v:
| ub[i] - x[i]... |
import sys
import nlp
from nlp.config import SPACE
try:
cfg = nlp.config.Main('parser.py')
base = nlp.config.OpPath(cfg, "base", "base directory for all models", '')
pos_cfg = nlp.tagger.POSConfig(base)
super_cfg = nlp.tagger.SuperConfig(base)
parser_cfg = nlp.ccg.ParserConfig(base)
int_cfg = nlp.ccg.Inte... |
#!/usr/bin/env python
# encoding: utf-8
"""
data.py
Created by Thomas Mangin on 2009-09-06.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import unittest
# from exabgp.protocol.family import AFI
# from exabgp.protocol.family import SAFI
class TestDat... |
from . import settings, utils
from .settings import (GENERATED_MEDIA_DIR, GENERATED_MEDIA_NAMES_FILE,
MEDIA_GENERATORS)
from .utils import load_backend
from django.utils.http import urlquote
import os
import shutil
def generate_media():
if os.path.exists(GENERATED_MEDIA_DIR):
shutil.... |
"""Tests for the BitBucket Services."""
# pylint: disable=missing-docstring,protected-access
import unittest
import bitbucket_issue_converter
import issues
from issues_test import DEFAULT_USERNAME
from issues_test import SINGLE_COMMENT
from issues_test import SINGLE_ISSUE
from issues_test import COMMENT_ONE
from is... |
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It is used to
safely encode text that is in a character set similar to the 7-bit US ASCII
character set, but that... |
#!/usr/bin/python
import subprocess
import os
import json
class VolumeManager:
def __init__(self, base_cmdline, mount_root):
self.base_cmdline = base_cmdline
self.mount_root = mount_root
def start_server(self, pidfile, cmdline):
start_cmdline = ["start-stop-daemon", "-S", "-b", "-m", "-p", p... |
from mininode import *
from script import CScript, CScriptOp, OP_TRUE, OP_CHECKSIG
# Create a block (with regtest difficulty)
def create_block(hashprev, coinbase, nTime=None):
block = CBlock()
if nTime is None:
import time
block.nTime = int(time.time()+600)
else:
block.nTime = nTime... |
import errno
import re
import os
import sys
import subprocess
# Note that gcc uses unicode, which may depend on the locale. TODO:
# force LANG to be set to en_US.UTF-8 to get consistent warnings.
allowed_warnings = set([
"return_address.c:63",
"kprobes.c:1493",
"rcutree.c:1614",
"af_unix.c:893",
... |
"""
Demonstrates the spanning tree module so that the L2 switch
works decently on topologies with loops.
"""
def launch (forwarding = "l2"):
import pox.log.color
pox.log.color.launch()
import pox.log
pox.log.launch(format="[@@@bold@@@level%(name)-22s@@@reset] " +
"@@@bold%(message)s@@@n... |
title = 'Research'
class Link:
def __init__(self, section, url, name):
self.section = section; self.url = url; self.name = name
links = [
Link('2018', 'resources/research/automatic/poster.pdf', 'Automatic Electric Nanomanipulation Platform'),
Link('2018', 'resources/research/nims/poster.pdf', 'Modeling Ra... |
class UnknownConnector(Exception):
"""
Exception for dealing with an unknown connector type.
"""
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class MissingDependency(Exception):
"""
Exception for dealing with a missing dependency... |
# -*- coding:Utf8 -*-
#####################################
# Bombardement d'une cible mobile #
# (C) G. Swinnen - Avril 2004 - GPL #
#####################################
from tkinter import *
from math import sin, cos, pi
from random import randrange
from threading import Thread
class Canon:
"""Petit canon g... |
"""
Message Resource
^^^^^^^^^^^^^^^^
The message resource allows you to send messages to user and teams.
.. http:post:: /api/message/
:<json user: Recipient User's username
:<json team: Recipient Team's slug
:<json subject: Subject of the message
:<json content: Content of the message
.. note: You ... |
"""SCons.Scanner.C
This module implements the depenency scanner for C/C++ code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Sof... |
from st2common.util import isotime
from st2common.util import schema as util_schema
from st2common import log as logging
from st2common.models.api.base import BaseAPI
from st2common.models.api.tag import TagsHelper
from st2common.models.api.notification import (NotificationSubSchemaAPI, NotificationsHelper)
from st2com... |
"""Runs bigquery metrics and uploads the result to GCS."""
import argparse
import calendar
import glob
import json
import os
import pipes
import re
import subprocess
import sys
import time
import traceback
import influxdb
import requests
import yaml
def check(cmd, **kwargs):
"""Logs and runs the command, raisin... |
__author__ = '<EMAIL> (Takashi Matsuo)'
import unittest
try:
from xml.etree import ElementTree
except ImportError:
from elementtree import ElementTree
import atom
import gdata.apps
import gdata.apps.service
import getpass
import time
apps_domain = ''
apps_username = ''
apps_password = ''
class AppsServiceUnitT... |
#!/usr/bin/env python
# coding: utf-8
import tempfile
import subprocess
from os.path import dirname
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.utils import check_random_state, check_symmetric
from sklearn.utils.validation import check_array
from sklearn.metrics.pairwise import pairwise_kernels
f... |
try:
import shade
HAS_SHADE = True
except ImportError:
HAS_SHADE = False
def main():
argument_spec = openstack_full_argument_spec(
name=dict(required=False, default=None),
filters=dict(required=False, default=None)
)
module = AnsibleModule(argument_spec)
if not HAS_SHADE:
... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
_standard_context_processors = None
class ContextPopException(Exception):
"pop() has been called more times than push()"
pass
class Context(object):
"A stack container for variable context"
def __init__(self, dic... |
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import json
import os
import sys
FILES = ['pii', 'ccn']
HEADERS = ['offset', 'content', 'context']
def main(uuid, log_path, output):
features = {}
path = os.path.normpath(os.path.join(log_path, 'bulk-' + uuid))
for name in FIL... |
import math
from math import sqrt, acos, cos, pi, sin, atan2
import os, sys, time, random
from rotmat import Vector3, Matrix3
from subprocess import call, check_call,Popen, PIPE
def m2ft(x):
'''meters to feet'''
return float(x) / 0.3048
def ft2m(x):
'''feet to meters'''
return float(x) * 0.3048
def k... |
import sys
import itertools
import uuid
from optparse import OptionParser
from urlparse import urlparse
import random
import six
from swift.common.manager import Manager
from swift.common import utils, ring
from swift.common.storage_policy import POLICIES
from swift.common.http import HTTP_NOT_FOUND
from swiftclient... |
from case import Case
class Case5_4(Case):
DESCRIPTION = """Send text Message fragmented into 2 fragments, octets are sent in frame-wise chops."""
EXPECTATION = """Message is processed and echo'ed back to us."""
def onOpen(self):
fragments = ["fragment1", "fragment2"]
self.expected[Ca... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible.errors import AnsibleError, AnsibleAction, AnsibleActionFail, AnsibleActionSkip
from ansible.module_utils._text import to_text
from ansible.module_utils.parsing.convert_bool import boolean
from ansible.plugi... |
#!/usr/bin/python
### loading shell commands
import os, os.path, glob, sys, shutil, time
from scipy.fftpack import fftn
#from PyQt4.QtGui import *
import struct
#from scipy import *
import numpy as np
import math
# from matplotlib import *
# from pylab import *
# import matplotlib as plt
# from matplotlib.ticker impo... |
import numpy as np
from sklearn.utils.testing import (assert_allclose, assert_raises,
assert_equal)
from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors
from sklearn.neighbors.ball_tree import kernel_norm
from sklearn.pipeline import make_pipeline
from sklearn.dataset... |
"""Tests for IdentityOp."""
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 dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops impor... |
"""
fs.tests.test_expose: testcases for fs.expose and associated FS classes
"""
import unittest
import sys
import os
import os.path
import socket
import threading
import time
from fs.tests import FSTestCases, ThreadingTestCases
from fs.tempfs import TempFS
from fs.osfs import OSFS
from fs.memoryfs import MemoryF... |
from setuptools import setup, find_packages
from os.path import join, dirname
HISTORY = join(dirname(__file__), 'HISTORY.txt')
README = join(dirname(__file__), 'src', 'fcrepo', 'README.txt')
setup(
name='fcrepo',
version='1.1-dev',
author='Infrae',
author_email='<EMAIL>',
description="API implemen... |
# encoding: utf-8
"""
Modulestore configuration for test cases.
"""
import datetime
import pytz
from tempfile import mkdtemp
from uuid import uuid4
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from request_cache.middleware import ... |
from __future__ import unicode_literals
from django.contrib.gis.gdal import HAS_GDAL
from django.core.serializers.base import (
SerializationError, SerializerDoesNotExist,
)
from django.core.serializers.json import Serializer as JSONSerializer
if HAS_GDAL:
from django.contrib.gis.gdal import CoordTransform, S... |
__version__=''' $Id $ '''
__doc__="""Defines some standard drawings to use as test cases
This contains a number of routines to generate test drawings
for reportlab/graphics. For now they are contrived, but we will expand them
to try and trip up any parser. Feel free to add more.
"""
from reportlab.graphics... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
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.utils.unicode... |
"""Tests for Jurisdiction class and other functionality related
to jurisdictions."""
import cc.license
from cc.license import CCLicenseError
import nose.tools
# TODO: additional tests exercising the output
def test_jurisdictions():
jurisdictions = cc.license.jurisdictions.list()
for j in jurisdictions:
... |
""" Ip namespace commands. """
import click
from click.exceptions import UsageError
from gandi.cli.core.cli import cli
from gandi.cli.core.utils import output_ip
from gandi.cli.core.params import (pass_gandi, DATACENTER,
IP_TYPE, option, IntChoice)
@cli.command()
@click.option('--... |
# -*- coding: utf-8 -*-
import unittest
import signal
import os
from logging import getLogger
logger = getLogger(__name__)
from PySide import QtCore, QtWebKit, QtNetwork
from iivari import Display
from iivari.settings import DISPLAYSTATUS_PATH
# add iivari bin directory into PATH
iivari_bin = os.path.abspath(os.path.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='customer',
name='dia... |
#!/usr/bin/env python
# encoding: utf-8
"""
regex_matching.py
Created by Shengwei on 2014-07-09.
"""
# https://oj.leetcode.com/problems/regular-expression-matching/
# tags: medium / hard, string, matching, recursion
"""
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single chara... |
from apacheHandler import apacheHandler
apache_server = apacheHandler()
HeaderParserHandler = apache_server.headerParserHandler
Handler = apache_server.handler
CleanupHandler = apache_server.cleanupHandler
LogHandler = apache_server.logHandler
# Instantiate external entry points:
#HeaderParserHandler = HandlerWrap("h... |
import datetime
from django.contrib.auth import authenticate
from django.contrib.auth.context_processors import PermLookupDict, PermWrapper
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.test import SimpleTes... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.