content stringlengths 4 20k |
|---|
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.aws.core import AnsibleAWSModule
from ansible.module_utils.ec2 import camel_dict_to_snake_dict, boto3_tag_list_to_ansible_dict, compare_aws_tags
from ansi... |
#!/usr/bin/python
# -*- coding: utf-8 -*
import itk
import logging
# http://sphinx-doc.org/domains.html#the-python-domain
# Dictionary below copied from (Sun Apr 7 14:04:28 CEST 2013)
# http://code.google.com/p/medipy/source/browse/lib/medipy/itk/types.py?name=default&r=0da35e1099e5947151dee239f7a09f405f4e105c
io_c... |
from __future__ import unicode_literals
from importlib import import_module
from django.core.exceptions import ViewDoesNotExist
from django.utils import lru_cache, six
from django.utils.module_loading import module_has_submodule
@lru_cache.lru_cache(maxsize=None)
def get_callable(lookup_view):
"""
Return a ... |
"""
higwidgets/higframe.py
hig frame
"""
__all__ = ['HIGFrame']
import gtk
class HIGFrame(gtk.Frame):
"""
Frame without border with bold label.
"""
def __init__(self, label=None):
gtk.Frame.__init__(self)
self.set_shadow_type(gtk.SHADOW_NONE)
self._flabel = gtk.L... |
import json
import uuid
from django.test import TestCase
from rest_framework.test import APITestCase
from rest_framework.test import APIClient
from rest_framework import status
from django.urls import reverse
from guardian.shortcuts import assign_perm
from studies.models import Response, Study, Feedback
from accounts.... |
# Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import select
import shlex
import subprocess
import sys
from ansible.module_utils.six import PY2, PY3
from ansible.module_utils._text import to_bytes
def run_cmd(cmd, live=False, readsize=10):
# readsize = 10
... |
"""
This example shows a brute-force way of specifying connections
between NEST Topology layers using Connection Set Algebra.
We are working on better ways to do this.
"""
import nest
import nest.topology as topo
import matplotlib.pyplot as plt
try:
import csa
haveCSA = True
except ImportError:
haveCSA =... |
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr, flt
from frappe import msgprint, _
from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.buying_controller import BuyingController
from erpnext.stock.doctype.item.item import get_last_purchase_details
from... |
import codecs
import datetime
import os
import sys
from twisted.python import log
class EncodeReplacerPipe(object):
def __init__(self, inner_file):
self.inner_file = inner_file
self.softspace = 0
def write(self, data):
if isinstance(data, unicode):
try:
data... |
from __future__ import unicode_literals
import frappe, os, json
from frappe import _
from frappe.utils import get_timestamp
from frappe.utils import cint, today, formatdate
import frappe.defaults
from frappe.cache_manager import clear_defaults_cache
from frappe.model.document import Document
from frappe.contacts.addr... |
"""Test class :class:`iris._concatenate._CubeSignature`."""
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
f... |
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr
from frappe import throw, _
from frappe.utils.nestedset import NestedSet, get_ancestors_of, get_descendants_of
class RootNotEditable(frappe.ValidationError): pass
class BalanceMismatchError(frappe.ValidationError): pass
class Ac... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test the ability to configure the $RCCOM construction variable
when using MinGW.
"""
import sys
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
if sys.platform in ('irix6',):
test.skip_test("Skipping mingw test on non... |
import time
import socket
import logging
import struct
import errno
import random
import encrypt
import eventloop
import lru_cache
from common import parse_header, pack_addr
BUF_SIZE = 65536
def client_key(a, b, c, d):
return '%s:%s:%s:%s' % (a, b, c, d)
class UDPRelay(object):
def __init__(self, config, ... |
import networkx as nx
#from networkx.generators.smax import li_smax_graph
def s_metric(G, normalized=True):
"""Return the s-metric of graph.
The s-metric is defined as the sum of the products deg(u)*deg(v)
for every edge (u,v) in G. If norm is provided construct the
s-max graph and compute it's s_metr... |
import os
from spack import *
TUNE_VARIANTS = (
'none',
'cp2k-lmax-4',
'cp2k-lmax-5',
'cp2k-lmax-6',
'cp2k-lmax-7',
'molgw-lmax-4',
'molgw-lmax-5',
'molgw-lmax-6',
'molgw-lmax-7',
)
class Libint(AutotoolsPackage):
"""Libint is a high-performance library for computing
Gaus... |
from vodka.app import get_application
instances = {}
def get_instance(name):
"""
wrapper function to retrieve instance
Args:
name (str): instance name - identical to appliction class handle value
Returns:
application instance with the matching name
Raises:
KeyError: No ... |
#!/usr/bin/env python
'''
Linode external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
Linode using the Chube library.
NOTE: This script assumes Ansible is being executed where Chube is already
installed and has a valid config at ~/.chube... |
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.tools.translate import _
from openerp.addons.website.controllers.main import Website as controllers
controllers = controllers()
from datetime import datetime, timedelta
from dateutil.relatived... |
"""The `interface.db_config` test checks that the special `rethinkdb.db_config` table behaves as expected."""
from __future__ import print_function
import os, sys, time
startTime = time.time()
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, scenario... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
int_or_none,
ExtractorError,
)
class VubeIE(InfoExtractor):
IE_NAME = 'vube'
IE_DESC = 'Vube.com'
_VALID_URL = r'http://vube\.com/(?:[^/]+/)+(?P<id>[... |
from PyQt5.QtWidgets import QFrame, QSizePolicy
from PyQt5.QtCore import pyqtSignal
from .navigation_uic import Ui_Navigation
from sakia.models.generic_tree import GenericTreeModel
class NavigationView(QFrame, Ui_Navigation):
"""
The view of navigation panel
"""
current_view_changed = pyqtSignal(dict)... |
from openerp.osv import osv
class confirm_statement_line(osv.osv_memory):
_name = 'confirm.statement.line'
_description = 'Confirm selected statement lines'
def confirm_lines(self, cr, uid, ids, context):
line_ids = context['active_ids']
line_obj = self.pool.get('account.bank.statement.lin... |
# coding: utf-8
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from django.db.models import Q
def display_users(users_list):
print "-" * 80
print "| pk | username | first_name | last_name | email |"
for user in users_list:
print "| %s | %s | %s | %s ... |
#!/usr/bin/env python
from __future__ import print_function
import os
import gtk
import sys
import argparse
def responseToDialog(entry, dialog, response):
dialog.response(response)
def getText(authHost, authRealm):
dialog = gtk.MessageDialog(
None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WIT... |
import datetime
# nova.image.glance._translate_from_glance() returns datetime
# objects, not strings.
NOW_DATE = datetime.datetime(2010, 10, 11, 10, 30, 22)
def get_image_fixtures():
"""Returns a set of image fixture dicts for use in unit tests.
Returns a set of dicts representing images/snapshots of varyin... |
import gtk
import gobject
import gettext
import tryton.common as common
import csv
from tryton.config import TRYTON_ICON, CONFIG
from tryton.common import RPCExecute, RPCException
from tryton.gui.window.nomodal import NoModal
_ = gettext.gettext
class WinImport(NoModal):
"Window import"
def __init__(self, m... |
"""Gradient functions for optional ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.ops import gen_dataset_ops
@ops.RegisterGradient("OptionalFromValue")
def _OptionalFromValueGrad(... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('course_o... |
"""This example gets all custom fields that apply to line items.
To create custom fields, run create_custom_fields.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authen... |
import unittest
from pyspark.ml.pipeline import Pipeline
from pyspark.testing.mlutils import MockDataset, MockEstimator, MockTransformer, PySparkTestCase
class PipelineTests(PySparkTestCase):
def test_pipeline(self):
dataset = MockDataset()
estimator0 = MockEstimator()
transformer1 = Moc... |
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import Twitter
from pattern.graph import Graph
# This example demonstrates a simple Twitter miner + visualizer.
# We collect tweets containing "A is the new B",
# mine A and B and use them as connected nodes in a... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from collections import MutableMapping
from ansible import constants as C
from ansible.plugins import cache_loader
try:
from __main__ import display
except ImportError:
from ansible.utils.display import Display
displa... |
#!/usr/bin/env python
import StringIO
import unittest
from csvkit import CSVKitReader
from csvkit.utilities.csvstack import CSVStack
class TestCSVStack(unittest.TestCase):
def test_explicit_grouping(self):
# stack two CSV files
args = ['--groups', 'asd,sdf', '-n', 'foo', 'examples/dummy.csv', 'ex... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.contrib.auth.models import Group
from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import UNKNOWN_SOURCE
from django.test import SimpleTestCase, override_settings
from django.urls import NoR... |
import pytest
from awx.api.versioning import reverse
from awx.main.models.mixins import WebhookTemplateMixin
from awx.main.models.credential import Credential, CredentialType
@pytest.mark.django_db
@pytest.mark.parametrize(
"user_role, expect", [
('superuser', 200),
('org admin', 200),
('... |
from .utils import DslBase, BoolMixin, _make_dsl_class
from .function import SF, ScoreFunction
def Q(name_or_query, **params):
# {"match": {"title": "python"}}
if isinstance(name_or_query, dict):
if params:
raise ValueError('Q() cannot accept parameters when passing in a dict.')
if ... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.cloudstack import (
AnsibleCloudStack,
cs_argument_spec,
cs_required_together,
... |
"""Compute scores from locally downloaded data.
Compare local numbers with online numbers.
"""
# Each level
# Each test_set
import bisect
import datetime
import getopt
import logging
import MySQLdb
import os
import re
import sys
sys.path.append('/usr/local/google/google_appengine')
sys.path.append(os.path.dirname(o... |
from flask_restful import Resource, Api, fields, marshal_with
from fllipit import APP
from models import DB, Team
import pypyodbc
API = Api(APP)
# Get teams from the database
def getTeams():
teams = []
if APP.config['TEST_DB']:
# In test mode, use the sqlite database
teams = Team.query.all()
... |
import nose
import os
import sys
import angr
import subprocess
import logging
l = logging.getLogger('angr.tests.test_ctype_locale')
test_location = os.path.dirname(os.path.abspath(__file__))
def test_ctype_b_loc():
'''
test_ctype_locale.test_ctype_b_loc
const unsigned short * * __ctype_b_loc (void);
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
from ansible.module_utils.common._collections_compat import Mapping
class LookupModule(LookupBase):
def run(self, terms, variables=None, *... |
import json
import pystache
import time
import logging
from funcy import project
from flask import render_template, request
from flask_login import login_required, current_user
from flask_restful import abort
from redash import models, settings, utils
from redash import serializers
from redash.utils import json_dumps... |
"""A medical image analysis pipeline.
The pipeline is used for brain tissue segmentation using a decision forest classifier.
"""
import argparse
import datetime
import os
import sys
import timeit
import SimpleITK as sitk
import numpy as np
from tensorflow.python.platform import app
sys.path.insert(0, os.path.join(o... |
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
class PostGISSchemaEditor(DatabaseSchemaEditor):
geom_index_type = 'GIST'
geom_index_ops = 'GIST_GEOMETRY_OPS'
geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND'
sql_add_geometry_column = "SELECT AddGeometryColumn(%(table)s, %(col... |
"""
Support for asynchronously authenticating using PAM.
"""
import PAM
import getpass, threading, os
from twisted.internet import threads, defer
def pamAuthenticateThread(service, user, conv):
def _conv(items):
from twisted.internet import reactor
try:
d = conv(items)
excep... |
from .qt import QtCore, QtGui
class Progress(QtCore.QObject):
"""
Display a progress dialog when something is running
"""
add_query_signal = QtCore.Signal(str, str)
remove_query_signal = QtCore.Signal(str)
def __init__(self, parent, min_duration=1000):
super().__init__()
se... |
"""
Greenlets-based Bitcoin network crawler.
"""
from gevent import monkey
monkey.patch_all()
import geoip2.database
import gevent
import json
import logging
import os
import random
import redis
import redis.connection
import requests
import socket
import sys
import time
from binascii import hexlify, unhexlify
from c... |
'''
GUI Program to use DC Motor as Pickup device
ExpEYES program developed as a part of GSoC-2015 project
Project Tilte: Sensor Plug-ins, Add-on devices and GUI Improvements for ExpEYES
Mentor Organization:FOSSASIA
Mentors: Hong Phuc, Mario Behling, Rebentisch
Author: Praveen Patil
License : GNU GPL version 3
'''
# Co... |
import sys
import xbmc
import xbmcplugin
from xbmcaddon import Addon
from moviesets import getFullMovieSetsDetails
# constants
ADDON = Addon( "plugin.moviesets" )
ADDON_NAME = ADDON.getAddonInfo( "name" )
Language = ADDON.getLocalizedString # ADDON strings
LangXBMC = xbmc.getLocalizedString # XBMC strings
cl... |
"""Defines the task controller library."""
import argparse
import datetime
import logging
import os
import socket
import subprocess
import sys
import tempfile
import threading
from legion.lib import common_lib
from legion.lib import process
from legion.lib.rpc import rpc_server
from legion.lib.rpc import jsonrpclib
... |
import re
from django.utils.text import compress_sequence, compress_string
from django.utils.cache import patch_vary_headers
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compression.
It sets the Vary header acco... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd/m/Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'd/m/Y P'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j F'
SHORT_DATE_FORMAT = 'd/m/Y'
SH... |
import imp
import os
import threading
from ycmd.utils import ForceSemanticCompletion
from ycmd.completers.general.general_completer_store import (
GeneralCompleterStore )
from ycmd.completers.completer_utils import PathToFiletypeCompleterPluginLoader
class ServerState( object ):
def __init__( self, user_options... |
from __future__ import absolute_import, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
from indra.databases.lincs_client import get_drug_target_data, LincsClient
lc = LincsClient()
@attr('webservice')
@unittest.skip('LINCS web service very unreliable.')
def test_get_drug_targ... |
"""Module for parsing and testing package version predicate strings.
"""
import re
import distutils.version
import operator
re_validPackage = re.compile(r"(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)",
re.ASCII)
# (package) (rest)
re_paren = re.compile(r"^\s*\((.*)\)\s*$") # (list) inside of parentheses
re_splitCompa... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network.comm... |
"""Operators that fallback to official NumPy implementation."""
import sys
from functools import wraps
import numpy as onp
fallbacks = [
'__version__',
'_NoValue',
'allclose',
'alltrue',
'apply_along_axis',
'apply_over_axes',
'argpartition',
'argwhere',
'array_equal',
'array_eq... |
"""
Logging utilities, primiarily short aliases for logging a message at various
runlevels.
::
trace - logs a message at the TRACE runlevel
debug - logs a message at the DEBUG runlevel
info - logs a message at the INFO runlevel
notice - logs a message at the NOTICE runlevel
warn - logs a message at the WARN... |
"""
Performance test for asset metadata in the modulestore.
"""
from path import Path as path
import unittest
from tempfile import mkdtemp
import itertools
from shutil import rmtree
from bson.code import Code
import datetime
import ddt
#from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
from x... |
import sys
sys.path.append("${CMAKE_BINARY_DIR}")
import os
import pickle
import tempfile
import unittest
import math
import pyrfr.regression as reg
class TestBinaryRssRegressionForest(unittest.TestCase):
def setUp(self):
data_set_prefix = '${CMAKE_SOURCE_DIR}/test_data_sets/'
self.data = reg.default_data_con... |
from Plugins.Plugin import PluginDescriptor
from Components.Harddisk import harddiskmanager
from twisted.internet.protocol import Protocol, Factory
hotplugNotifier = []
def processHotplugData(self, v):
print "hotplug:", v
action = v.get("ACTION")
device = v.get("DEVPATH")
physdevpath = v.get("PHYSDEVPATH")
media... |
from . placebo_fixtures import placeboify, maybe_sleep
from ansible.modules.cloud.amazon import aws_direct_connect_connection
from ansible.module_utils.ec2 import get_aws_connection_info, boto3_conn
class FakeModule(object):
def __init__(self, **kwargs):
self.params = kwargs
def fail_json(self, *args... |
"""Command for removing a host rule from a URL map."""
import copy
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.compute.lib import base_classes
class RemoveHostRule(base_classes.ReadWriteCommand):
"""Remove a host rule from a URL map."""
@staticmethod
def Args(parser):
parser.add_arg... |
#!/usr/bin/python
# based on https://github.com/pdbrown/munin-custom/blob/master/plugins/hashrate
import urllib2
import json
YOUR_SLUSH_API_KEY = ""
SLUSH_STATS = 'https://mining.bitcoin.cz/accounts/profile/json/%s' % YOUR_SLUSH_API_KEY
mining_stats_raw = urllib2.urlopen(SLUSH_STATS)
mining_stats = json.load(mining_... |
# -*- coding: utf-8 -*-
from tools.location import Location
from notification.notification import Notification
from database.mysql_request import mysql_drop, mysql_check_exist
DB_NAME = "notifications"
class NotificationsMysql:
# MySQL request
_drop = (mysql_drop.format(DB_NAME))
_create = ("CREATE TAB... |
"""
This tool extracts sentences to be translated from HTML / WML source
files.
The sentences to translate are marked with the following tag:
Blah blah _(To be translated)_ blah.
These tags can span several lines. Extra whitespace is discarded.
"""
import sys, re, os
_tag_re = re.compile(r'_\((.*?)\)_', re.M)
_nl... |
""" Freeing up space for new observations by deleting old files. """
import ctypes
import os
import platform
import sys
import shutil
import datetime
import ephem
from RMS.CaptureDuration import captureDuration
def availableSpace(dirname):
"""
Returns the number of free bytes on the drive that p is on.
... |
{
'name': 'Mercury Payment Services',
'version': '1.0',
'category': 'Point of Sale',
'sequence': 6,
'summary': 'Credit card support for Point Of Sale',
'description': """
Allow credit card POS payments
==============================
This module allows customers to pay for their orders with cred... |
"""Sample to demonstrate using secure AuthSub in the Google Data Python client.
This sample focuses on the Google Health Data API because it requires the use
of secure tokens. This samples makes queries against the H9 Developer's
Sandbox (https://www.google.com/h9). To run this sample:
1.) Use Apache's mod_python
... |
"""Defines TestPackageApk to help run APK-based native tests."""
# pylint: disable=W0212
import logging
import os
import shlex
import sys
import tempfile
import time
from pylib import android_commands
from pylib import constants
from pylib import pexpect
from pylib.device import device_errors
from pylib.device import... |
""" Utilities for working with strings
"""
import logging
logger = logging.getLogger(__name__)
import re
import typing
_TRUE_STRING = {'true', 'yes', 't', 'y', '1'}
def str2bool(s:str) -> bool:
""" Convert `s` to a boolean value, if possible
Parameters
----------
s : string
A string whi... |
import logging
from .enabled import EnabledExtensionManager
LOG = logging.getLogger(__name__)
class DispatchExtensionManager(EnabledExtensionManager):
"""Loads all plugins and filters on execution.
This is useful for long-running processes that need to pass
different inputs to different extensions.
... |
#!/usr/bin/env python
def analyze_match_table(path):
# Extract the instruction table.
data = open(path).read()
start = data.index("static const MatchEntry MatchTable")
end = data.index("\n};\n", start)
lines = data[start:end].split("\n")[1:]
# Parse the instructions.
insns = []
for ln ... |
'''
A simple cache class for downloading URLs to disk, if necessary.
Copyright 2014, Konstantin Tretyakov
Licensed under MIT.
'''
import json
import os
import os.path
import urllib
class HttpException(Exception):
pass
class ErrorAwareURLOpener(urllib.FancyURLopener):
def http_error_default(self, url, fp, errco... |
import io
import re
import textwrap
from typing import Iterable, Optional
from mitmproxy.contentviews import base
from mitmproxy.utils import sliding_window
"""
A custom XML/HTML prettifier. Compared to other prettifiers, its main features are:
- Implemented in pure Python.
- Modifies whitespace only.
- Works with a... |
'''Module providing e-mail generating functionaly for the SMART Direct Apps'''
# Developed by: Nikolai Schwertner
#
# Revision history:
# 2011-10-04 Initial release
# Import smtplib for the actual sending function
import smtplib
# Import various email module components
from email import encoders
from email.header... |
import os
import shutil
import subprocess
from subprocess import Popen
import sys
from tempfile import mkdtemp
import time
import unittest
class AutoreloadTest(unittest.TestCase):
def setUp(self):
self.path = mkdtemp()
def tearDown(self):
try:
shutil.rmtree(self.path)
exce... |
__author__ = '<EMAIL> (Jeff Scudder)'
import unittest
import gdata.blogger.client
import gdata.blogger.data
import gdata.gauth
import gdata.client
import atom.http_core
import atom.mock_http_core
import atom.core
import gdata.data
import gdata.test_config as conf
class BloggerClientTest(unittest.TestCase):
def s... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible import constants as C
from ansible.errors import AnsibleError
from ansible.utils.vars import combine_vars
from ansible.module_utils._text import to_native
#FIXME: make into plugins
from ansible.inventory.in... |
"""
QA fetch module
@yutiansut
QAFetch is Under [QAStandard#0.0.2@10x] Protocol
"""
from QUANTAXIS.QAFetch import QAWind as QAWind
from QUANTAXIS.QAFetch import QATushare as QATushare
from QUANTAXIS.QAFetch import QATdx as QATdx
from QUANTAXIS.QAFetch import QAThs as QAThs
def use(package):
if package in ['wi... |
from .main import uTorrent
def start():
return uTorrent()
config = [{
'name': 'utorrent',
'groups': [
{
'tab': 'downloaders',
'name': 'utorrent',
'label': 'uTorrent',
'description': 'Use <a href="http://www.utorrent.com/" target="_blank">uTorrent</a>... |
"""
"""
from shfi_otf_pipeline import make_apex_cubes
from sdpy import plait
import FITS_tools
import os
from astropy.io import fits
from astropy import log
outdir = '/Users/adam/work/h2co/apex/april2014/'
def reduce_all_cubes_for_map(mapname, lowhigh='high', **kwargs):
for dataset,maps in make_apex_cubes.dataset... |
# Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import sys
import stat
import genericpath
import warnings
from genericpath import *
from gene... |
"""jid -- XMPP address handling
Normative reference:
- `RFC 6122 <http://xmpp.org/rfcs/rfc6122.html>`__
"""
__docformat__ = "restructuredtext en"
import weakref
import warnings
import socket
from encodings import idna
from .xmppstringprep import NODEPREP, RESOURCEPREP
from .exceptions import JIDError
def are_... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import it... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
def query_log_status(module, le_path, path, state="present"):
""" Returns whether a log is followed or not. """
if state == "present":
rc, out, err = module.run_c... |
from openerp.osv import orm, fields
from openerp.tools.translate import _
from openerp.addons.base.ir.ir_model import MODULE_UNINSTALL_FLAG
class IrModel(orm.Model):
_inherit = 'ir.model'
def _drop_table(self, cr, uid, ids, context=None):
# Allow to skip this step during model unlink
# The su... |
from enigma import eCableScan, eDVBFrontendParametersCable, eTimer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.NimManager import nimmanager
from Comp... |
{
'name': '中国会计科目表',
'version': '1.8',
'category': 'Localization/Account Charts',
'author': 'www.openerp-china.org',
'maintainer':'<EMAIL>',
'website':'http://openerp-china.org',
'description': """
科目类型\会计科目表模板\增值税\辅助核算类别\管理会计凭证簿\财务会计凭证簿
添加中文省份数据
增加小企业会计科目表
""",
'... |
# -*- coding: utf-8 -*-
""" View for custom navigation of ps.plone.hostingctl """
# plone imports
from Products.CMFPlone.browser.navigation import PhysicalNavigationBreadcrumbs
# local imports
from ps.plone.hostingctl.i18n import _
class HostingCtlBreadcrumbs(PhysicalNavigationBreadcrumbs):
"""
View th... |
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... |
def _get_quote_state(token, quote_char):
'''
the goal of this block is to determine if the quoted string
is unterminated in which case it needs to be put back together
'''
# the char before the current one, used to see if
# the current character is escaped
prev_char = None
for idx, cur_c... |
"""MovieInWindow converted to python
Jack Jansen, CWI, December 1995
"""
from Carbon import Qt
from Carbon import QuickTime
from Carbon import Qd
from Carbon import QuickDraw
from Carbon import Evt
from Carbon import Events
from Carbon import Win
from Carbon import Windows
from Carbon import File
import EasyDialogs
i... |
from __future__ import print_function
import sys
from functools import reduce
from pyspark.sql import SparkSession
"""
Read data file users.avro in local Spark distro:
$ cd $SPARK_HOME
$ ./bin/spark-submit --driver-class-path /path/to/example/jar \
> ./examples/src/main/python/avro_inputformat.py \
> examples/src/m... |
import json
import os
from os.path import join as pjoin
import unittest
from IPython.testing.decorators import onlyif
from IPython.utils.tempdir import TemporaryDirectory
from IPython.kernel import kernelspec
sample_kernel_json = {'argv': ['cat', '{connection_file}'],
'display_name': 'Test kerne... |
"""
XX. Model inheritance
Model inheritance exists in two varieties:
- abstract base classes which are a way of specifying common
information inherited by the subclasses. They don't exist as a separate
model.
- non-abstract base classes (the default), which are models in their own
right with ... |
'''Demonstrates a useful pattern for pyglet applications: subclassing Window.
'''
import pyglet
class HelloWorldWindow(pyglet.window.Window):
def __init__(self):
super(HelloWorldWindow, self).__init__()
self.label = pyglet.text.Label('Hello, world!')
def on_draw(self):
self.clear()
... |
import copy
import logging
import openerp.netsvc as netsvc
from openerp.tools.misc import UpdateableStr, UpdateableDict
from openerp.tools.translate import translate
from lxml import etree
import openerp.pooler as pooler
from openerp.osv.osv import except_osv
from openerp.osv.orm import except_orm
import sys
_logge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.