content stringlengths 4 20k |
|---|
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
import roslib
import rospy
import actionlib
from geometry_msgs.msg import PoseStamped, PointStamped
from approach_person_of_interest.msg import *
from sensor_msgs.msg import JointState
from std_msgs.msg import String, Float32, Bool, Int32
from strands_navigation_msgs.msg import MonitoredNavigat... |
import logging
import os
import sys
import unittest
import test_env
test_env.setup_test_env()
import mock
import parameterized
from test_support import test_case
from components.auth import model
from components.config import fs
from realms import config
from realms import permissions
def fake_db(rev, perms=None... |
"""
Representation of a jet-based THnSparse
@author: Markus Fasel
"""
from PWGJE.EMCALJetTasks.Tracks.analysis.base.struct.THnSparseWrapper import AxisFormat
from PWGJE.EMCALJetTasks.Tracks.analysis.base.struct.THnSparseWrapper import THnSparseWrapper
from copy import copy, deepcopy
from numpy import array as nparray
... |
"""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... |
"""Unittest main program"""
import sys
import optparse
import os
from . import loader, runner
from .signals import installHandler
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = " -c, --catch Catch control-C and display results\n"
BUFFEROUTPUT = " -b, --buffer ... |
from sulley import *
import struct
# crap ass trend xor "encryption" routine for control manager (20901)
def trend_xor_encode (str):
'''
Simple bidirectional XOR "encryption" routine used by this service.
'''
key = 0xA8534344
ret = ""
# pad to 4 byte boundary.
pad = 4 - (len(... |
from __future__ import print_function
"""Tests limits on processes forked by fork on accept in the standard process
model.
NOTE: This test runs in an environment with an artificially low setting for
smbd max processes
"""
import os
from samba.tests import TestCase
from samba.samdb import SamDB
from ldb... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed 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 Lice... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... |
from ctypes import *
from ctypes.wintypes import HANDLE
from ctypes.wintypes import BOOL
from ctypes.wintypes import LPCWSTR
_stdcall_libraries = {}
_stdcall_libraries['kernel32'] = WinDLL('kernel32')
from ctypes.wintypes import DWORD
from ctypes.wintypes import WORD
from ctypes.wintypes import BYTE
INVALID_HANDLE_VAL... |
from __future__ import print_function
import re, os, io, ast, pprint, collections
from minilexer import MiniLexer
'''Verilog documentation parser'''
verilog_tokens = {
'root': [
(r'\bmodule\s+(\w+)\s*', 'module', 'module'),
(r'/\*', 'block_comment', 'block_comment'),
(r'//#+(.*)\n', 'metacomment'),
... |
from functools import wraps
class Task(object):
"""
Abstract base class for objects wishing to be picked up as Fabric tasks.
Instances of subclasses will be treated as valid tasks when present in
fabfiles loaded by the :doc:`fab </usage/fab>` tool.
For details on how to implement and use `~fabric... |
import os.path
from ert.config import UnrecognizedEnum, ContentTypeEnum, ConfigError, ConfigPrototype, SchemaItem
from cwrap import BaseCClass
class ContentNode(BaseCClass):
TYPE_NAME = "content_node"
_iget = ConfigPrototype("char* config_content_node_iget( content_node , int)")
_size = ConfigPrototype(... |
# -*- coding: utf-8 -*-
"""
jinja2.testsuite.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests corner cases and bugs.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Template, Enviro... |
# -*- coding: utf-8 -*-
import logging
import os
import settings_default
# TODO: replace platform specific paths
class Settings(object):
def __init__(self):
self._settings = {}
#self.add_from_file(os.path.join('settings_default.py'))
self._settings.update(settings_default.settings)
... |
from __future__ import print_function, division
import sys
import os
import numpy as np
from clas12_wiremap.ui import QtGui, uic
from clas12_wiremap.ui import Sidebar, CrateTab, DBTab, TBTab, DCWireStack, SetRunDialogue
from clas12_wiremap.ui.dcrb_tab import DCRB
from clas12_wiremap.ui.stb_tab import STBTab
from clas1... |
from neutron.common import constants as q_const
from neutron.common import rpc as q_rpc
from neutron.db import agents_db
from neutron.db import dhcp_rpc_base
from neutron.db import l3_rpc_base
from neutron.openstack.common import log as logging
from neutron.plugins.hyperv import db as hyperv_db
LOG = logging.getLogge... |
import os
import sys
from distutils.msvccompiler import get_build_version
def get_config():
from setup_common import get_metadata_and_options, create_release_file
metadata, options = get_metadata_and_options()
connector = options["connector"]
extra_objects = []
# client = "mysqlclient"
cli... |
from mox3 import mox
import pkg_resources
import six
from nova import context
from nova import test
from nova.tests.unit.virt.xenapi import stubs
from nova.virt.xenapi import driver as xenapi_conn
from nova.virt.xenapi import fake
from nova.virt.xenapi.image import bittorrent
from nova.virt.xenapi import vm_utils
cl... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetActivityStats(Choreography):
def __init__(self, temboo_session):
"""
Creat... |
"""
MSN Live Connect oAuth 2.0
Settings:
LIVE_CLIENT_ID
LIVE_CLIENT_SECRET
LIVE_EXTENDED_PERMISSIONS (defaults are: wl.basic, wl.emails)
References:
* oAuth http://msdn.microsoft.com/en-us/library/live/hh243649.aspx
* Scopes http://msdn.microsoft.com/en-us/library/live/hh243646.aspx
* REST http://msdn.microsoft.co... |
"""Tests for the backpopulate_program_credentials management command."""
import ddt
import mock
from django.core.management import call_command
from django.test import TestCase
from lms.djangoapps.certificates.models import CertificateStatuses # pylint: disable=import-error
from course_modes.models import CourseMode
... |
import sys
import hashlib
import logging
from os.path import basename
from argparse import ArgumentParser
import arpy
from base64 import b64encode
log = logging.getLogger(basename(sys.argv[0]))
def main(argv):
p = ArgumentParser(
prog=basename(argv[0]),
description="Hash the contents of archives")
p.add_a... |
"""Contains included user interfaces for Tvdb show selection.
A UI is a callback. A class, it's __init__ function takes two arguments:
- config, which is the Tvdb config dict, setup in tvdb_api.py
- log, which is Tvdb's logger instance (which uses the logging module). You can
call log.info() log.warning() etc
It mus... |
"""Tests for google.protobuf.internal.service_reflection."""
__author__ = '<EMAIL> (Petar Petrov)'
try:
import unittest2 as unittest #PY26
except ImportError:
import unittest
from google.protobuf import unittest_pb2
from google.protobuf import service_reflection
from google.protobuf import service
class FooU... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""dfsvw.py
Create site map for vimwiki.
Must run script under vimwiki directory.
Example:
output readable site map to stdout
dfsvw.py
output vimwiki-format sitemap to file
dfsvw.py > map.wiki
Python version: 2"""
import sys
import re
linkRE = r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import copy
import jsbeautifier
options = jsbeautifier.default_options()
options.wrap_line_length = 80
data = ''
data_min = ''
def beautifier_test_underscore():
jsbeautifier.beautify(data, options)
def beautifier_test_underscore_min():
jsbeautifier.... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.compat.tests import unittest
from ansible.compat.te... |
import inspect
import re
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force... |
# ws/views.py
from django.http import HttpResponse
from django.http import HttpResponseRedirect
import json
from lolcomp.helpers import *
import os
import requests
from ws.models import *
# retrieve constants for app sitedown
def cst_sitedown(request):
if request.method == 'POST':
post = json.loads(reque... |
import os, sys
import myfun
import numpy as np
import matplotlib as mpl
mpl.use('ps')
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy import interpolate
import lagrangian_stats
import scipy.fftpack
## READ archive (too many points... somehow)
# args: name, dayi, dayf, days
label = ... |
# -*- coding: utf-8 -*-
"""The encoded stream path specification implementation."""
from dfvfs.lib import definitions
from dfvfs.path import factory
from dfvfs.path import path_spec
class EncodedStreamPathSpec(path_spec.PathSpec):
"""Encoded stream path specification.
Attributes:
encoding_method (str): meth... |
import sys, os, math, random
class party:
def __init__(self, names, votess, seat=0):
self.name = names
self.votes = votess
self.readyseats = seat
if self.readyseats == None:
self.readyseats = int(0)
self.seats = self.readyseats
if self.seats == None:
self.seats = int(0... |
"""generic routines to convert platform-specific paths to URIs."""
import atexit
import subprocess
import sys
import threading
import urllib
def abspath_to_uri(platform, path):
"""Converts a platform-specific absolute path to a file: URL."""
return "file:" + _escape(_convert_path(platform, path))
def cygpa... |
from __future__ import unicode_literals
import os
import re
from unittest import skipUnless
from django.contrib.gis.db.models import Extent3D, Union
from django.contrib.gis.db.models.functions import (
AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate,
)
from django.contrib.gis.gdal import HAS_GDAL
from djang... |
"""
The MIT License
Copyright (c) 2007 Leah Culver
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, merge, publis... |
class HTTPError(Exception):
"Base exception used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(self, pool, message):
self.pool = pool
HTTPError.__init__(self, "%s: %s" % (pool, message))
def __reduce__(self):
... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_iso8601,
qualities,
)
class CoubIE(InfoExtractor):
_VALID_URL = r'(?:coub:|https?://(?:coub\.com/(?:view|embed|coubs)/|c-cdn\.coub\... |
from splitsecond.utils import logger
from functools import reduce
def import_class(name, get_module=False):
module_name = get_module and name or '.'.join(name.split('.')[:-1])
klass = name.split('.')[-1]
module = get_module and __import__(name) or __import__(module_name)
if '.' in module_name:
... |
"""Results of coverage measurement."""
import collections
from coverage.backward import iitems
from coverage.misc import format_lines, SimpleRepr
class Analysis(object):
"""The results of analyzing a FileReporter."""
def __init__(self, data, file_reporter):
self.data = data
self.file_report... |
# -*- coding: utf-8 -*-
import json
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""
Bootstraps the HTML view template with some default configura... |
"""Configuration and utilities for receiving inputs at serving time."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import time
import six
from tensorflow.python.framework import dtypes
from tensorflow.python.framework im... |
#!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <<EMAIL>>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
content_pro... |
"""Email address parsing code.
Lifted directly from rfc822.py. This should eventually be rewritten.
"""
__all__ = [
'mktime_tz',
'parsedate',
'parsedate_tz',
'quote',
]
import time, calendar
SPACE = ' '
EMPTYSTRING = ''
COMMASPACE = ', '
# Parse a date field
_monthnames = ['jan', 'feb', 'mar',... |
from mock import Mock
from ceph_deploy import install
class TestSanitizeArgs(object):
def setup(self):
self.args = Mock()
# set the default behavior we set in cli.py
self.args.default_release = False
self.args.stable = None
def test_args_release_not_specified(self):
... |
import glob
import os
import sys
import re
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import python.DataIO as DataIO
import python.graphics as graphics
import python.clusters as clusters
import python.counts as counts
# Format settings
from matplotlib i... |
from stockpile import conf
from django.test import TestCase
from .models import Account, DummyInfo
import logging
log = logging.getLogger(__name__)
class StockpileTest(TestCase):
def setUp(self):
# Don't use a fixture for caching reasons
a1 = Account.objects.create(id=1, name='dummy_name_1')... |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, flt, cstr
from webnotes import msgprint, _
import webnotes.defaults
from controllers.accounts_controller import AccountsController
from accounts.general_ledger import make_gl_entries, delete_gl_entries
class StockController(Accou... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
def find_launch_configs(client, module):
name_regex = module.params.get('name_regex')
sort_order = module.params.get('sort_order')
limit = module.params.get('limit')
pagina... |
import sys
import numpy as np
import discopy as dp
def remap(d1, d2):
z = d2.Z
r = d2.R
nq = d1.numQ
prim = []
for k in range(d2.numZ):
sheet = []
for j in range(d2.numR):
sheet.append(np.empty((d2.numPhi[k,j], nq),np.float))
prim.append(sheet)
for k in ra... |
import datetime
import time
from openerp.osv import fields, osv
from openerp.report.interface import report_rml
from openerp.report.interface import toxml
from openerp import pooler
import time
from openerp.report import report_sxw
from openerp.tools import ustr
from openerp.tools.translate import _
from openerp.tool... |
# $HeadURL$
__RCSID__ = "$Id$"
import base64
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Utilities import DEncode
gForceRawEncoding = False
try:
import zlib
gZCompressionEnabled = True
except ImportError, x:
gZCompressionEnabled = False
def codeRequestInFileId( plotRequest, compressIfPossible = T... |
from __future__ import absolute_import
from pychron.core.ui import set_qt
set_qt()
from pychron.pyscripts.hops_editor import Position, Hop, HopSequence
__author__ = 'ross'
import unittest
class PositionTestCase(unittest.TestCase):
def test_to_string_no_deflection(self):
p = Position(detector='H1', iso... |
{
'name': 'Barcode Scanner Hardware Driver',
'version': '1.0',
'category': 'Hardware Drivers',
'sequence': 6,
'summary': 'Hardware Driver for Barcode Scanners',
'website': 'https://www.odoo.com/page/point-of-sale',
'description': """
Barcode Scanner Hardware Driver
==========================... |
"""Module containing utilities for apk packages."""
import re
from devil.android.sdk import aapt
_MANIFEST_ATTRIBUTE_RE = re.compile(
r'\s*A: ([^\(\)= ]*)(?:\([^\(\)= ]*\))?='
r'(?:"(.*)" \(Raw: .*\)|\(type.*?\)(.*))$')
_MANIFEST_ELEMENT_RE = re.compile(r'\s*(?:E|N): (\S*) .*$')
def GetPackageName(apk_pat... |
from __future__ import absolute_import
from datetime import date
from django.db.models.sql.query import InvalidQuery
from django.test import TestCase
from .models import Author, Book, Coffee, Reviewer, FriendlyAuthor
class RawQueryTests(TestCase):
fixtures = ['raw_query_books.json']
def assertSuccessfulRa... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: vmware_host_config_manager
short_description: Manage advanced system settings of an ES... |
# -*- coding: utf-8 -*-
"""
patchlevel.py
~~~~~~~~~~~~~
Extract version info from Include/patchlevel.h.
Adapted from Doc/tools/getversioninfo.
:copyright: 2007-2008 by Georg Brandl.
:license: Python license.
"""
import os
import re
import sys
def get_header_version_info(srcdir):
patchlev... |
# -*- coding: utf-8 -*-
"""
Kanevsky all minimum node k cutsets algorithm.
"""
import copy
from collections import defaultdict
from itertools import combinations
from operator import itemgetter
import networkx as nx
from .utils import build_auxiliary_node_connectivity
from networkx.algorithms.flow import (
build_r... |
"""Graph benchmark for linear regression, to contrast with eager execution."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
from tensorflow.contrib.eager.python.examples.linear_regression import linear_regression
cl... |
import string
import sys
# Function to print to stderr
#
def err(*args):
savestdout = sys.stdout
try:
sys.stdout = sys.stderr
for i in args:
print i,
print
finally:
sys.stdout = savestdout
# The set of digits that form a number
#
digits = '0123456789'
# Func... |
import neuroptikon
import osgUtil
import os
from neuro_object import NeuroObject
class Arborization(NeuroObject):
def __init__(self, neurite, region, sendsOutput=None, receivesInput=None, *args, **keywords):
"""
Arborizations represent a neurite's arborization within a region.
... |
#
"""
This is a utility to 'can' the widths data for certain CID fonts.
Now we're using Unicode, we don't need 20 CMAP files for each Asian
language, nor the widths of the non-normal characters encoded in each
font. we just want a dictionary of the character widths in a given
font which are NOT 1000 ems wide, keyed on... |
import li_std_pair_extra
p = (1, 2)
p1 = li_std_pair_extra.p_inout(p)
p2 = li_std_pair_extra.p_inoutd(p1)
d1 = li_std_pair_extra.d_inout(2)
i, d2 = li_std_pair_extra.d_inout2(2)
i, p = li_std_pair_extra.p_inout2(p)
p3, p4 = li_std_pair_extra.p_inout3(p1, p1)
psi = li_std_pair_extra.SIPair("hello", 1)
pci = li_std_... |
"""Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... |
import unittest
from Cython.Compiler.Visitor import PrintTree
from Cython.TestUtils import TransformTest
from Cython.Compiler.TreePath import find_first, find_all
from Cython.Compiler import Nodes, ExprNodes
class TestTreePath(TransformTest):
_tree = None
def _build_tree(self):
if self._tree is None:
... |
from UM.Extension import Extension
from UM.i18n import i18nCatalog
from UM.Logger import Logger
from UM.Qt.ListModel import ListModel
from UM.PluginRegistry import PluginRegistry
from UM.Application import Application
from UM.Version import Version
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QN... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
requirements = [
'requests >= 2.5.2, < 2.11',
'six >= 1.4.0',
'websocket-client >= 0.32.0',
]
if sys.platform == 'win32':
requirements.append('pypiwin32 >... |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from .base import GrantTypeBase
from .. import errors
from ..request_validator import RequestValidator
log = logging.getLogger(_... |
from __future__ import unicode_literals
import datetime
import unittest
from django.test.utils import requires_tz_support
from django.utils import timezone
from django.utils.timesince import timesince, timeuntil
class TimesinceTests(unittest.TestCase):
def setUp(self):
self.t = datetime.datetime(2007, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Slightly based on AboutModules in the Ruby Koans
#
from runner.koan import *
class AboutMultipleInheritance(Koan):
class Nameable:
def __init__(self):
self._name = None
def set_name(self, new_name):
self._name = new_name
... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_v... |
from __future__ import absolute_import
from builtins import str
from builtins import map
from builtins import object
from .compat import fifechan, fife, in_fife
from fife.extensions import fife_timer as timer
from . import fonts
from .exceptions import *
from traceback import print_exc
def get_manager():
"""
Get the... |
from django.conf import settings
from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.core import checks
from django.db import models
from django.test import SimpleTestCase, TestCase
from django.test.utils import isolate_apps
from .models import CustomAr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_more_cookiecutters
-----------------------
Test formerly known from a unittest residing in test_examples.py named
TestGitBranch.test_branch
TestExamplesRepoArg.test_cookiecutter_pypackage_git
"""
from __future__ import unicode_literals
import os
import subproces... |
"""
Utilities for dealing with Javascript and JSON.
"""
import json
from django.utils.html import escapejs
from mako.filters import decode
from xmodule.modulestore import EdxJSONEncoder
def _escape_json_for_js(json_dumps_string):
"""
Escape output of JSON dumps that is safe to be embedded in a <SCRIPT> tag.... |
"""
Models can have a ``managed`` attribute, which specifies whether the SQL code
is generated for the table on various manage.py operations.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# All of these models are created in the database by Django.
@python_2_unicode_... |
"""Test the minimum spanning tree function"""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_
import numpy.testing as npt
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
def test_minimum_spanning_tree():
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Check for stylistic and formal issues in .rst and .py
# files included in the documentation.
#
# 01/2009, Georg Brandl
# TODO: - wrong versions in versionadded/changed
# - wrong markup after versionchanged directive
import os
import re
import sys
import getopt
f... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-NetLocalGroup',
'Author': ['@harmj0y'],
'Description': ('Returns a list of all current users in a specified local group '
'on ... |
import copy
from botocore.args import ClientArgsCreator
import botocore.serialize
import botocore.parsers
from .config import AioConfig
from .endpoint import AioEndpointCreator
from .signers import AioRequestSigner
class AioClientArgsCreator(ClientArgsCreator):
# NOTE: we override this so we can pull out the cu... |
import chainer
def depthwise_convolution_2d(x, W, b=None, stride=1, pad=0):
"""Two-dimensional depthwise convolution function.
This is an implementation of two-dimensional depthwise convolution.
It takes two or three variables: the input image ``x``, the filter weight
``W``, and optionally, the bias ... |
from .utils import xpath
from openstates.scrape import Scraper, Organization
import lxml.etree
class WACommitteeScraper(Scraper):
_base_url = "http://wslwebservices.leg.wa.gov/CommitteeService.asmx"
def scrape(self, chamber=None, session=None):
if not session:
session = self.latest_sess... |
# -*- 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):
db.rename_table('user_api_usercoursetags', 'user_api_usercoursetag')
def backwards(self, orm):
db.rena... |
""" python wrapper for Autodesk Revit Server
This is a python module for interacting with Autodesk Revit Server using
its RESTful API. This module requires 'requests' module for handling http
requests to the Revit Server.
Module Files:
exceptions.py: Defines module exceptions and custom exceptions for
... |
# -----------------------------------------------------------------------------
# yacc_literal.py
#
# Grammar with bad literal characters
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex imp... |
from __future__ import unicode_literals
from guessit import UnicodeMixin, base_text_type, Guess
from guessit.textutils import clean_string, str_fill
from guessit.patterns import group_delimiters
from guessit.guess import (merge_similar_guesses, merge_all,
choose_int, choose_string)
import cop... |
"""Tests for methods defined in util/misc.py"""
from xmodule.util.misc import escape_html_characters
from unittest import TestCase
class UtilHtmlEscapeTests(TestCase):
"""
Tests for methods exposed in util/misc
"""
final_content = " This is a paragraph. "
def test_escape_html_comments(self):
... |
'''
Parallel Command
@author: Kay Kasemir
'''
from scan.commands import Command
try:
import xml.etree.cElementTree as ET
except:
import xml.etree.ElementTree as ET
class Parallel(Command):
"""Perform multiple commands in parallel.
Each of the commands performed in parallel may await
callback ... |
from openerp.osv import fields, osv
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'
_description = 'Account Central Journal'
_inherit = "account.common.journal.report"
_columns = {
'journal_ids': fields.many2many('account.journal', 'account_central_journal_jou... |
import configparser
import argparse
import numpy as np
import os
import redis
import sys
import time
import signal
import threading
import pyaudio
if hasattr(sys, 'frozen'):
path = os.path.split(sys.executable)[0]
file = os.path.split(sys.executable)[-1]
name = os.path.splitext(file)[0]
elif __name__=='__m... |
#!/usr/bin/python
"""ansible module for ec2 ami copy to all regions"""
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
import boto.ec2
class AMICopy(object):
"""simple wrapper class for rhsm repos"""
regions_to_copy = ['ap-southeast-1',
'ap-southeast-2',
... |
#!/usr/bin/env python
import string
from AOR.BasicStatement import BasicNamedStatement, BasicStatement
from AOR.DoubleList import DoubleList
class Select(BasicNamedStatement):
# Stores a select statement
#
# sLabel -- Label of the select statement (this is NOT the label
# used in t... |
# runs all the GUIedit charts in this directory -
# makes a PDF sample for eaxh existing chart type
import sys
import glob
import inspect
import types
def moduleClasses(mod):
def P(obj, m=mod.__name__, CT=type):
return (type(obj)==CT and obj.__module__==m)
try:
return inspect.getmembers(mod, P)... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para tumi.tv
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urllib
from core import scrapertools
from c... |
import zeroinstall
import os
from zeroinstall import _
from zeroinstall.support import tasks, unicode
from zeroinstall.injector.model import Interface, Feed, stable, testing, developer, stability_levels
from zeroinstall.injector import writer, namespaces, gpg
from zeroinstall.gtkui import help_box
import gtk
from logg... |
from __future__ import unicode_literals
import json
import warnings
from django.db import models
from django.utils import six
from django.utils.deconstruct import deconstructible
from django.utils.deprecation import RemovedInDjango110Warning
from django.utils.encoding import force_text, python_2_unicode_compatible
#... |
from openerp.osv.orm import TransientModel
class WizardMultiChartsAccounts(TransientModel):
_inherit ='wizard.multi.charts.accounts'
def onchange_chart_template_id(self, cursor, uid, ids, chart_template_id=False, context=None):
if context is None: context = {}
res = super(WizardMultiChartsAcc... |
"""Defines the layer abstraction for hybrid models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.tensor_forest.python import tensor_forest
class HybridLayer(object):
"""Layers are building blocks for hybrid models."""
def... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.