content string |
|---|
identifier = 'org.vistrails.vistrails.spreadsheet'
name = 'VisTrails Spreadsheet'
version = '0.9.3'
old_identifiers = ['edu.utah.sci.vistrails.spreadsheet'] |
"""
Database update scripts for usage with B{dak update-db}
@contact: Debian FTP Master <<EMAIL>>
@copyright: 2008 Michael Casadevall <<EMAIL>>
@license: GNU General Public License version 2 or later
Update scripts have to C{import psycopg2} and
C{from daklib.dak_exceptions import DBUpdateError}.
There has to be B{... |
# kivy pygments style based on flask/tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class KivyStyle(Style):
# The background color is set in kivystyle.sty
background_color ... |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (<EMAIL>)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characters we need ... |
from __future__ import absolute_import
import dnf.cli.commands.repolist as repolist
import dnf.repo
import tests.support
class TestRepolist(tests.support.TestCase):
@tests.support.mock.patch('dnf.cli.commands.repolist._',
dnf.pycomp.NullTranslations().ugettext)
def test_expire_s... |
import numpy as np
from sklearn.utils.murmurhash import murmurhash3_32
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
def test_mmhash3_int():
assert murmurhash3_32(3) == 847579505
assert murmurhash3_32(3, seed=0) == 847579505
assert murmurhash3_32(3, seed=... |
# -*- coding: utf-8 -*-
__version__ = '$Id: 139dc689ef6baf1ed224d300766f7b7ea658cb0f $'
import sys; sys.path.append('..')
import re
import terminal_interface
import wx
app = wx.App()
class UI(terminal_interface.UI):
def __init__(self):
pass
def input(self, question, password = False):
"""... |
__revision__ = "src/engine/SCons/Sig.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
__doc__ = """Place-holder for the old SCons.Sig module hierarchy
This is no longer used, but code out there (such as the NSIS module on
the SCons wiki) may try to import SCons.Sig. If so, we generate a warning
that points... |
from math import *
from collections import defaultdict
import bpy
from bpy.props import BoolProperty, StringProperty, EnumProperty, FloatVectorProperty, IntProperty
import json
import io
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import updateNode, match_long_repeat, zip_long_rep... |
__all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN',
'EVENT_JOBSTORE_ADDED', 'EVENT_JOBSTORE_REMOVED',
'EVENT_JOBSTORE_JOB_ADDED', 'EVENT_JOBSTORE_JOB_REMOVED',
'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED',
'EVENT_ALL', 'SchedulerEvent', 'JobStoreEve... |
"""lbaasv2 TLS
Revision ID: lbaasv2_tls
Revises: 364f9b6064f0
Create Date: 2015-01-18 10:00:00
"""
# revision identifiers, used by Alembic.
revision = 'lbaasv2_tls'
down_revision = '364f9b6064f0'
from alembic import op
import sqlalchemy as sa
from neutron.db import migration
old_listener_protocols = sa.Enum("HTT... |
"""Interface for data decoders.
Data decoders decode the input data and return a dictionary of tensors keyed by
the entries in core.reader.Fields.
"""
from abc import ABCMeta
from abc import abstractmethod
class DataDecoder(object):
"""Interface for data decoders."""
__metaclass__ = ABCMeta
@abstractmethod
... |
import gl_XML, glX_XML
import string
class glx_proto_item_factory(glX_XML.glx_item_factory):
"""Factory to create GLX protocol oriented objects derived from gl_item."""
def create_item(self, name, element, context):
if name == "type":
return glx_proto_type(element, context)
else:
return glX_XML.glx_i... |
import unittest
from autothreadharness.harness_case import HarnessCase
class SED_6_2_1(HarnessCase):
role = HarnessCase.ROLE_SED
case = '6 2 1'
golden_devices_required = 2
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main() |
#!/usr/bin/env python
'Unit test for trepan.lib.pp'
import sys, unittest
from import_relative import import_relative
Mpp = import_relative('lib.pp', '...trepan')
class TestLibPrint(unittest.TestCase):
def setUp(self):
self.msgs = []
return
def msg_nocr(self, msg):
if len(self.msgs) >... |
from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField
class Location(models.Model):
point = models.PointField()
objects = models.GeoManager()
def __unicode__(self): return self.point.wkt
class City(models.Model):
name = models.CharField(max_length=50)
... |
# -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... |
from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class FileToGoogleCloudStorageOperator(BaseOperator):
"""
Uploads a file to Google Cloud Storage
:param src: Path to the local file. (templated)
... |
from __future__ import absolute_import, unicode_literals
import io
import os
import sys
from collections import defaultdict
from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from six import string_types
def read_configu... |
from nova.tests.functional.v3 import test_servers
from nova.tests.unit.image import fake
class PersonalitySampleJsonTest(test_servers.ServersSampleBase):
extension_name = 'os-personality'
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def test_servers_post(self):
self._post_... |
from sympy import (
sqrt, Derivative, symbols, collect, Function, factor, Wild, S,
collect_const, log, fraction, I, cos, Add, O,sin, rcollect,
Mul, radsimp, diff, root, Symbol, Rational, exp)
from sympy.core.mul import _unevaluated_Mul as umul
from sympy.simplify.radsimp import _unevaluated_Add, collect_sq... |
"""distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
__revision__ = "$Id$"
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distutils import ... |
data = (
'Yun ', # 0x00
'Mwun ', # 0x01
'Nay ', # 0x02
'Gai ', # 0x03
'Gai ', # 0x04
'Bao ', # 0x05
'Cong ', # 0x06
'[?] ', # 0x07
'Xiong ', # 0x08
'Peng ', # 0x09
'Ju ', # 0x0a
'Tao ', # 0x0b
'Ge ', # 0x0c
'Pu ', # 0x0d
'An ', # 0x0e
'Pao ', # 0x0f
'Fu ', # 0x10
'Gong... |
from django.db import models
from django.core.urlresolvers import reverse
from django.template.defaultfilters import slugify
# Create your models here.
class Post (models.Model):
title = models.CharField(max_length=40)
post_image = models.ImageField(upload_to='static/blog', blank=True)
post_body = models.TextField... |
from spack import *
class PyNumpydoc(PythonPackage):
"""numpydoc - Numpy's Sphinx extensions"""
homepage = "https://github.com/numpy/numpydoc"
url = "https://pypi.io/packages/source/n/numpydoc/numpydoc-0.6.0.tar.gz"
version('0.6.0', '5f1763c44e613850d56ba1b1cf1cb146')
depends_on('<EMAIL>:2... |
{
'name': 'Contracts Management',
'version': '1.1',
'category': 'Sales Management',
'description': """
This module is for modifying account analytic view to show important data to project manager of services companies.
=====================================================================================... |
#! /usr/bin/env python
# input parameters
header = raw_input('\nhdr: header (1=Yes, 0=No) ?\n')
pos_diff = raw_input('hdr: distance (clustering condition) ?\n')
cl_size = raw_input('hdr: min cluster size ?\n')
collapse_size = raw_input('hdr: min distance to collapse clusters ?\n\n')
infile = raw_input('hdr: data filen... |
# -*- coding: utf-8 -*-
import numpy as np
from pyfr.backends.base import BaseBackend
from pyfr.mpiutil import get_local_rank
class MICBackend(BaseBackend):
name = 'mic'
def __init__(self, cfg):
super().__init__(cfg)
import pymic as mic
# Get the device ID to use
devid = c... |
from m5.params import *
from m5.proxy import *
from MemObject import MemObject
from Prefetcher import BasePrefetcher
class BaseCache(MemObject):
type = 'BaseCache'
assoc = Param.Int("associativity")
block_size = Param.Int("block size in bytes")
hit_latency = Param.Cycles("The hit latency for this cach... |
# -*- coding: utf-8 -*-
import pytest
from raiden.utils import make_address, get_contract_path, privatekey_to_address
from raiden.network.discovery import ContractDiscovery
@pytest.mark.timeout(60)
@pytest.mark.parametrize('number_of_nodes', [1])
@pytest.mark.parametrize('poll_timeout', [80])
def test_endpointregist... |
import sys
import os
# Change path so we find Xlib
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from Xlib import X, display, Xutil
# Application window
class Window:
def __init__(self, display):
self.d = display
# Find which screen to open the window on
self.screen = self.d.screen()
# background pa... |
# -*- coding: utf-8 -*-
import datetime
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.c... |
"""The Flavor extra data extension
OpenStack API version 1.1 lists "name", "ram", "disk", "vcpus" as flavor
attributes. This extension adds to that list:
- OS-FLV-EXT-DATA:ephemeral
"""
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
authorize = extensions.soft_extension_authorizer('... |
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class GamificationBadgeUser(models.Model):
"""User having received a badge"""
_inherit = 'gamification.badge.user'
employee_id = fields.Many2one('hr.employee', string='Employee')
@api.constrains('employee_id')
de... |
# encoding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
encode_dict,
ExtractorError,
int_or_none,
parse_dura... |
""" General debugging framework """
import pdb
import sys
import inspect
import logging
import volatility.conf
config = volatility.conf.ConfObject()
config.add_option("DEBUG", short_option = 'd', default = 0,
cache_invalidator = False,
action = 'count', help = "Debug volatility")
#... |
from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
(declare-fun x1 () Real)
(declare-fun x2 () Real)
(declare-fun x3 () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[x1] (/ (- 5 (* (* 0.5 (^ (* 2 9.80665) 0.5)) (^ x1 0.5))) 2))
(= d/dt[x2] (/... |
"""VMware vCenter plugin for integration tests."""
from __future__ import absolute_import, print_function
import os
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.util import (
find_executable,
display,
)
from lib.docker_util import (
docker_run,
docker_rm,
docker_in... |
# <EMAIL>
# extending PSM list from second-pass Morpheus search for rescoring
import sys
import pymzml
import numpy
import pandas
def nearest(target, arr):
try:
return arr[numpy.abs(arr - target).argmin()]
except:
return 0
def peak_pair(target, arr):
match = [nearest(p, arr) for p in ta... |
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from pylearn2.models.model import Model
from pylearn2.utils import sharedX
import numpy as np
impo... |
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
class OpenStackCinder(Plugin):
"""OpenStack cinder
"""
plugin_name = "openstack_cinder"
profiles = ('openstack', 'openstack_controller')
option_list = [("db", "gathers openstack cinder db version", "slow",
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx import onyx_config
from units.modules.utils import set_module_args
from .onyx_module import TestOnyxModule, load_fixture
class TestOnyxConfigModule(TestOnyxMod... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'network'}
import json
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.c... |
import os
import shutil
import sys
import tempfile
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.core import test
from avocado.utils import script
PASS_SCRIPT_CONTENTS = """#!/bin/sh
true
"""
FAIL_SCRIPT_CONTENTS = """#!/bin/sh
false
"""
class TestClass... |
"""The asyncio package, tracking PEP 3156."""
# flake8: noqa
import sys
# This relies on each of the submodules having an __all__ variable.
from .base_events import *
from .coroutines import *
from .events import *
from .futures import *
from .locks import *
from .protocols import *
from .runners import *
from .queu... |
"""
Tests for L{twisted.internet._sigchld}, an alternate, superior SIGCHLD
monitoring API.
"""
import os, signal, errno
from twisted.python.log import msg
from twisted.trial.unittest import TestCase
from twisted.internet.fdesc import setNonBlocking
from twisted.internet._signals import installHandler, isDefaultHandle... |
from __future__ import absolute_import, division, print_function, \
with_statement
import socket
import logging
import struct
import errno
import random
from shadowsocks import encrypt, eventloop, lru_cache, common, shell
from shadowsocks.common import parse_header, pack_addr
BUF_SIZE = 65536
def client_key(s... |
from helpers import unittest
from luigi import Task
from luigi import Parameter
from luigi.task import MixinNaiveBulkComplete
COMPLETE_TASKS = ["A", "B", "C"]
class MockTask(MixinNaiveBulkComplete, Task):
param_a = Parameter()
param_b = Parameter(default="Not Mandatory")
def complete(self):
retu... |
'''
xbmcswift2.constants
--------------------
This module contains some helpful constants which ease interaction
with XBMC.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
from xbmcswift2 import xbmcplugin
class SortMethod(object):
'''Static cla... |
#!/usr/bin/env python
try:
from debian.changelog import Changelog
except ImportError:
class Changelog(object):
def __init__(self, _):
pass
def get_version(self):
return '0.0.0'
from os import environ
from os.path import abspath, dirname, join
from setuptools import setu... |
__revision__ = "$Id$"
from winappdbg import HexDump, Table
def do(self, arg):
".exchain - Show the SEH chain"
thread = self.get_thread_from_prefix()
print "Exception handlers for thread %d" % thread.get_tid()
print
table = Table()
table.addRow("Block", "Function")
bits = thread.get_bits()
... |
__revision__ = "$Id$"
## Description: function Update_Approval_DB
## This function updates the approval database with the
## decision of the referee
## Author: T.Baron
## PARAMETERS: categformatDAM: variable used to compute the category
## ... |
"""A library for performing constrained optimization in TensorFlow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.contrib.constrained_optimization.python.candidates import *
from tensorflow.contrib.cons... |
"""
Views for friends info API
"""
from rest_framework import generics, status
from rest_framework.response import Response
from opaque_keys.edx.keys import CourseKey
from student.models import CourseEnrollment
from ...utils import mobile_view
from ..utils import get_friends_from_facebook, get_linked_edx_accounts,... |
from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.oracle.schema import DatabaseSchemaEditor
from django.db.backends.utils import truncate_name
class OracleGISSchemaEditor(DatabaseSchemaEditor):
sql_add_geometry_metadata = ("""
INSERT INTO USER_SDO_GEOM_METADATA
... |
# Third Party Stuff
from builtins import str
from builtins import object
from django import forms
from django.db.models import Count, Q
from django.core.exceptions import ValidationError
# Spoken Tutorial Stuff
from creation.models import TutorialResource, FossCategory
from events.models import Testimonials, Induction... |
import math
f = 1.00 / 298.257 # Earth flattning factor
r_sat = 42164.57 # Distance from earth centre to satellite
r_eq = 6378.14 # Earth radius
def calcElevation(SatLon, SiteLat, SiteLon, Height_over_ocean = 0):
a0 = 0.58804392
a1 = -0.17941557
a2 = 0.29906946E-1
a3 = -0.25187400E-2
a4 = 0.82622101E-4
sin... |
def amin(a, axis=None, out=None, keepdims=False, dtype=None):
"""Returns the minimum of an array or the minimum along an axis.
Args:
a (cupy.ndarray): Array to take the minimum.
axis (int): Along which axis to take the minimum. The flattened array
is used by default.
out (cu... |
#!usr/bin/python
"""
Meta Data Extension for Python-Markdown
=======================================
This extension adds Meta Data handling to markdown.
Basic Usage:
>>> import markdown
>>> text = '''Title: A Test Doc.
... Author: Waylan Limberg
... John Doe
... Blank_Data:
...
.... |
"""
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decompiler. It
should be good enough for a large class of URLS, however.
"""
# Mapping of an escape character to a r... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.errors import AnsibleError
from ansible.module_utils._text import to_text
from ansible.module_utils.parsing.convert_bool import boolean
from ansible.parsing.yaml.objects import AnsibleUnicode
from ansible.... |
server = "irc.freenode.net"
port = 6667
channel = "#blink"
nickname = "commit-bot"
update_wait_seconds = 10
retry_attempts = 8 |
# -*- coding: utf-8 -*-
"""
blohg.ext
~~~~~~~~~
Blohg support for 3rd-party extensions.
:copyright: (c) 2010-2013 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
from flask import Blueprint
from flask.ctx import _app_ctx_stack
from flask.globals import current_app
f... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Not installing aliases from python-future; it's unreliable and slow.
from builtins import * # noqa
import os
from time import sleep
from nose.tools import eq_
from ha... |
"""
Test restart
"""
from __future__ import print_function, unicode_literals
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../lib')))
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..')))
import sickbeard
fro... |
"""For all the benchmarks that set options, test that the options are valid."""
from collections import defaultdict
import os
import unittest
from core import perf_benchmark
from telemetry import benchmark as benchmark_module
from telemetry.core import discover
from telemetry.internal.browser import browser_options
... |
import fnmatch
import imp
import logging
import modulefinder
import optparse
import os
import sys
import zipfile
from telemetry import benchmark
from telemetry.core import command_line
from telemetry.core import discover
from telemetry.core import util
from telemetry.util import bootstrap
from telemetry.util import cl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .exc import RPCError
class RPCClient(object):
"""Client for making RPC calls to connected servers.
:param protocol: An :py:class:`~tinyrpc.RPCProtocol` instance.
:param transport: A :py:class:`~tinyrpc.transports.ClientTransport`
i... |
"""Keras built-in loss functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Loss functions.
from tensorflow.contrib.keras.python.keras.losses import binary_crossentropy
from tensorflow.contrib.keras.python.keras.losses import categorical_crossent... |
"""Constants used during conversion."""
import re
# These are the various different matching possibilities Google Code
# recognizes. As matches are made, the respective handler class method is
# is called, which can do what it wishes with the match.
# The pragmas:
PRAGMA_NAMES = ["summary", "labels", "sidebar"]
PRAG... |
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from erpnext.stock.utils import get_incoming_rate
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = frappe._dict()
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
... |
import os
import sys
import ast
import yaml
import traceback
from ansible import utils
# modules that are ok that they do not have documentation strings
BLACKLIST_MODULES = [
'async_wrapper', 'accelerate', 'async_status'
]
def get_docstring(filename, verbose=False):
"""
Search for assignment of the DOCUME... |
from tinycss.page3 import CSSPage3Parser
import css_properties
from css_options import css_opts
from validations import ValidationHelpersMixin
DEBUG = True if __name__ == '__main__' else False
class MissingTokenType(Exception):
def __init__(self):
print('Invalid token type: please add a '
... |
from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.translation import ugettext as _
from django.conf import settings
from django.contrib.auth.models import User, SiteProfileNotAvailable
fro... |
from neutron.cmd.sanity import checks
from neutron.tests import base
from neutron.tests.functional import base as functional_base
class SanityTestCase(base.BaseTestCase):
"""Sanity checks that do not require root access.
Tests that just call checks.some_function() are to ensure that
neutron-sanity-check ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.netw... |
from .rest import RestClient
class Roles(object):
"""Auth0 roles endpoints
Args:
domain (str): Your Auth0 domain, e.g: 'username.auth0.com'
token (str): Management API v2 Token
telemetry (bool, optional): Enable or disable Telemetry
(defaults to True)
timeout (f... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'filter.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Filter(object):
def setupUi(self, Filter):
Filter.setObjec... |
import json
import logging
from dogapi import dog_stats_api
from .grading_service_module import GradingService, GradingServiceError
log = logging.getLogger(__name__)
class PeerGradingService(GradingService):
"""
Interface with the grading controller for peer grading
"""
METRIC_NAME = 'edxapp.open_e... |
import db
import datetime
from sickbeard.common import SNATCHED, SUBTITLED, Quality
dateFormat = "%Y%m%d%H%M%S"
def _logHistoryItem(action, showid, season, episode, quality, resource, provider):
logDate = datetime.datetime.today().strftime(dateFormat)
myDB = db.DBConnection()
myDB.action("... |
import boost.parallel.mpi as mpi
from generators import *
def scan_test(comm, generator, kind, op, op_kind):
if comm.rank == 0:
print ("Prefix reduction to %s of %s..." % (op_kind, kind)),
my_value = generator(comm.rank)
result = mpi.scan(comm, my_value, op)
expected_result = generator(0);
... |
from airflow.hooks.mysql_hook import MySqlHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_con... |
from collections import OrderedDict
import pprint
'''Basic change making program using 100 base (American Currency): will create full knapsack version in
later example. This example will also be expanded, in steps, until it becomes a simple OO-based
(ie. we'll add classes) POS system with database tie-in.'''
d... |
"""Unit tests for the :data:`iris.analysis.RMS` aggregator."""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
# Import iris.tests first so that some things can be initialised before
# importing anything else.
import iris.tests as tests... |
# -*- coding: utf-8 -*-
"""
Use optimal adaptation code to adapt show possible adpatations to the Number grammar.
"""
import pickle
import LOTlib
from LOTlib.Examples.Number.Model import *
from LOTlib.Miscellaneous import Infinity
from LOTlib.sandbox.OptimalGrammarAdaptation import print_subtree_adaptations
## WHAT ... |
# -*- coding:utf-8 -*-
"""
/***************************************************************************
Plugin Installer module
unzip function
-------------------
Date : May 2013
Copyright : (C) 2013 ... |
"""MobSF rpc_client for static windows app analysis."""
# pylint: disable=C0325,W0603,C0103
import os
from os.path import expanduser
import re
import subprocess
import configparser # pylint: disable-msg=E0401
import hashlib
import random
import string
import base64
from xmlrpc.server import SimpleXMLRPCServer # pylint... |
# Python Regex module to find Call ID in SIP Trace
#function will search first for SIP event "INVITE sip:" and Start Loggin Information
#Logging will be continued till string "Content-Length:" which indicates end of SIP Message
#A sub-function will search for sting "CallID:" and print that entire line
import re
... |
from setuptools import setup, find_packages
install_requirements = ['pytz', 'tzlocal']
version = '2.3.0'
try:
import importlib
except ImportError:
install_requirements.append('importlib')
setup(
name='tasklib',
version=version,
description='Python Task Warrior library',
long_description=open... |
from tests.save_restore_cursor import SaveRestoreCursorTests
import esccmd
from escutil import knownBug
class DECSETTiteInhibitTests(SaveRestoreCursorTests):
def __init__(self):
SaveRestoreCursorTests.__init__(self)
def saveCursor(self):
esccmd.DECSET(esccmd.SaveRestoreCursor)
def restoreCursor(self):
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible.compat.tests import BUILTINS, unittest
from ansible.compat.tests.mock import mock_open, patch, MagicMock
from ansible.plugins.loader import MODULE_CACHE, PATH_CACHE, PLUGIN_PATH_CACHE, PluginLoader
class T... |
"""Tests for rnn module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import numpy as np
from tensorflow.contrib.rnn.python.ops import core_rnn_cell_impl
from tensorflow.contrib.rnn.python.ops import rnn
from tensorflow.python.frame... |
"""
raven.contrib.pylons
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.middleware import Sentry as Middleware
from raven.base import Client
def list_from_setting(conf... |
import copy
import inspect
from docutils.parsers import rst
from rally.cli import cliutils
from rally.cli import main
from rally.cli import manage
from utils import (category, subcategory, hint, make_definition, note,
paragraph, parse_text, warning)
class Parser(object):
"""A simplified inter... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: ucs_vhba_template
short_description: Configures vHBA templat... |
import os
try:
import pymysql as mysql_driver
_mysql_cursor_param = 'cursor'
except ImportError:
try:
import MySQLdb as mysql_driver
import MySQLdb.cursors
_mysql_cursor_param = 'cursorclass'
except ImportError:
mysql_driver = None
from ansible.module_utils._text import... |
# bg is always black.
# effect is white
# func decl: red bold
# class decl: blue bold
# predefined decl: green bold
# predefined usage: yellow bold
<info descr="PY.BUILTIN_NAME" type="INFORMATION" foreground="0x00ff00" background="0x000000" effectcolor="0xffffff" effecttype="BOXED" fonttype="1">len</info>("")
len = []... |
# v.0.3.0
import ntpath, xbmcvfs
def checkDir( path ):
log_lines = []
log_lines.append( 'checking for directory ' + path )
if not xbmcvfs.exists( path ):
log_lines.append( 'directory does not exist, creating it' )
xbmcvfs.mkdirs( path )
return False, log_lines
else:
lo... |
from .pls_ import _PLS
__all__ = ['CCA']
class CCA(_PLS):
"""CCA Canonical Correlation Analysis.
CCA inherits from PLS with mode="B" and deflation_mode="canonical".
Read more in the :ref:`User Guide <cross_decomposition>`.
Parameters
----------
n_components : int, (default 2).
numb... |
"""Determination of parameter bounds"""
# License: BSD 3 clause
from warnings import warn
import numpy as np
from ..preprocessing import LabelBinarizer
from ..utils.validation import check_consistent_length, check_array
from ..utils.extmath import safe_sparse_dot
def l1_min_c(X, y, loss='squared_hinge', fit_interc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.