content stringlengths 4 20k |
|---|
from oslo_versionedobjects import fields
from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.volume import group_types
@base.CinderObjectRegistry.register
class GroupType(base.CinderPersistentObject, base.CinderObject,
base.Cin... |
# coding:utf-8
import os
import sys
import unittest
import tempfile
import shutil
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
# 'import as' required to protect nosetests
import catkin.test_results as catkin_test_results
except ImportError as impe:
raise Imp... |
"""Communicating tracebacks and source code with debug server."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import socket
import grpc
from tensorflow.core.debug import debug_service_pb2
from tensorflow.core.protobuf import debug_pb2
from tensorflow.... |
##########################################################################
#### Felipe Andres Manzano * <EMAIL> ####
##########################################################################
'''
A mini PDF library for constructing very basic PDF files.
'''
import struct, zlib
#For constructing a mi... |
"""Tests for `tf.data.Dataset.padded_batch()`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import data... |
# -*- coding: utf-8 -*-
import sys
import time
import logging
import traceback
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.core.mail import mail_admins
from pyerp.fnd.functions.user.notification.lockfile import FileLock, AlreadyLocked, LockTim... |
import os.path
import unittest
import tempfile
import shutil
import sys
import zipfile
from resync.dump import Dump, DumpError
from resync.resource_list import ResourceList
from resync.change_list import ChangeList
from resync.resource import Resource
from resync.resource_dump_manifest import ResourceDumpManifest
from ... |
"""This module implements the Scraper component which parses responses and
extracts information from them"""
import logging
from collections import deque
from twisted.python.failure import Failure
from twisted.internet import defer
from scrapy.utils.defer import defer_result, defer_succeed, parallel, iter_errback
fr... |
from Screens.Screen import Screen
from Components.ActionMap import NumberActionMap
from Components.SystemInfo import SystemInfo
from Components.Label import Label
from Components.config import config
# this is not so great.
MAX_X = 720
MAX_Y = 576
MAX_W = MAX_X * 3 / 4
MAX_H = MAX_Y * 3 / 4
MIN_W = MAX_X / 8
MIN_H = M... |
import uuid
from oslo_config import cfg
from nova.tests.functional.v3 import api_sample_base
from nova.tests.unit.image import fake
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.extensions')
class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV3):
... |
import inspect
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.admindocs import utils
from django.core import urlresolvers
f... |
"""
Management utility to create superusers.
"""
import getpass
import os
import re
import sys
from optparse import make_option
from django.core import exceptions
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext as _
from seahub.base.accounts import User
... |
"""Tests for parsing module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import textwrap
from absl.testing import absltest as test
import gast
from pyctr.core import parsing
class ParsingTest(test.TestCase):
def test_parse_entity... |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.utils import timezone
from django.views import generic
from .models import Choice, Poll
class IndexView(generic.ListView):
template_name = 'polls/index.html... |
"""
Custom Boundary Shape
---------------------
This example demonstrates how a custom shape geometry may be used
instead of the projection's default boundary.
In this instance, we define the boundary as a circle in axes coordinates.
This means that no matter the extent of the map itself, the boundary will
always be ... |
""" msginit tool
Tool specific initialization of msginit tool.
"""
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files ... |
"""distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log
class FileList:
"""A ... |
"""Support for displaying persistent notifications."""
from collections import OrderedDict
import logging
from typing import Any, Mapping, MutableMapping, Optional
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.core import HomeAssistant, callback
from homeassistant.exce... |
class TestResult(object):
"""Base class to record and report test results.
Method record is to record the results of test case, and report
method is to report the recorded results by a given reporter.
"""
def record(self, parameter, result):
raise NotImplementedError("Abstract Method:recor... |
from PIL import Image
from pytesseract import image_to_string
import os
import time
import datetime
import re
import sys
import csv
args = sys.argv
# grab the second argument if it exists (should be the path)
# first is always the filename since it's running as > python filename args
if len(args) > 1:
rootDir = ar... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.AutoField(verbos... |
import six
import base64
import collections
import logging
import struct
import functools
from ryu import exception
from ryu import utils
from ryu.lib import stringify
from ryu.ofproto import ofproto_common
LOG = logging.getLogger('ryu.ofproto.ofproto_parser')
# This is merely for API compatibility on python2
if s... |
# coding=utf-8
"""
Implementation details. These classes should be transparent to end user.
"""
import typing
from xls_writer.api import TableField
from . import exceptions, api
# pylint: disable=no-self-use
class EnumeratedFieldEmptyCheck(api.FieldEmptyCheck):
"""
Checks if field is empty by comparing it to s... |
import glob
import datetime
import os
import unittest
from arsoapi.models import RadarPadavin, GeocodedRadar, Aladin, GeocodedAladin, mmph_to_level, filter_radar
from arsoapi.formats import radar_detect_format, radar_get_format
from PIL import Image
def datafile(name):
path = os.path.join(os.path.dirname(__file__),... |
"""Bash completion tests
"""
import mock
from cliff.app import App
from cliff.commandmanager import CommandManager
from cliff import complete
def test_complete_dictionary():
sot = complete.CompleteDictionary()
sot.add_command("image delete".split(),
[mock.Mock(option_strings=["1"])])
... |
from django.contrib.admin import ModelAdmin
from django.contrib.gis.admin.widgets import OpenLayersWidget
from django.contrib.gis.db import models
from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType
from django.core.exceptions import ImproperlyConfigured
spherical_mercator_srid = 3857
class GeoModelAdmin(Model... |
# coding=utf-8
from django.shortcuts import redirect
from pmtour.views.utils import (
get_a_tour,
get_bracket,
get_standings,
ret_tempcont,
)
def home(request, tour_id):
tour, has_perm = get_a_tour(request, tour_id)
if has_perm and request.method == "POST":
if request.POST["commit"] ==... |
import mock
import os
import posixpath
import sys
import unittest
from oslo.config import cfg
from six.moves.urllib import error
from cloudbaseinit.metadata.services import base
from cloudbaseinit.utils import x509constants
if sys.version_info < (3, 0):
# TODO(alexpilotti) replace oauth with a Python 3 compatibl... |
# lint-amnesty, pylint: disable=missing-module-docstring
from django.conf import settings
from django.core.management import call_command
from django.http import Http404, HttpResponse
from django.views.decorators.http import require_GET
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
... |
from functools import update_wrapper
class ThereCanOnlyBeOne(BaseException):
def __init__(self, cls):
self._cls = cls
def __str__(self):
return "There can only be one instance of '{}' at any time.".format(self._cls)
def highlander(klass):
klass.highlander_created = False
def cls_i... |
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... |
import collections
import itertools
from twisted.internet import defer
class QueueClosedError(Exception):
pass
class Consumer(object):
def __init__(self, queue, callback, paused=False):
self.queue = queue
self.callback = callback
self.paused = paused
self._current = None
... |
import os
import socket
from django.utils.translation import ugettext_lazy as _
from .base import * # noqa
SERVER_ENV = os.getenv('DJANGO_SERVER_ENV')
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = TEMPLATE_DEBUG = False
ALLOWED_HOSTS = [
# the server's IP (for monitors)
socket.gethostbyname(socket.gethostna... |
import purchase_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from mbcharsetprober import MultiByteCharSetProber
from codingstatemachine import CodingStateMachine
from chardistribution import Big5DistributionAnalysis
from mbcssm import Big5SMModel
class Big5Prober(MultiByteCharSetProber):
def __init__(self):
MultiByteCharSetProber.__init__(self)
self._mCoding... |
## Weighted Least Squares
from __future__ import print_function
import numpy as np
from scipy import stats
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.sandbox.regression.predstd import wls_prediction_std
from statsmodels.iolib.table import (SimpleTable, default_txt_fmt)
np.random.seed(... |
ROW = 4
COL = 3
def split_ocr(ocr):
return [[ocr[i][COL * j:COL * (j + 1)] for i in range(ROW)]
for j in range(len(ocr[0]) // COL)]
ALL = [' _ _ _ _ _ _ _ _ ',
' | _| _||_||_ |_ ||_||_|| |',
' ||_ _| | _||_| ||_| _||_|',
' ']
OCR_... |
import yaml
import test_constructor
import pprint
def test_representer_types(code_filename, verbose=False):
test_constructor._make_objects()
for allow_unicode in [False, True]:
for encoding in ['utf-8', 'utf-16-be', 'utf-16-le']:
native1 = test_constructor._load_code(open(code_filename, 'rb... |
__version__=''' $Id$ '''
from tools.docco.rl_doc_utils import *
heading2("General Concepts")
disc("""
In this section we will present some of the more fundamental principles of
the graphics library, which will show-up later in various places.
""")
heading3("Drawings and Renderers")
disc("""
A <i>Drawing</i> is a p... |
import unittest
import os
import subprocess
from collections import namedtuple
# git_access, , access to components available from git repositories, internal
from yotta.lib import git_access
# fsutils, , misc filesystem utils, internal
from yotta.lib import fsutils
# version, , represent versions and specifications, i... |
#!/usr/bin/python
'''
This example illustrates how to use Hough Transform to find lines
Usage:
houghlines.py [<image_name>]
image argument defaults to ../data/pic1.png
'''
# Python 2/3 compatibility
from __future__ import print_function
import cv2
import numpy as np
import sys
import math
if __name__ == '_... |
"""Simple meeting scheduler.
In this model, we try to schedule a meeting. The meeting will occur
in the following day. Time is divided in quarters or hours. It
starts at 8AM and ends at 7PM -> 44 timeslots.
There are p persons involved, m are mandatory. Each has his own set of
meetings. There are r rooms. Each has ... |
import agents as ag
import envgui as gui
import random
# ______________________________________________________________________________
loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world
def RandomVacuumAgent():
"Randomly choose one of the actions from the vacuum environment."
p = ag.Ran... |
import six
import random
import unittest2 as unittest
from social.strategies.base import BaseStrategy
from social.storage.base import UserMixin, NonceMixin, AssociationMixin, \
CodeMixin, BaseStorage
from social.tests.models import User
NOT_IMPLEMENTED_MSG = 'Implement in subclass'
... |
from openerp.osv import fields, osv
class stock_location_path(osv.osv):
_inherit = "stock.location.path"
_columns = {
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
("none", "Not Applicable")], "Invoice Status",),
... |
'''serializer_helper.py'''
from heronpy.api.serializer import PythonSerializer
import heronpy.api.api_constants as constants
import heron.common.src.python.pex_loader as pex_loader
class SerializerHelper(object):
"""Helper class for getting serializer for component"""
@staticmethod
def get_serializer(context)... |
"""
Tests for branding page
"""
import datetime
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponseRedirect
from django.test.utils import override_settings
from django.test.client import RequestFactory
from pytz import UTC
from mock import patch,... |
# -*- coding: utf-8 -*-
import json
import os
import re
import hashlib
import subprocess
import sys
from typing import Any, List, Optional, Set
from importlib import import_module
from io import StringIO
import glob
import time
import shutil
from django.db import connections, DEFAULT_DB_ALIAS, ProgrammingError, \
... |
__version__="0.1.0"
# ToDo:
# [] process mult dimacs.trees to hrg
import sys
import traceback
import argparse
import os
import glob
import networkx as nx
import pandas as pd
from PHRG import graph_checks
import subprocess
import math
import graph_sampler as gs
global args
def get_parser ():
parser = argparse.Ar... |
from storm.expr import Column, Undef, Add, Sub, Mul, LShift, RShift, Lower, Upper
from storm.locals import *
from storm.properties import Property, PropertyColumn
from .variables import *
from .expr import *
__all__ = [
"IntRange",
"FloatRange",
"DateRange",
"DateTimeRange"
]
class RangeProperty(Pro... |
"""
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux.
# Heavily refactored by Lars Buitinck.
#
# TODO: a version of this algorithm has been incorporated in SciPy; use that
#... |
#!/usr/bin/env python
import os
import base64
import pickle
from gppylib.gpparseopts import OptParser, OptChecker
from gppylib.mainUtils import addStandardLoggingAndHelpOptions
from collections import defaultdict
from gppylib import gplog
from gppylib.commands import unix
from gppylib.commands.base import REMOTE, Wor... |
from mock import ( MagicMock, DEFAULT )
from nose.tools import eq_
from hamcrest import assert_that, empty
from ycm import vimsupport
from ycm.youcompleteme import YouCompleteMe
def GetCompleteDoneHooks_ResultOnCsharp_test():
vimsupport.CurrentFiletypes = MagicMock( return_value = [ "cs" ] )
ycm_state = YouComplet... |
"""Monotone_ backend.
.. _Monotone: http://www.monotone.ca/
"""
import os
import os.path
import random
import re
import shutil
import unittest
import libbe
import libbe.ui.util.user
from ...util.subproc import CommandError
from . import base
if libbe.TESTING == True:
import doctest
import sys
def new():
... |
"""Fake LDAP server for test harness.
This class does very little error checking, and knows nothing about ldap
class definitions. It implements the minimum emulation of the python ldap
library to work with nova.
"""
import fnmatch
from oslo_serialization import jsonutils
import six
from six.moves import range
cl... |
from collections import OrderedDict
import os
import fixtures
from nova import exception
from nova import test
from nova.tests.unit.virt.disk.vfs import fakeguestfs
from nova.virt.disk import api as diskapi
from nova.virt.disk.vfs import guestfs as vfsguestfs
class VirtDiskTest(test.NoDBTestCase):
def setUp(sel... |
import os, os.path, shutil, signal, socket, sys
from os import environ as env
from os.path import join as joinpath, expanduser
def date():
import time
return time.strftime('%a %b %e %H:%M:%S %Z %Y', time.localtime())
def cleandir(dir):
for root, dirs, files in os.walk(dir, False):
for name in file... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-std=c++11',
# ...and the sa... |
"""
Upgrade engine database model for keeping log of which upgrades have been
applied to to a given database.
"""
from invenio.ext.sqlalchemy import db
class Upgrade(db.Model):
"""Represents an Upgrade record."""
__tablename__ = 'upgrade'
upgrade = db.Column(db.String(255), primary_key=True, nullable=Fa... |
import re
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
def get_field_size(name):
""" Extract the size number from a "varchar(11)" type name """
m = field_size_re.search(name)
... |
import codecs
import datetime
import locale
from decimal import Decimal
from urllib.parse import quote
from django.utils import six
from django.utils.functional import Promise
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __init__(self, obj, *args):
self.obj = obj
super().__init__(*args... |
'''Wrapper for openal
Generated with:
../tools/wraptypes/wrap.py /usr/include/AL/alc.h -lopenal -olib_alc.py
.. Hacked to fix ALCvoid argtypes.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import sys
import pyglet.lib
_lib = pyglet.lib.load_library('openal', win3... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... |
"""
Django settings for Project project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
#... |
"""
Functions for easy plotting of modes and modal properties
This is a light wrapper to matplotlib: http://matplotlib.sourceforge.net
"""
import logging
try:
import pylab
from pylab import *
except:
logging.error("Plot library unavailable, plots cannot be made")
pylab = None
from numpy import (pi,a... |
"""Support for Berkeley DB 4.3 through 5.3 with a simple interface.
For the full featured object oriented interface use the bsddb.db module
instead. It mirrors the Oracle Berkeley DB C API.
"""
import sys
absolute_import = (sys.version_info[0] >= 3)
if (sys.version_info >= (2, 6)) and (sys.version_info < (3, 0)) :
... |
"""An Ansible module to utilize GCE image resources."""
import sys
try:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
from libcloud.common.google import GoogleBaseError
from libcloud.common.google import ResourceExistsError
from libcloud.common.google import R... |
"""Tests for distutils.command.check."""
import unittest
from test.support import run_unittest
from distutils.command.check import check, HAS_DOCUTILS
from distutils.tests import support
from distutils.errors import DistutilsSetupError
class CheckTestCase(support.LoggingSilencer,
support.TempdirMa... |
'''
Basic, limited Panasonic protocol, suitable for some Panasonic displays, will be expaned over time.
Supports **PROTOCOL 2** (ensure selected in device).
* rev. 3 WORKAROUND: set polling to 5 mins to suppress flip flopping
* rev. 4 UPDATE: allow IP address binding (see AMX Beacon, SSDP address, or custom address p... |
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin
class General(Plugin):
"""general system information"""
plugin_name = "general"
profiles = ('system', 'sysmgmt')
def setup(self):
self.add_copy_spec([
"/etc/sos.conf",
"/etc/sysconfig",
"/proc/stat... |
import threading
from ctypes import byref, c_char_p, c_int, c_char, c_size_t, Structure, POINTER
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string, check_sized_string
from django.contrib... |
"""Login and Registration pages """
from urllib import urlencode
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import Promise, EmptyPromise
from . import BASE_URL
from .dashboard import DashboardPage
class RegisterPage(PageObject):
"""
Registration page (create a new account)
... |
import os
import sys
import abc
import time
import yaml
import atexit
import docopt
import psutil
import logging
import datetime
from textwrap import dedent
from scalrpy.util import helper
from scalrpy.util import exceptions
from scalrpy import __version__
from scalrpy import LOG
class Application(object):
""... |
"""Completion view for statusbar command section.
Defines a CompletionView which uses CompletionFiterModel and CompletionModel
subclasses to provide completions.
"""
from PyQt5.QtWidgets import QStyle, QTreeView, QSizePolicy
from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QItemSelectionModel
from qutebrowser.conf... |
import uuid
from lxml import etree
from django.core import serializers
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import simplejson
from indivo.lib.query import DATE, STRING, NUMBER
from indivo.lib.utils import LazyProperty
from indivo.models import Record, Docu... |
import sqlite3
from mucomic.core.models import Issue, Series
"""
Layout:
Table Series:
id | title | start | end | added | fav
Table Issue:
id | series_id | issue_number | cover_url
"""
class DB:
def __init__(self, db_path):
self.db_path = db_path
conn = sqlite3.connect(db_path)
c = conn.cursor()
c... |
import gtk
MENUBAR = {}
class MenuBuilder():
@classmethod
def get_sub_menu_by_name(cls, name):
if name in MENUBAR:
return MENUBAR[name]
else:
return None
@classmethod
def make_sub_menu(cls, menu, name):
""" add a new submenu to the toolbar """
... |
# the 256-color color table for the in-game terminal.
# proudly determined from an URXVT screenshot.
urxvtcoltable = [
( 0, 0, 0),
(205, 0, 0),
( 0, 205, 0),
(205, 205, 0),
( 0, 0, 205),
(205, 0, 205),
( 0, 205, 205),
(229, 229, 229),
( 77, 77, 77),
(255, ... |
# -*- coding: utf-8 -*-
from south.v2 import DataMigration
from xmodule.modulestore.django import loc_mapper, modulestore
import re
from xmodule.modulestore.locations import SlashSeparatedCourseKey
from opaque_keys import InvalidKeyError
import logging
from django.db.models.query_utils import Q
from django.db.utils imp... |
import unittest2
import st2common.util.jsonify as jsonify
class JsonifyTests(unittest2.TestCase):
def test_none_object(self):
obj = None
self.assertTrue(jsonify.json_loads(obj) is None)
def test_no_keys(self):
obj = {'foo': '{"bar": "baz"}'}
transformed_obj = jsonify.json_lo... |
"""Defines an enum for classifying RPC methods by streaming semantics."""
import enum
@enum.unique
class Cardinality(enum.Enum):
"""Describes the streaming semantics of an RPC method."""
UNARY_UNARY = 'request-unary/response-unary'
UNARY_STREAM = 'request-unary/response-streaming'
STREAM_UNARY = 're... |
"""Support for the Roku media player."""
import logging
import requests.exceptions
from homeassistant.components.media_player import MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MOVIE, SUPPORT_NEXT_TRACK, SUPPORT_PLAY,
SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK, SUPPOR... |
from __future__ import absolute_import
import csv
class DictReader(csv.DictReader, object):
""" Splunk multi-value-aware CSV dictionary reader. """
def __init__(self, input_file):
super(DictReader, self).__init__(
input_file, dialect='splunklib.searchcommands')
self.__fieldnames =... |
from sqlparse.filters.others import SerializerUnicode
from sqlparse.filters.others import StripCommentsFilter
from sqlparse.filters.others import StripWhitespaceFilter
from sqlparse.filters.others import SpacesAroundOperatorsFilter
from sqlparse.filters.output import OutputPHPFilter
from sqlparse.filters.output import... |
"""
Pythonic interface to DirectSound.
"""
from collections import namedtuple
import ctypes
from pyglet.debug import debug_print
from pyglet.window.win32 import _user32
from . import lib_dsound as lib
from .exceptions import DirectSoundNativeError
_debug_media = debug_print('debug_media')
def _check(hresult):
i... |
"""A Python driver for PostgreSQL
psycopg is a PostgreSQL_ database adapter for the Python_ programming
language. This is version 2, a complete rewrite of the original code to
provide new-style classes for connection and cursor objects and other sweet
candies. Like the original, psycopg 2 was written with the aim of b... |
import sys
import json
from calvin.runtime.north.calvin_token import Token
import time
from calvin.utilities.calvinlogger import get_logger
_log = get_logger(__name__)
class Endpoint(object):
"""docstring for Endpoint"""
def __init__(self, port, former_peer_id=None):
super(Endpoint, self).__init__()... |
import inspect
import logging as log
import requests
import sys
import time
from functools import wraps
from qubell.api.private.exceptions import ApiError, api_http_code_errors
try:
import requests.packages.urllib3 as urllib3
urllib3.disable_warnings()
except:
pass
log.getLogger("requests.packages.urllib... |
"""Private convenience functions for RaggedTensors.
None of these methods are exposed in the main "ragged" package.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import o... |
<<<<<<< HEAD
<<<<<<< HEAD
#!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.T... |
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ui.ui_export_progress
from lib.classes import *
class ExportProgress(QDialog, ui.ui_export_progress.Ui_ExportProgress):
def __init__(self, parent, main, export):
super(ExportProgress, self).__init__(parent)
self.parent = parent
... |
try:
from commandr import command
except ImportError:
command = None
import sys
print "Error: Commandr module cannot be loaded, please install using 'pip install commandr'"
sys.exit(1)
@command("apache")
def apache(metric=None):
from zems.apache import Apache
run_test(Apache(),... |
from ctypes import *
import unittest
class StringBufferTestCase(unittest.TestCase):
def test_buffer(self):
b = create_string_buffer(32)
self.assertEqual(len(b), 32)
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertTrue(type(b[0]) is str)
b = create_string_buffer... |
#!/usr/bin/env python
from __future__ import (print_function, unicode_literals, division,
absolute_import)
import argparse
import io
import json
import os
import re
import shutil
import subprocess
import sys
import tarfile
import zipfile
LOC = '/usr/lib/python2.7/dist-packages/cinder/volume/dr... |
# import cloudstack common
from ansible.module_utils.cloudstack import *
class AnsibleCloudStackPod(AnsibleCloudStack):
def __init__(self, module):
super(AnsibleCloudStackPod, self).__init__(module)
self.returns = {
'endip': 'end_ip',
'startip': 'start_i... |
"""
Test module for utils/__init__.py.
"""
import unittest
import sys
import os
from DocutilsTestSupport import utils, nodes
try:
from io import StringIO
except ImportError: # io is new in Python 2.6
from StringIO import StringIO
class ReporterTests(unittest.TestCase):
stream = StringIO()
reporte... |
"""Generate template values for methods.
Extends IdlType and IdlUnionType with property |union_arguments|.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
from idl_types import inherits_interface
import dart_types
from dart_utilities import DartUtilities
from v8_globals import includ... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
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.network.dell... |
import numpy as np
import matplotlib.pyplot as plt
from lib import utils
import lib.SG as SG
from collections import OrderedDict
class TwoDdata():
def __init__(self):
self.xvals = np.array([])
self.yvals = np.array([])
self.rawyvals = []
self.gradient = []
self.gPeaks = Or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.