content string |
|---|
"""Support for Minut Point binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import MinutPointEntity
from .const import DOMAIN as POINT_DOM... |
from openerp.osv import fields, osv
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'property_delivery_carrier': fields.property(
type='many2one',
relation='delivery.carrier',
string="Delivery Method",
help="This delivery method will be used whe... |
import string
import httplib
import sys
import myparser
import re
# http://www.jigsaw.com/SearchAcrossCompanies.xhtml?opCode=refresh&rpage=4&mode=0&cnCountry=&order=0&orderby=0&cmName=accuvant&cnDead=false&cnExOwned=false&count=0&screenNameType=0&screenName=&omitScreenNameType=0&omitScreenName=&companyI... |
import os
ROOT_PATH = os.path.dirname(__file__)
TEMPLATE_DEBUG = DEBUG = True
MANAGERS = ADMINS = ()
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = os.path.join(ROOT_PATH, 'testdb.sqlite')
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
ADMIN_MEDIA_PREFIX ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from units.compat.mock import patch
from ansible.modules.network.cnos import cnos_vlan
from ansible.modules.network.cnos.cnos_vlan import parse_vlan_brief
from units.modules.utils import set_module_args
from .cnos_modu... |
# -*- coding: utf-8 -*-
"""Helpers to fill and submit forms."""
import re
from bs4 import BeautifulSoup
from webtest.compat import OrderedDict
from webtest import utils
class NoValue(object):
pass
class Upload(object):
"""
A file to upload::
>>> Upload('filename.txt', 'data', 'application/oct... |
import pytest
import rpm_version
expected_pkgs = {
"spam": {
"name": "spam",
"version": "3.2.1",
},
"eggs": {
"name": "eggs",
"version": "3.2.1",
},
}
@pytest.mark.parametrize('pkgs, expect_not_found', [
(
{},
["spam", "eggs"], # none found
),
... |
"""
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = models.IntegerF... |
"""Forms for accounts app."""
# pylint: disable=no-init,no-self-use
from django import forms
from django.contrib.admin import widgets
from django.contrib.auth.models import Group as AuthGroup
from django.contrib.auth.models import Permission
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from d... |
# -*- coding: utf-8 -*-
'''
Specto 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 l... |
"""Get a clinical report, either with extended information or not.
Example usages:
python get_clinical_report.py 1801
python get_clinical_report.py 1801 --e true
"""
import os
import requests
from requests.auth import HTTPBasicAuth
import sys
import simplejson as json
import argparse
# Load environment variables fo... |
__author__ = 'root' |
DEBUG_PRINT_LEVEL_ALWAYS = 0
DEBUG_PRINT_LEVEL_ERROR = 1
DEBUG_PRINT_LEVEL_WARNING = 2
DEBUG_PRINT_LEVEL_INFO = 3
DEBUG_PRINT_LEVEL_VERBOSE = 4
debug_print_level = DEBUG_PRINT_LEVEL_ALWAYS
# Debug level for symbols
DEBUG_SYMBOL_LEVEL_NONE = 0
DEBUG_SYMBOL_LEVEL_LINES = 1
DEBUG_SYMBOL_LEVEL_VARIABLES =... |
"""
Module related to processing bgp paths.
"""
import logging
from ryu.services.protocols.bgp.base import Activity
from ryu.services.protocols.bgp.base import add_bgp_error_metadata
from ryu.services.protocols.bgp.base import BGP_PROCESSOR_ERROR_CODE
from ryu.services.protocols.bgp.base import BGPSException
from ry... |
from waterbutler.core import metadata
class BaseOwnCloudMetadata(metadata.BaseMetadata):
def __init__(self, href, folder, attributes=None):
super(BaseOwnCloudMetadata, self).__init__(None)
self.attributes = attributes or {}
self._folder = folder
self._href = href
@property
... |
from django.contrib.gis.gdal.error import OGRException
#### OGRGeomType ####
class OGRGeomType(object):
"Encapulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0 : 'Unknown',
1 : 'Point',
2 ... |
# -*- coding: utf-8 -*-
import csv
import datetime
import itertools
import numpy as np
import numpy.ma as ma
import scipy.optimize
from pytmatrix.psd import GammaPSD
from ..DropSizeDistribution import DropSizeDistribution
from ..io import common
def read_2ds(filename, campaign="acapex"):
"""Read a airborne 2DS... |
import BoostBuild
import os
import string
t = BoostBuild.Tester(use_test_config=False)
# To start with, we have to prepare a library to link with.
t.write("lib/jamroot.jam", "")
t.write("lib/jamfile.jam", "lib test_lib : test_lib.cpp ;")
t.write("lib/test_lib.cpp", """\
#ifdef _WIN32
__declspec(dllexport... |
"""Dump functions called by static intializers in a Linux Release binary.
Usage example:
tools/linux/dump-static-intializers.py out/Release/chrome
A brief overview of static initialization:
1) the compiler writes out, per object file, a function that contains
the static intializers for that file.
2) the compiler... |
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
import re
from openerp.addons.website.models.website import slug
class event(osv.osv):
_name = 'event.event'
_inherit = ['event.event','website.seo.metadata']
def _get_new_menu_pages(self, cr, uid... |
from __future__ import unicode_literals
from datetime import timedelta
from optparse import make_option
from time import timezone
try:
from urllib.request import urlopen
from urllib.parse import urljoin
except ImportError:
from urllib import urlopen
from urlparse import urljoin
from django.core.manage... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleError
from ansible.module_utils.gcp_utils import GcpSession
class GcpMockModule(object):
def __init__(self, params):
self.params = params
def fail_json(self, *args, **kwargs):
... |
"""
This file contains signal handlers for credentials-related functionality.
"""
from __future__ import absolute_import
from logging import getLogger
from django.contrib.sites.models import Site
from course_modes.models import CourseMode
from lms.djangoapps.certificates.models import CertificateStatuses, GeneratedC... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Ftrace built-in backend.
"""
__author__ = "Eiichi Tsukata <<EMAIL>>"
__copyright__ = "Copyright (C) 2013 Hitachi, Ltd."
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__email__ = "<EMAIL>"
from tr... |
# -*- coding: utf-8 -*-
#
# Django documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 27 09:06:53 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't picklabl... |
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
qualities,
unescapeHTML,
)
class GiantBombIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?giantbomb\.com/videos/(?P<display_id>[^/]+)/(?P<id>\d+-... |
"""Generate the html documentation based on the asciidoc files."""
import re
import os
import os.path
import sys
import subprocess
import glob
import shutil
import tempfile
import argparse
import io
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
from scripts import utils
class AsciiDoc:
... |
from __future__ import unicode_literals
from textx.metamodel import metamodel_from_str
call_counter = 0
grammar1 = """
foo:
'foo' m_formula = Formula
;
Formula:
( values=FormulaExpression values='+' ( values=FormulaExpression)* )
;
FormulaExpression:
values=bar
;
bar:
m_id=/[a-f0-9]+/
;
"""
grammar... |
r"""Saves out a .wav file with synthesized conversational data and labels.
The best way to estimate the real-world performance of an audio recognition
model is by running it against a continuous stream of data, the way that it
would be used in an application. Training evaluations are only run against
discrete individu... |
import random
import cmath
from gnuradio import gr, gr_unittest, digital, blocks
class test_clock_recovery_mm(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test01(self):
# Test complex/complex version
omega = 2
... |
from spack import *
class Easybuild(PythonPackage):
"""EasyBuild is a software build and installation framework
for (scientific) software on HPC systems.
"""
homepage = 'http://hpcugent.github.io/easybuild/'
url = 'https://pypi.io/packages/source/e/easybuild/easybuild-3.1.2.tar.gz'
vers... |
import json
import jenkins
import sys
from optparse import OptionParser
from six.moves.urllib.request import Request
JENKINS_IP = 'http://52.7.139.177/'
GEONODE_DEMO_DOMAIN = 'demo.geonode.org' # should match the jenkins configuration
NODE_LIST = 'computer/api/json' # jenkins api backend
GEONODE_DEMO_JOB = 'geonode-a... |
"""Test system log component."""
import logging
from unittest.mock import MagicMock, patch
from homeassistant.core import callback
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import system_log
_LOGGER = logging.getLogger('test_logger')
BASIC_CONFIG = {
'system_log': {
... |
import sys
sys.path.append("/usr/share/rhn/")
from up2date_client import hardware
from up2date_client import up2dateAuth
from up2date_client import rpcServer
argVerbose = 0
__rhnexport__ = [
'refresh_list' ]
# resync hardware information with the server profile
def refresh_list(cache_only=None):
if cache_only... |
"""
Various edge-cases for model managers.
"""
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
class OnlyFred(mo... |
import re
import json
import traceback
from couchpotato.core.helpers.variable import tryInt, getIdentifier
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class Base(TorrentProvider):
urls = {
'test': 'http... |
from ..interface import (ContractSyntaxError, describe_value,
ContractNotRespected)
from ..main import parse_contract_string, check_contracts
def check_contracts_ok(contract, value):
if isinstance(contract, str):
contract = [contract]
value = [value]
context = check_co... |
import pytest
from tests.support.asserts import assert_error, assert_success
from tests.support.inline import inline
def element_click(session, element):
return session.transport.send(
"POST", "session/{session_id}/element/{element_id}/click".format(
session_id=session.session_id,
... |
import subprocess
import os
import sys
from openerp import report
import tempfile
import time
import logging
from mako.template import Template
from mako.lookup import TemplateLookup
from mako import exceptions
from openerp import netsvc
from openerp import pooler
from report_helper import WebKitHelper
from openerp.r... |
#!/usr/bin/env python
from webapp.model import Song, Songbook, hub
try: # try c version for speed then fall back to python
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
import xml.parsers.expat
import webapp.c_utilities as c
from posixpath import *
import turbogears
impo... |
"""Platform for the opengarage.io cover component."""
import logging
import requests
import voluptuous as vol
from homeassistant.components.cover import (
CoverDevice,
DEVICE_CLASS_GARAGE,
PLATFORM_SCHEMA,
SUPPORT_OPEN,
SUPPORT_CLOSE,
)
from homeassistant.const import (
CONF_NAME,
STATE_CL... |
"""
Add receivers for django signals, and feed data into the monitoring system.
If a model has a class attribute 'METRIC_TAGS' that is a list of strings,
those fields will be retrieved from the model instance, and added as tags to
the recorded metrics.
"""
from django.db.models.signals import post_save, post_delete,... |
#!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests segment-break-transformation-rules-001 ~ 049 which
cover all possible combinations of characters at two sides of segment breaks.
More specifically, there are seven types of characters involve in these rules:
1. East Asian Full-width (F)... |
import unittest
import sys
import os
import logging
sys.dont_write_bytecode = True
sys.path.insert(0, os.path.abspath(".."))
#sys.path.insert(0, os.path.abspath(os.path.join("..", "coshsh")))
import coshsh
from coshsh.generator import Generator
#from datasource import Datasource
from coshsh.host import Host
from cosh... |
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
from co... |
import unittest
from autothreadharness.harness_case import HarnessCase
class Leader_5_6_6(HarnessCase):
role = HarnessCase.ROLE_LEADER
case = '5 6 6'
golden_devices_required = 3
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main() |
#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
import time
from Queue imp... |
from __future__ import absolute_import
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.models import SavedSearch
cl... |
from collections import defaultdict
from django.template.base import (
Library, Node, Template, TemplateSyntaxError, TextNode, Variable,
token_kwargs,
)
from django.utils import six
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
class ExtendsError(Exc... |
import random
from six import moves
from tempest_lib.common.utils import data_utils
from tempest_lib import decorators
from tempest.api.image import base
from tempest import test
class BasicOperationsImagesTest(base.BaseV2ImageTest):
"""
Here we test the basic operations of images
"""
@decorators.ski... |
"""
Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=31412
"""
import dbus
from servicetest import call_async, EventPattern, sync_dbus
from gabbletest import (exec_test, make_result_iq, acknowledge_iq,
disconnect_conn)
import constants as cs
def test(q, bus, conn, stream):
event = q.expec... |
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from frappe.utils import (flt, getdate, get_first_day, get_last_day,
add_months, add_days, formatdate)
def get_period_list(fiscal_year, periodicity, from_beginning=False):
"""Get a list of dict {"to_date": to_date, "key": key, "label":... |
"""
Verifies file copies using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.writable(test.workpath('copies'), False)
test.run_gyp('copies.gyp',
'--generator-output=' + test.workpath('gypfiles'),
chdir='copies')
test.writable(test.workpath('copies'), ... |
import os
import sys
from boto.utils import ShellCommand, get_ts
import boto
import boto.utils
class ScriptBase:
def __init__(self, config_file=None):
self.instance_id = boto.config.get('Instance', 'instance-id', 'default')
self.name = self.__class__.__name__
self.ts = get_ts()
if ... |
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.FileHandler import ResultDataBuilder
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.Graphics import FourPanelPlot,GraphicsObject,Style,Frame
from ROOT import kBlack,kBlue,kGreen,kRed,kOrange
from PWG.PWGJE.EMCALJetTasks.Tracks.analysis.base.Helper import MakeRatio,H... |
## file_simple_event.py
###########################################################
## The program will generate & input simple event.
# Support files & directory.
# Could specify the new file to create the specified size events.
# Could specify how many events are going to be input.
# Could specify the inputting f... |
#!/usr/bin/env python
# coding: utf-8
import sys
import urllib2
import base64
import BaseHTTPServer
import SocketServer
import httplib
import urllib
import urlparse
from StringIO import StringIO
import gzip
import rpcrequest
import rpcresponse
import rpcerror
import rpclib
from rpcjson import json
def http_request(u... |
"""Factory method to retrieve the appropriate port implementation."""
import fnmatch
import optparse
import re
from webkitpy.port import builders
def platform_options(use_globs=False):
return [
optparse.make_option('--platform', action='store',
help=('Glob-style list of platform/ports to use... |
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets."""
import collections
import json
import sys
def ParseTarget(target):
target, _, suffix = target.partition('#')
filename, _, target = target.partition(':')
return filena... |
from binary_tree_prototype import BinaryTreeNode
import collections
# @include
def is_balanced_binary_tree(tree):
BalancedStatusWithHeight = collections.namedtuple(
'BalancedStatusWithHeight', ('balanced', 'height'))
# First value of the return value indicates if tree is balanced, and if
# balanc... |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase, Client
from django.contrib.auth.models import User
from tendenci.apps.direc... |
# -*- coding: utf-8 -*-
"""
DepthEstimator
==============
Code for handling required data and producing depth estimates from multispectral
satellite imagery. KNN (Kibele and Shears, In Review) and linear methods
(Lyzenga et al., 2006) are currently supported.
References
----------
Kibele, J., Shears, N.T., In Press.... |
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
... |
from django.conf import settings
from django.http import HttpResponseRedirect
class NonExistentLocaleRedirectionMiddleware(object):
"""Redirect to the 'en' version of a page if translation does not exist.
This middleware redirects requests to pages with locale other than
'en' to their 'en' version. The m... |
from django.conf.urls import patterns, url
from django.contrib import messages
from django.core.urlresolvers import reverse
from django import forms
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext, Template
from django.template.response import TemplateResponse
from ... |
"""
Test term_1_0_l1_penalty
"""
import numpy as np
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.models.mlp import MLP, Sigmoid
from pylearn2.train import Train
from pylearn2.training_algorithms.sgd import SGD, ExponentialDecay
from pylearn2.termination_criteria import And, EpochCou... |
"""Chromium presubmit script for src/chrome/browser/extensions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
def GetPreferredTrySlaves():
return ['linux_chromeos']
class HistogramValueChecker(object):
"""Verify that changes ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.module_utils._text import to_text, to_bytes
from ansible.plugins.netconf import NetconfBase
class Netconf(NetconfBase):
def get_text(self, ele, tag):
try:
return to_text(ele.find... |
"""
Provides a database backend to the central scheduler. This lets you see historical runs.
See :ref:`TaskHistory` for information about how to turn out the task history feature.
"""
#
# Description: Added codes for visualization of how long each task takes
# running-time until it reaches the next status (failed or do... |
"""
Views for managing Neutron Routers.
"""
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.datastructures import SortedDict
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import e... |
"""List dedicated servers."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import columns as column_helper
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
COLUMNS = [
column_helper.Column('datacenter',... |
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import assert_array_equal, assert_equal, assert_raises
def test_packbits():
# Copied from the docstring.
a = [[[1, 0, 1], [0, 1, 0]],
[[1, 1, 0], [0, 0, 1]]]
for dt in '?bBhHiIlLqQ':
ar... |
from __future__ import unicode_literals
"""Global Defaults"""
import frappe
import frappe.defaults
from frappe.utils import cint
from frappe.custom.doctype.property_setter.property_setter import make_property_setter
keydict = {
# "key in defaults": "key in Global Defaults"
"fiscal_year": "current_fiscal_year",
'com... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import InventoryParser
#from . ini import InventoryIniParser
#from . script import InventoryScriptParser
class InventoryAggregateParser(InventoryParser):
def __init__(self, inven_sources):
self.inven... |
"""
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundatio... |
from __future__ import unicode_literals
from django.db import models
"""
class Permissions(models.Model):
class Meta:
managed = False
permissions = (
('restore_jobs', 'Can restore jobs'),
('restore_jobs', 'Can add files jobs'),
('change_jobs', 'Can change jobs'),... |
from prefs_n_perms.client import db
from prefs_n_perms.permissions import Permissions
from prefs_n_perms.preferences import Preferences
from prefs_n_perms.settings import preference_settings
class Section(object):
prefix = preference_settings.SECTIONS_PREFIX
def __init__(self, name, **kwargs):
self.n... |
"""Test trace helpers."""
from datetime import timedelta
from homeassistant import core
from homeassistant.components import trace
from homeassistant.util import dt as dt_util
def test_json_encoder(hass):
"""Test the Trace JSON Encoder."""
ha_json_enc = trace.utils.TraceJSONEncoder()
state = core.State("... |
from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_picking_to_wave(osv.osv_memory):
_name = 'stock.picking.to.wave'
_description = 'Add pickings to a picking wave'
_columns = {
'wave_id': fields.many2one('stock.picking.wave', 'Picking Wave', required=True),
}
... |
import sys
import os
from distutils.core import setup
if 'sdist' in sys.argv:
os.system('./admin/makedoc')
version = '[library version:2.2.5]'[17:-1]
setup(
name='python-openid',
version=version,
description='OpenID support for servers and consumers.',
long_description='''This is a set of Python... |
{
"name": "Immediately Usable Stock Quantity",
"version": "1.0",
"depends": ["product", "stock", ],
"author": "Camptocamp",
"license": "AGPL-3",
"description": """
Compute the immediately usable stock.
Immediately usable is computed : Quantity on Hand - Outgoing Stock.
""",
"website": "http:... |
# coding=utf-8
"""
The OneWireCollector collects data from 1-Wire Filesystem
You can configure which sensors are read in two way:
- add section [scan] with attributes and aliases,
(collector will scan owfs to find attributes)
or
- add sections with format id:$SENSOR_ID
See also: http://owfs.org/
Author: Tomas... |
"""
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... |
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
from warnings import warn
import pyglet.lib
from pyglet.font import base
from pyglet import image
from pyglet.font.freetype_lib import *
from pyglet.compat import asbytes
# fontconfig library definitions
fontconfig = ... |
#!/usr/bin/env python
# encoding: utf-8
"""
test_user.py
Created by Scott on 2013-12-29.
Copyright (c) 2013 Scott Rice. All rights reserved.
"""
import sys
import os
import mock
import shutil
import tempfile
import unittest
from pysteam import steam
from pysteam import user
class TestUser(unittest.TestCase):
... |
import oauth2 as oauth
import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.utils import simplejson
from socialite.apps.base.oauth import helper as oauth_helper
from socialite.apps.base.oauth20.utils import get_mutable_query_dict
... |
import logging
from collections import defaultdict
from django.utils import six
from django.utils.safestring import mark_safe
from .base import (
Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs,
)
from .library import Library
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
logger... |
import re
import os
def XmlToString(content, encoding='utf-8', pretty=False):
""" Writes the XML content to disk, touching the file only if it has changed.
Visual Studio files have a lot of pre-defined structures. This function makes
it easy to represent these structures as Python data structures, instead of
... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_pagefile
version_added: "2.4"
short_description: Query or change pagefile configuration
description:
- Query current pagefile configuratio... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
qualities,
)
class CrooksAndLiarsIE(InfoExtractor):
_VALID_URL = r'https?://embed\.crooksandliars\.com/(?:embed|v)/(?P<id>[A-Za-z0-9]+)'
_TESTS = [{
'url': 'https://embed.crooksandliar... |
"""
Tests for built in Function expressions.
"""
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=50)
alias = models.CharField(max_length=50, null=True, blank=True)
goes_by = models.CharField(max_length=50, null=True, blank=True)
age = models.PositiveSmallInt... |
"""
Provides sx typing classes.
"""
from logging import getLogger
from suds import *
from suds.mx import *
from suds.sax import Namespace as NS
from suds.sax.text import Text
log = getLogger(__name__)
class Typer:
"""
Provides XML node typing as either automatic or manual.
@cvar types: A dict of class ... |
"""
Public API for payment processor implementations.
The specific implementation is determined at runtime using Django settings:
CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use.
CC_PROCESSOR: Dictionary of configuration options for specific processor implementations,
... |
import urllib
import urllib2
import mimetools, mimetypes
import os, sys
# Controls how sequences are uncoded. If true, elements may be given multiple values by
# assigning a sequence.
doseq = 1
class MultipartPostHandler(urllib2.BaseHandler):
handler_order = urllib2.HTTPHandler.handler_order - 10 # needs to run ... |
import os
from distutils.version import LooseVersion
from astropy.visualization.mpl_normalize import simple_norm
from astropy import log
from astropy.io.fits import getdata
def fits2bitmap(filename, ext=0, out_fn=None, stretch='linear',
power=1.0, asinh_a=0.1, min_cut=None, max_cut=None,
... |
from __future__ import unicode_literals
import frappe
from rq import Queue, Worker
from frappe.utils.background_jobs import get_redis_conn
from frappe.utils import format_datetime, cint
colors = {
'queued': 'orange',
'failed': 'red',
'started': 'blue',
'finished': 'green'
}
@frappe.whitelist()
def get_info(show_... |
import res_company
import ir_translation
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
"""Visual Studio user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------------------------------------------------------------------------------
def _FindCommandInPath(command):
"""If there are no slashes in the c... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.core.tasks.task import Task
from pants.base.exceptions import TaskError
class TargetFilterTaskMixin(Task):
"""A Task mixin that provides methods... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.