code stringlengths 1 199k |
|---|
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: bigip_virtual_server
short_description: Manage LTM virtual ser... |
from ansible.module_utils.ec2 import camel_dict_to_snake_dict, get_ec2_security_group_ids_from_names, \
ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict, compare_policies as compare_dicts, \
AWSRetry
from ansible.module_utils.aws.elb_utils import get_elb, get_elb_listener, convert_tg_name_to_arn
t... |
"""
Volume driver for NetApp E-Series iSCSI storage systems.
"""
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.netapp.eseries import library
from cinder.volume.drivers.netapp import utils as na_utils
@interface.volumedriver
class NetAppEseriesISCSIDriver(driver.BaseVD,
... |
"""
Defines some base class related to managing green threads.
"""
import abc
import logging
import socket
import time
import traceback
import weakref
import netaddr
from ryu.lib import hub
from ryu.lib import sockopt
from ryu.lib.hub import Timeout
from ryu.lib.packet.bgp import RF_IPv4_UC
from ryu.lib.packet.bgp im... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import dedent
from pants.backend.python.subsystems.python_setup import PythonSetup
from pants.python.python_repos import PythonRepos
from pants_test.backe... |
"""
HappyBase utility tests.
"""
from nose.tools import assert_equal, assert_less
import happybase.util as util
def test_camel_case_to_pep8():
def check(lower_cc, upper_cc, correct):
x1 = util.camel_case_to_pep8(lower_cc)
x2 = util.camel_case_to_pep8(upper_cc)
assert_equal(correct, x1)
... |
from warnings import warn
warn("IPython.utils.localinterfaces has moved to jupyter_client.localinterfaces", stacklevel=2)
from jupyter_client.localinterfaces import * |
from m5.SimObject import SimObject
from m5.params import *
from m5.proxy import *
from Device import BasicPioDevice, DmaDevice, PioDevice
class PciConfigAll(PioDevice):
type = 'PciConfigAll'
cxx_header = "dev/pciconfigall.hh"
platform = Param.Platform(Parent.any, "Platform this device is part of.")
pio_... |
'''Calculate radius of gyration of neurites.'''
import neurom as nm
from neurom import morphmath as mm
from neurom.core.dataformat import COLS
import numpy as np
def segment_centre_of_mass(seg):
'''Calculate and return centre of mass of a segment.
C, seg_volalculated as centre of mass of conical frustum'''
... |
import re
import sys
GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$')
def GetOSName(platform_name=sys.platform):
if platform_name == 'cygwin' or platform_name.startswith('win'):
return 'win'
elif platform_name.startswith('linux'):
return 'unix'
elif platform_name.startswith('darwin'):
return 'mac'
... |
from nose.plugins.attrib import attr
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
@attr(requires='apache')
class TestCheckApache(AgentCheckTest):
CHECK_NAME = 'apache'
CONFIG_STUBS = [
{
'apache_status_url': 'http://localhost:8180/server-status',
'... |
from __future__ import absolute_import, division, print_function
INCLUDES = """
"""
TYPES = """
typedef struct { ...; } HMAC_CTX;
"""
FUNCTIONS = """
void HMAC_CTX_init(HMAC_CTX *);
void HMAC_CTX_cleanup(HMAC_CTX *);
int Cryptography_HMAC_Init_ex(HMAC_CTX *, const void *, int, const EVP_MD *,
... |
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
import cogcomp.base.ttypes
import cogcomp.curator.ttypes
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None |
from __future__ import unicode_literals
"""
Contains the Document class representing an object / record
"""
import webnotes
import webnotes.model.meta
from webnotes.utils import *
valid_fields_map = {}
class Document:
"""
The wn(meta-data)framework equivalent of a Database Record.
Stores,Retrieves,Updates the ... |
from navmazing import NavigateToSibling
from widgetastic.utils import Parameter
from widgetastic.widget import View
from widgetastic_patternfly import Accordion, Button, Dropdown
from cfme.base import Server
from cfme.base.login import BaseLoggedInPage
from cfme.utils.appliance.implementations.ui import navigator, CFME... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webapps.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
try:
from beaker.crypto.pbkdf2 import PBKDF2
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
self.passphrase = passphrase
self.salt = salt
sel... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
name: sequence
author: Jayson Vantuyl (!UNKNOWN) <jayson@aggressive.ly>
version_added: "1.0"
short_description: generate a list based on a number sequence
description:
- generates a sequ... |
from yt.mods import load
import sys
from matplotlib.pylab import imshow, savefig
for fn in sys.argv[1:]:
fields = ['dend']
pf = load(fn)
c = 0.5 * (pf.domain_left_edge + pf.domain_right_edge)
S = pf.domain_right_edge - pf.domain_left_edge
n_d = pf.domain_dimensions
slc = pf.h.slice(2, c[2], fiel... |
DOCUMENTATION = '''
---
module: uri
short_description: Interacts with webservices
description:
- Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE
HTTP authentication mechanisms.
version_added: "1.1"
options:
url:
description:
- HTTP or HTTPS URL in the form (http|https):/... |
"""
Base test classes for LMS instructor-initiated background tasks
"""
import os
import json
from mock import Mock
import shutil
import unicodecsv
from uuid import uuid4
from celery.states import SUCCESS, FAILURE
from django.core.urlresolvers import reverse
from django.test.testcases import TestCase
from django.contri... |
from spack import *
class Dftd3Lib(MakefilePackage):
"""A dispersion correction for density functionals,
Hartree-Fock and semi-empirical quantum chemical methods"""
homepage = "https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dft-d3"
url = "https://github.com/dftbplus/dftd3-lib/a... |
from security_monkey import db
from security_monkey import app
from flask_wtf.csrf import generate_csrf
from security_monkey.decorators import crossdomain
from flask.ext.restful import fields, marshal, Resource, reqparse
from flask.ext.login import current_user
ORIGINS = [
'https://{}:{}'.format(app.config.get('FQD... |
"""
Serialize user
"""
def serialize_group_for_user(group, user):
return {
'name': group.name,
'id': group._id,
'role': user.group_role(group)
}
def serialize_user(user):
potential_spam_profile_content = {
'schools': user.schools,
'jobs': user.jobs
}
return {
... |
from io import BytesIO
from mapproxy.test.helper import Mocker
from mapproxy.test.mocker import ANY
from mapproxy.response import Response
from mapproxy.compat import string_type
class TestResponse(Mocker):
def test_str_response(self):
resp = Response("string content")
assert isinstance(resp.respons... |
"""Contrib version of MirroredStrategy."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.distribute import distribute_lib
from tensorflow.python.distribute import input_lib
from tensorflow.python.distribute import mirrored_strategy
_c... |
"""Check multiple key definition"""
__revision__ = 5
correct_dict = {
'tea': 'for two',
'two': 'for tea',
}
wrong_dict = {
'tea': 'for two',
'two': 'for tea',
'tea': 'time',
} |
"""
Defines geometric primitives like prisms, spheres, etc.
"""
from __future__ import division, absolute_import
from future.builtins import object, super
import copy as cp
import numpy as np
class GeometricElement(object):
"""
Base class for all geometric elements.
"""
def __init__(self, props):
... |
from __future__ import division, print_function, unicode_literals
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "s, t 4.9, s, t 5.1, s, t 10.1, s, t 10.2, s, q"
tags = "sequence, MoveBy, Reverse"
import cocos
from cocos.director import director
from cocos.sprite impor... |
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 License, or
(at your option) any later version.
This pr... |
from pyshop.models import (create_engine, dispose_engine,
Base, DBSession,
Group, User, Permission,
Classifier, Package, Release, ReleaseFile
)
from pyshop.bin.install import populate
from .conf import settings
... |
"""Support for International Space Station data sensor."""
from datetime import timedelta
import logging
import pyiss
import requests
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
... |
from typing import Text
from django.test import TestCase
from zerver.lib.test_classes import WebhookTestCase
from zerver.webhooks.appfollow.view import convert_markdown
class AppFollowHookTests(WebhookTestCase):
STREAM_NAME = 'appfollow'
URL_TEMPLATE = u"/api/v1/external/appfollow?stream={stream}&api_key={api_k... |
"""
Offer numeric state listening automation rules.
For more details about this automation rule, please refer to the documentation
at https://home-assistant.io/docs/automation/trigger/#numeric-state-trigger
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassis... |
from distutils.version import LooseVersion
import pytest
from joblib import Parallel
import joblib
from numpy.testing import assert_array_equal
from sklearn._config import config_context, get_config
from sklearn.utils.fixes import delayed
def get_working_memory():
return get_config()["working_memory"]
@pytest.mark.... |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
from django.core.management import call_command
call_command("loaddata", "transport.json")
def backwards(self, orm):
"Write you... |
"""Usage information for the main IPython applications.
"""
import sys
from IPython.core import release
cl_usage = """\
=========
IPython
=========
Tools for Interactive Computing in Python
=========================================
A Python shell with automatic history (input and output), dynamic object
intros... |
"""Unit tests for run_perf_tests."""
import StringIO
import datetime
import json
import re
import unittest
from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.layout_tests.port.driver import DriverOutput
from webkitpy.layout_tests.port.test import ... |
from copy import deepcopy
import unittest
from host_file_system_provider import HostFileSystemProvider
from host_file_system_iterator import HostFileSystemIterator
from object_store_creator import ObjectStoreCreator
from test_branch_utility import TestBranchUtility
from test_data.canned_data import CANNED_API_FILE_SYST... |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal, assert_array_equal,
assert_array_almost_equal, assert_allclose, assert_raises, TestCase,
run_module_suite)
from numpy import array, diff, lins... |
"""SCons.Tool.filesystem
Tool-specific initialization for the filesystem tools.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
__revision__ = "src/engine/SCons/Tool/filesystem.py 2014/03/02 14:18:15 garyo"
imp... |
"""
Debugging module. Stores the program debug level and provides debugging output
functions. Only debugging output with level less than or equal to the current
debug level is output. Note that debugging output with level greater than the
current maximum debug level is treated as having a level equal to the current
max... |
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
DOCUMENTATION = """
module: pamd
author:
- "Kenneth D. Evensen (@kevensen)"
short_description: Manage PAM Modules
description:
- Edit PAM service's type, control, module path and module arguments.
In... |
from openerp import fields, models
class company(models.Model):
_inherit = "res.company"
calendar_mark_done_user_id = fields.Many2one(
'res.users', string='Calendar Mark Done User') |
"""The rescue mode extension."""
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions as exts
from nova.api.openstack import wsgi
from nova import compute
from nova import exception
from nova import flags
from nova import log as logging
from nova import util... |
from contextlib import contextmanager
import status
@contextmanager
def context(grpc_context):
"""A context manager that automatically handles KeyError."""
try:
yield
except KeyError as key_error:
grpc_context.code(status.Code.NOT_FOUND)
grpc_context.details(
'Unable to f... |
import distutils.dir_util
import glob
import os
import shutil
import subprocess
import time
import pytest
import logging
from cassandra.concurrent import execute_concurrent_with_args
from dtest_setup_overrides import DTestSetupOverrides
from dtest import Tester, create_ks
from tools.assertions import assert_one
from to... |
import Gaffer
import GafferImage
Gaffer.Metadata.registerNode(
GafferImage.DeepMerge,
"description",
"""
Merges the samples from two or more images into a single deep image.
The source images may be deep or flat.
""",
plugs = {
"in.*" : [
"description",
"""
A deep or flat image input.
""",
],
}
... |
from __future__ import unicode_literals
import frappe
def execute():
try:
frappe.db.sql("alter table `tabEmail Queue` change `ref_docname` `reference_name` varchar(255)")
except Exception, e:
if e.args[0] not in (1054, 1060):
raise
try:
frappe.db.sql("alter table `tabEmail Queue` change `ref_doctype` `refer... |
"""
***************************************************************************
hugeFileGroundClassify.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
*********************************... |
import pytest
from cfme.utils import safe_string
@pytest.mark.parametrize("source, result", [
(u'\u25cf', '●'),
(u'ฤลกฤ', 'ěšč'),
(u'ะฒะทะพัะฒะฐัััั', 'взорваться'),
(4, '4')],
ids=['ugly_nonunicode_character', 'latin_diacrit... |
import base_module_save
import base_module_record_objects
import base_module_record_data |
import asyncio
import logging
import unittest
import grpc
from grpc.experimental import aio
from src.proto.grpc.testing import messages_pb2
from src.proto.grpc.testing import test_pb2_grpc
from tests_aio.unit import _common
from tests_aio.unit import _constants
from tests_aio.unit._test_base import AioTestBase
from tes... |
"""l3_support
Revision ID: 2c4af419145b
Revises: folsom
Create Date: 2013-03-11 19:26:45.697774
"""
revision = '2c4af419145b'
down_revision = 'folsom'
migration_for_plugins = [
'neutron.plugins.bigswitch.plugin.NeutronRestProxyV2',
'neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin',
'neutron... |
import webob
from nova.api.openstack.compute.legacy_v2.contrib import virtual_interfaces \
as vi20
from nova.api.openstack.compute import virtual_interfaces as vi21
from nova import compute
from nova.compute import api as compute_api
from nova import context
from nova import exception
from nova import network
f... |
"""This component provides support for Stookalert Binary Sensor."""
from datetime import timedelta
import stookalert
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_SAFETY,
PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.const import ATTR_ATTRIBUTION, CON... |
"""BibFormat element
* Part of the video platform prototype
* Creates a list of video suggestions
* Based on word similarity ranking
* Must be done in a collection that holds video records with thumbnails, title and author
"""
from invenio.config import CFG_SITE_URL
from invenio.bibdocfile import BibRecDocs
from inveni... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
DOCUMENTATION = """
---
module: nxos_config
extends_documentation_fragment: nxos
version_added: "2.1"
author: "Peter Sprygada (@privateip)"
short_description: Manage Cisco NXOS config... |
import logging
import logging.handlers
import os
import pprint
import release
import sys
import threading
import psycopg2
import openerp
import sql_db
import tools
_logger = logging.getLogger(__name__)
def log(logger, level, prefix, msg, depth=None):
indent=''
indent_after=' '*len(prefix)
for line in (prefi... |
from openerp import models, fields, api
class StockHistory(models.Model):
_inherit = 'stock.history'
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None,
orderby=False, lazy=True):
res = super(StockHistory, self).read_group(
domain, fields, gr... |
import subprocess
import inspect, os, sys
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfolder not in sys.path:
sys.path.insert(0, cmd_subfolder)
import mosq_test
rc = 1
mid = 53
keepalive = 60
connect_packet = mosq_test.g... |
import re
from wlauto import AndroidUiAutoBenchmark
class Caffeinemark(AndroidUiAutoBenchmark):
name = 'caffeinemark'
description = """
CaffeineMark is a series of tests that measure the speed of Java
programs running in various hardware and software configurations.
http://www.benchmarkhq.ru/cm30/in... |
"""Local Nest authentication."""
import asyncio
from functools import partial
from homeassistant.core import callback
from . import config_flow
from .const import DOMAIN
@callback
def initialize(hass, client_id, client_secret):
"""Initialize a local auth provider."""
config_flow.register_flow_implementation(
... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from collections import OrderedDict
import six
from six.moves import zip
import warnings
import numpy as np
from matplotlib.path import Path
from matplotlib import rcParams
import matplotlib.font_manager as font... |
"""Common paths for pyauto tests."""
import os
import sys
def GetSourceDir():
"""Returns src/ directory."""
script_dir = os.path.abspath(os.path.dirname(__file__))
return os.path.join(script_dir, os.pardir, os.pardir, os.pardir)
def GetThirdPartyDir():
"""Returns src/third_party directory."""
return os.path.j... |
from __future__ import unicode_literals, print_function, division
__author__ = 'dongliu'
import struct
import socket
from pcapparser.constant import *
class TcpPack:
""" a tcp packet, header fields and data. """
TYPE_INIT = 1 # init tcp connection
TYPE_INIT_ACK = 2
TYPE_ESTABLISH = 0 # establish conn
... |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from erpnext.controllers.accounts_controller import validate_taxes_and_charges, validate_inclusive_tax
class SalesTaxesandChargesTemplate(Document):
def validate(self):
valdiate_taxes_and_charges_template(self)
def valdi... |
"""
Models for contentserver
"""
from django.db.models.fields import PositiveIntegerField
from config_models.models import ConfigurationModel
class CourseAssetCacheTtlConfig(ConfigurationModel):
"""Configuration for the TTL of course assets."""
class Meta(object):
app_label = 'contentserver'
cache_t... |
"""Generate graphs with a given degree sequence or expected degree sequence.
"""
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
'Pieter Swart (swart@lanl.gov)',
'Dan Schult (dschult@colgate.edu)'
'Joel Miller (joel... |
"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
from .test import *
from .sauce import *
DEBUG = True
SITE_NAME = 'localhost:{}'.format(LETTUCE_SERVER_PORT)
import logging
logging.basicConfig(filename=TEST_ROOT / "log" / "lms_acceptance.log", level=lo... |
import sys
from testrunner import run
QR_CODE = (
"โโโโโโโโโโโโโโ โโโโโโโโโโ โโ โโโโโโโโโโโโโโ\n"
"โโ โโ โโ โโ โโโโ โโ โโ\n"
"โโ โโโโโโ โโ โโโโ โโ โโโโ โโ โโโโโโ โโ\n"
"โโ โโโโโโ โโ โโโโ โโ โโ โโโโโโ โโ\n"
"โโ โโโโโโ โโ โโโโโโโโโโ โ... |
import os
import shutil
import tempfile
import unittest
import xml.etree.ElementTree as ET
import coalesce
class TestCoalesce(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix='coalesce_test_')
def tearDown(self):
shutil.rmtree(self.tmpdir)
def make_result(self, name... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins import BasePlugin
from sleekxmpp.plu... |
from cvxpy import *
import numpy as np
import scipy.sparse as sp
np.random.seed(5)
n = 10000
m = 100
pbar = (np.ones((n, 1)) * .03 +
np.matrix(np.append(np.random.rand(n - 1, 1), 0)).T * .12)
F = sp.rand(m, n, density=0.01)
F.data = np.ones(len(F.data))
D = sp.eye(n).tocoo()
D.data = np.random.randn(len(D.data)... |
import codecs
import sys
import xml.etree.ElementTree as ET
input_list = []
for arg in sys.argv[1:]:
input_list.append(arg)
if len(input_list) < 1:
print 'usage: makerst.py <classes.xml>'
sys.exit(0)
def validate_tag(elem, tag):
if elem.tag != tag:
print "Tag mismatch, expected '" + tag + "', go... |
"""
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 2
of the License, or (at your option) any la... |
"""Library of dtypes (Tensor element types)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.core.framework import types_pb2
class DType(object):
"""Represents the type of the elements in a `Tensor`.
The following `DT... |
import numpy as np
from scipy.stats import rankdata as _sp_rankdata
def _rankdata(a, method="average"):
"""Assign ranks to data, dealing with ties appropriately.
Ranks begin at 1. The method argument controls how ranks are assigned
to equal values.
Parameters
----------
a : array_like
Th... |
import csv, json
from glob import glob
from os.path import basename, join
with open(join('us-data', 'codes.txt')) as f:
rows = list(csv.DictReader(f, dialect='excel-tab'))
codes = dict([(row['Postal Code'].lower(), row['State']) for row in rows])
with open(join('us-data', 'states.txt')) as f:
rows = list(cs... |
from __future__ import absolute_import, print_function, unicode_literals
import sys
if __name__ == "__main__":
from kolibri.utils.cli import main
main(args=sys.argv[1:]) |
"""
Specific overrides to the base prod settings to make development easier.
"""
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
del DEFAULT_FILE_STORAGE
MEDIA_ROOT = "/edx/var/edxapp/uploads"
DEBUG = True
USE_I18N = True
TEMPLATE_DEBUG = DEBUG
import logging
for pkg_name in ['track.contex... |
from toolz import frequencies, identity
big_data = range(1000)*1000
small_data = range(100)
def test_frequencies():
frequencies(big_data)
def test_frequencies_small():
for i in range(1000):
frequencies(small_data) |
import pygtk
pygtk.require('2.0')
import gtk
import time
from ivy.std_api import *
import logging
class Base:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("destroy", self.destroy)
self.entry = gtk.Entry()
self.entry.set_width_chars(120)
self.entry.connect("... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible.plugins.action import ActionBase
from ansible.utils.boolean import boolean
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=dict()):
src = self._task.args.get('src', None)
... |
from __future__ import absolute_import
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.contrib.auth.views import password_change, password_change_done
from admin.common_auth import views
app_name = 'admin'
urlpatterns = [
url(r'^login/?$', views.LoginView.as_view(), na... |
from django.utils.encoding import python_2_unicode_compatible
from ..admin import admin
from ..models import models
@python_2_unicode_compatible
class City(models.Model):
name = models.CharField(max_length=30)
point = models.PointField()
class Meta:
app_label = 'geoadmin'
required_db_feature... |
from glob import glob
from distutils import log
import distutils.command.sdist as orig
import os
import sys
from setuptools.compat import PY3
from setuptools.utils import cs_path_exists
import pkg_resources
READMES = 'README', 'README.rst', 'README.txt'
_default_revctrl = list
def walk_revctrl(dirname=''):
"""Find ... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... |
MONGO_HOST = 'localhost' # server to connect to
MONGO_PORT = 27017 # port MongoD is running on
MONGO_DATABASE = 'crits' # database name to connect to
MONGO_SSL = False # whether MongoD has SSL enabled
MONGO_USER = '' # mongo user with "readWrite" role in the database
MONGO... |
import os
from nupic.frameworks.opf.expdescriptionhelpers import importBaseDescription
config = \
{
'dataSource': 'file://' + os.path.join(os.path.dirname(__file__),
'../datasets/category_SP_0.csv'),
'modelParams': { 'clParams': { 'clVerbosity': 1},
'infer... |
from django.conf.urls import url
from django.contrib.auth.decorators import login_required as login
from . import views
urlpatterns = [
url(r'^$', login(views.OSFStatisticsListView.as_view()), name='stats_list'),
url(r'^update/$', login(views.update_metrics), name='update'),
url(r'^download/$', login(views.... |
from __future__ import unicode_literals
from six.moves.urllib.parse import parse_qs
import boto
from freezegun import freeze_time
import httpretty
import sure # noqa
from moto import mock_sns, mock_sqs
@mock_sqs
@mock_sns
def test_publish_to_sqs():
conn = boto.connect_sns()
conn.create_topic("some-topic")
... |
from lettuce import step
def assert_in(condition, possibilities):
assert condition in possibilities, \
u"%r ใฏๆฌกใฎใชในใใซๅ
ฅใฃใฆใใๅฏ่ฝๆงใใใ: %r" % (
condition, possibilities
)
@step(u'ๅ
ฅๅๅคใ (.*) ใจใ')
def dado_que_tenho(step, group):
possibilities = [
u'ไฝใ',
u'ใใฎไป',
u'ใใผใฟ'
]
... |
"""
celery.utils.patch
~~~~~~~~~~~~~~~~~~
Monkey-patch to ensure loggers are process aware.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
_process_aware = False
def _patch_logger_class():
"""Make s... |
{'name': 'Credit control dunning fees',
'version': '0.1.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp',
'category': 'Accounting',
'complexity': 'normal',
'depends': ['account_credit_control'],
'website': 'http://www.camptocamp.com',
'data': ['view/policy_view.xml',
... |
import unittest
from test.test_support import TestSkipped, run_unittest
import os, struct
try:
import fcntl, termios
except ImportError:
raise TestSkipped("No fcntl or termios module")
if not hasattr(termios,'TIOCGPGRP'):
raise TestSkipped("termios module doesn't have TIOCGPGRP")
try:
tty = open("/dev/t... |
import pytest
from tests.support.asserts import assert_error, assert_files_uploaded, assert_success
from tests.support.inline import inline
from . import map_files_to_multiline_text
def element_send_keys(session, element, text):
return session.transport.send(
"POST", "/session/{session_id}/element/{element_... |
from ..gobject import GParamFlags
from .gibaseinfo import GIBaseInfo
from .gitypeinfo import GITypeInfo, GIInfoType
from .giarginfo import GITransfer
from .._utils import find_library, wrap_class
_gir = find_library("girepository-1.0")
@GIBaseInfo._register(GIInfoType.PROPERTY)
class GIPropertyInfo(GIBaseInfo):
def... |
"""A non-blocking, single-threaded HTTP server.
Typical applications have little direct interaction with the `HTTPServer`
class except to start a server at the beginning of the process
(and even that is often done indirectly via `tornado.web.Application.listen`).
This module also defines the `HTTPRequest` class which i... |
import sys, os
from datetime import date
extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Clang Static Analyzer'
copyright = u'2013-%d, Analyzer Team' % date.today().year
version = '5'
release = '5'
exclude_patterns = ['_build... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.