content string |
|---|
import logging
import os
from . import constants
from .counter import Counter, CounterRecord
error = logging.getLogger("purgecounter").error
info = logging.getLogger("purgecounter").info
class PurgeCounter(object):
def __init__(self, prefs):
self.filename = os.path.join(prefs['WORK_DIR'],
... |
'''aes wrapper for rencfs
Uses either PyCrypto or pyca/cryptography'''
def cryptography_aes_ecb(key):
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.... |
"""Tests for tf.contrib.training.evaluation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import os
import time
import numpy as np
from tensorflow.contrib.framework.python.ops import variables
from tensorflow.contrib.layers.python.layers... |
import arrow
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import aliased, contains_eager, joinedload
import sqlalchemy as sa
import web
from libweasyl.models.content import Report, ReportComment
from libweasyl.models.users import Login
from libweasyl import constants, staff
from weasyl.error im... |
import errno
import os
import socket
import subprocess
import struct
import time
def start_broker(filename, cmd=None, port=1888):
delay = 0.1
if cmd is None:
cmd = ['../../src/mosquitto', '-v', '-c', filename.replace('.py', '.conf')]
if os.environ.get('MOSQ_USE_VALGRIND') is not None:
cmd =... |
"""Notification testing."""
from django.test import TransactionTestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from apps.managers.challenge_mgr import challenge_mgr
from apps.utils import test_utils
from apps.widgets.notifications import get_unread_notifications
from ... |
"""Consume anomaly results in near realtime"""
import os
from nta.utils import amqp
from nta.utils.config import Config
from htmengine import htmengineerrno
from htmengine.runtime.anomaly_service import AnomalyService
appConfig = Config("application.conf", os.environ["APPLICATION_CONFIG_PATH"])
modelResultsExcha... |
"""Unit tests for logarithmic encoder"""
import numpy
import math
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.field_meta import FieldMetaType
import tempfile
import unittest
from nupic.encoders.logarithm import LogEncoder
from nupic.encoders.scalar import ScalarEncoder
try:
import capnp
... |
'''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from six import iteritems, string_types
import inspect
import os
from hashlib import sha1
from types import NoneType
from ansible.errors import AnsibleError, AnsibleParserError
from ansible.parsing import DataLoader
from ansible... |
"""Stochastic optimization methods for MLP
"""
# Authors: Jiyuan Qian <<EMAIL>>
# License: BSD 3 clause
import numpy as np
class BaseOptimizer(object):
"""Base (Stochastic) gradient descent optimizer
Parameters
----------
params : list, length = len(coefs_) + len(intercepts_)
The concatena... |
"""
Tests for L{twisted.conch.tap}.
"""
try:
import Crypto.Cipher.DES3
except:
Crypto = None
try:
import pyasn1
except ImportError:
pyasn1 = None
try:
from twisted.conch import unix
except ImportError:
unix = None
if Crypto and pyasn1 and unix:
from twisted.conch import tap
from twis... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
class AddrProp(object):
def __i... |
"""SCons.Tool.tlib
XXX
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restr... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SelectByExpression.py
---------------------
Date : July 2014
Copyright : (C) 2014 by Michael Douchin
***********************************************************************... |
""" This template creates an Interconnect resource. """
def generate_config(context):
""" Entry point for the deployment resources. """
properties = context.properties
name = properties.get('name', context.env['name'])
project_id = properties.get('project', context.env['project'])
resources = []... |
#!/bin/env python
import os
from distutils.core import setup, Extension
if hasattr(os, 'uname'):
OSNAME = os.uname()[0]
else:
OSNAME = 'Windows'
define_macros = []
libraries = []
extra_link_args = []
extra_compile_args = ['-I../../../']
sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp']
if OSNAME == ... |
# -*- coding: utf-8 -*-
import re
from ..internal.Account import Account
class QuickshareCz(Account):
__name__ = "QuickshareCz"
__type__ = "account"
__version__ = "0.11"
__status__ = "testing"
__description__ = """Quickshare.cz account plugin"""
__license__ = "GPLv3"
__authors__ = [("zo... |
import time
import boto
import boto.ec2
from fabric.api import task, settings, sudo, execute, env, run, cd, local, put, abort, get, hosts
from fabric.operations import prompt
from ec2_deploy.connections import AWS
from ec2_deploy.notifications import Notification
def create_instance(instance_type='web', address=No... |
import logging
import time
import os
from coala_utils.decorators import enforce_signature
from coalib.misc.CachingUtilities import (
pickle_load, pickle_dump, delete_files)
class FileCache:
"""
This object is a file cache that helps in collecting only the changed
and new files since the last run. Exa... |
#!/usr/bin/env python
"""
Configuration script for the analyzer of B0s -> K*0 Ds+ Ds- background events
| | |-> pi- pi- pi+ pi0
| |-> pi+ pi+ pi- pi0
... |
from model.group import Group
class GroupHelper:
def __init__(self, app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()... |
# -*- coding: utf-8 -*-
"""
Spectral bipartivity measure.
"""
import networkx as nx
__author__ = """Aric Hagberg (<EMAIL>)"""
# Copyright (C) 2011 by
# Aric Hagberg <<EMAIL>>
# Dan Schult <<EMAIL>>
# Pieter Swart <<EMAIL>>
# All rights reserved.
# BSD license.
__all__ = ['spectral_bipartivity']
def ... |
import os
try: from hashlib import sha1 as sha
except ImportError: from sha import sha
def gitsha(path):
h = sha()
data = file(path, 'rb').read()
h.update("blob %d\0" % len(data))
h.update(data)
return h.hexdigest()
def git_info():
commithash = os.popen('git rev-parse --verify HEAD 2>/dev/null... |
import os
def split_path(path):
folders = []
while True:
path, folder = os.path.split(path)
if folder != "":
folders.append(folder)
else:
if path != "":
folders.append(path)
break
folders.reverse()
return folders
def lex_file(... |
#!/usr/bin/env python
'''Example of a custom replaced element for XHTML layout.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: xml_css.py 322 2006-12-26 12:53:18Z Alex.Holkner $'
from ctypes import *
from pyglet.gl import *
from pyglet.window import Window
from pyglet import clock
from layout import *
... |
from pip._vendor.pkg_resources import yield_lines
from pip._vendor.six import ensure_str
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
class DictMetadata:
"""IMetadataProvider that reads metadata files from a dictionary.
"""
... |
import sys
import ns.applications
import ns.core
import ns.flow_monitor
import ns.internet
import ns.mobility
import ns.network
import ns.olsr
import ns.wifi
try:
import ns.visualizer
except ImportError:
pass
DISTANCE = 100 # (m)
NUM_NODES_SIDE = 3
def main(argv):
cmd = ns.core.CommandLine()
cmd.Nu... |
"""Asyncio support for Motor, an asynchronous driver for MongoDB."""
from . import core, motor_gridfs
from .frameworks import asyncio as asyncio_framework
from .metaprogramming import create_class_with_framework
__all__ = ['AsyncIOMotorClient']
def create_asyncio_class(cls):
return create_class_with_framework(c... |
import myhdl
from myhdl import *
from myhdl import ToVHDLWarning
import pytest
import tempfile
import shutil
import sys
import string
import importlib
import os
from keyword import kwlist as python_kwlist
import warnings
_vhdl_keywords = ["abs", "access", "after", "alias", "all",
"and", "architectu... |
""" Script to make sure libcluster runs properly using the python API.
Author: Daniel Steinberg
Date: 13/10/2013
"""
import numpy as np
import libclusterpy as lc
# Top level cluster parameters -- Globals.... whatev...
means = np.array([[0, 0], [5, 5], [-5, -5]])
sigma = [np.eye(2)] * 3
beta = np.array([[... |
# -*- coding: utf-8 -*-
"""core -- core behaviors for Owyl.
Copyright 2008 David Eyk. All rights reserved.
$Author$\n
$Rev$\n
$Date$
"""
__author__ = "$Author$"[9:-2]
__revision__ = "$Rev$"[6:-2]
__date__ = "$Date$"[7:-2]
import logging
try:
from mx.Stack import Stack, EmptyError
except ImportError:
from s... |
# -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.11.dev0'
# utilities we import from Werkzeug ... |
"""Unittests for the git_trace2_event_log.py module."""
import json
import os
import tempfile
import unittest
from unittest import mock
import git_trace2_event_log
class EventLogTestCase(unittest.TestCase):
"""TestCase for the EventLog module."""
PARENT_SID_KEY = 'GIT_TRACE2_PARENT_SID'
PARENT_SID_VALUE = 'p... |
#!/usr/bin/env python
### submit cosmomc jobs
#### by Zhiqi Huang (<EMAIL>)
import re
import os
import sys
import glob
import string
def search_value(fname, pattern):
fp = open(fname, 'r')
file_content = fp.read()
fp.close()
m = re.search(pattern, file_content, flags = re.M + re.I)
if m:
r... |
try:
from cs import CloudStack, CloudStackException, read_config
has_lib_cs = True
except ImportError:
has_lib_cs = False
# import cloudstack common
from ansible.module_utils.cloudstack import *
class AnsibleCloudStackPortforwarding(AnsibleCloudStack):
def __init__(self, module):
super(Ansib... |
import os
from os import path
from unittest import mock
from testtools.matchers import HasLength
import snapcraft
from snapcraft.plugins import nodejs
from snapcraft import tests
class NodePluginTestCase(tests.TestCase):
def setUp(self):
super().setUp()
self.project_options = snapcraft.Project... |
import sys
import time
import logging
import datetime
from django.db import transaction
from django.utils import timezone
from framework.celery_tasks import app as celery_app
from website.app import setup_django
setup_django()
from osf.models import Session
from scripts.utils import add_file_logger
logger = logging... |
from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect
from django.test import SimpleTestCase
class CLLocalFlavorTests(SimpleTestCase):
def test_CLRegionSelect(self):
f = CLRegionSelect()
out = u'''<select name="foo">
<option value="RM">Regi\xf3n Metropolitana de Santiago</opt... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_cwed_ascii.py
------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************... |
# Font generation script from FontCustom
# https://github.com/FontCustom/fontcustom/
# http://fontcustom.com/
import fontforge
import os
import md5
import subprocess
import tempfile
import json
import copy
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
INPUT_SVG_DIR = os.path.join(SCRIPT_PATH, '..', '..', '... |
#!/usr/bin/env python
import datetime
import XenAPI
import sanitychecklib
#parameters for the shared storage to be created
storage_type='nfs'
device_config={'server':sanitychecklib.network_storage_server, 'serverpath':sanitychecklib.network_storage_path }
physical_size = '100000'
name_label = 'created by sharedstor... |
import re
from pandasqt.compat import QtCore, QtGui, Qt, Slot, Signal
from pandasqt.models.SupportedDtypes import SupportedDtypes
import numpy
from pandas import Timestamp
from pandas.tslib import NaTType
class DefaultValueValidator(QtGui.QValidator):
def __init__(self, parent=None):
super(DefaultValueV... |
import product
import stock_account
import stock
import wizard
import res_config |
"""Tool for checking a lot of DNS servers from stdin for possible inclusion."""
__author__ = '<EMAIL> (Thomas Stromberg)'
import csv
import re
import sys
import GeoIP
sys.path.append('..')
sys.path.append('/Users/tstromberg/namebench')
import third_party
from libnamebench import nameserver_list
from libnamebench imp... |
import os, sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import syscall_name
usage = "perf script -s syscall-counts-by-pid.py [comm]\n";
for_comm = None
for_pid = None
if len(sys.argv) > 2:
sys.... |
from ryu.ofproto.oxx_fields import (
_from_user,
_from_user_header,
_to_user,
_to_user_header,
_field_desc,
_parse,
_parse_header,
_serialize,
_serialize_header)
OFPXSC_OPENFLOW_BASIC = 0x8002
OFPXSC_EXPERIMENTER = 0xFFFF
OFPXSC_HEADER_PACK_STR = '!I'
OFPXSC_EXP_HEADER_PACK_STR =... |
"""
This module contains common utility objects/functions for the other query
parser modules.
"""
from whoosh.compat import string_type
class QueryParserError(Exception):
def __init__(self, cause, msg=None):
super(QueryParserError, self).__init__(str(cause))
self.cause = cause
def get_single_te... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class VierIE(InfoExtractor):
IE_NAME = 'vier'
_VALID_URL = r'https?://(?:www\.)?vier\.be/(?:[^/]+/videos/(?P<display_id>[^/]+)(?:/(?P<id>\d+))?|video/v3/embed/(?P<embed_id>\d+))'
_TESTS = [{
'url'... |
from docutils import writers
from docutils import nodes
class LitreTranslator(nodes.GenericNodeVisitor):
def __init__(self, document, config):
nodes.GenericNodeVisitor.__init__(self,document)
self._config = config
def default_visit(self, node):
pass
# print '**visiting... |
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import pandas
import numpy as np
import statsmodels.formula.api as smf
import st... |
import unittest
import six
from w3lib.encoding import resolve_encoding
from scrapy.http import (Request, Response, TextResponse, HtmlResponse,
XmlResponse, Headers)
from scrapy.selector import Selector
from scrapy.utils.python import to_native_str
class BaseResponseTest(unittest.TestCase):
... |
import datetime
#import simplejson as json
from django.utils import simplejson as json
from django.db.models.query_utils import Q
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.contrib.auth.models import User
from django.http import HttpResponse
from dja... |
# import RPi.GPIO as gpio
# import time
# #use board numbering on the pi
# gpio.setmode(gpio.BOARD)
# # output_pins = [40, 38]
# output_pins = 16
# gpio.setup(output_pins, gpio.OUT)
# #true and 1 are the same
# # gpio.output(40, True)
# # gpio.output(38, 1)
# while True:
# gpio.output(output_pins, (True, False))... |
class AmountChangedPattern:
def __init__(self, compile_regex, index_for_zero_value):
self._regex = compile_regex
self._index_for_zero_value = index_for_zero_value
def match(self, path, diff_file):
examined_strings = set()
for diff_line in diff_file:
if diff_line[self... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... |
# coding: utf-8
from __future__ import unicode_literals
import datetime
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
parse_iso8601,
str_to_int,
)
class CamdemyIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?ca... |
# -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2010 by the Jinja Team.
:... |
import datetime
import random
import unittest
import uuid
from nose.plugins.attrib import attr
import mock
from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator
from xmodule.modulestore import ModuleStoreEnum
from xmodule.x_module import XModuleMixin
from xmodule.modulestore.inheritance import Inherita... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import os
import glob
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes, to_native
module = None
init_script = None
# ========... |
# coding=utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
)
class JpopsukiIE(InfoExtractor):
IE_NAME = 'jpopsuki.tv'
_VALID_URL = r'https?://(?:www\.)?jpopsuki\.tv/(?:category/)?video/[^/]+/(?P<id>\S+)'
_TEST = {
... |
'''
Based on the OpenSearch Python module by Ed Summers <<EMAIL>> from
https://github.com/edsu/opensearch .
This module is heavily modified and does not implement all the features from
the original. The ability for the the module to perform a search and retrieve
search results has been removed. The original module us... |
"""
.. module:: dst
:synopsis: A module for reading, writing, and storing dst Data
.. moduleauthor:: AJ, 20130131
*********************
**Module**: gme.ind.dst
*********************
**Classes**:
* :class:`gme.ind.dst.dstRec`
**Functions**:
* :func:`gme.ind.dst.readDst`
* :func:`gme.ind.dst.readDstWeb`
* :func:... |
""" Test functions for linalg module using the matrix class."""
import numpy as np
from numpy.linalg.tests.test_linalg import (
LinalgCase, apply_tag, TestQR as _TestQR, LinalgTestCase,
_TestNorm2D, _TestNormDoubleBase, _TestNormSingleBase, _TestNormInt64Base,
SolveCases, InvCases, EigvalsCases, EigCases, ... |
import unittest
from test import test_support
from contextlib import closing
import gc
import pickle
import select
import signal
import subprocess
import traceback
import sys, os, time, errno
if sys.platform in ('os2', 'riscos'):
raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
class HandlerBCal... |
import oslo_i18n
from oslo_log import log as logging
import webob.dec
from neutron.api.views import versions as versions_view
from neutron import wsgi
LOG = logging.getLogger(__name__)
class Versions(object):
@classmethod
def factory(cls, global_config, **local_config):
return cls()
@webob.de... |
"""
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.contrib.staticfiles import finders
from django.http import Http404
from django.utils.six.moves.url... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='User',... |
#!/usr/bin/env python
from functools import wraps
from typing import Callable, Dict, List, Optional, Tuple, TypeVar
from genes.debian.traits import is_debian
from genes.lib.logging import log_error, log_warn
from genes.lib.traits import ErrorLevel
T = TypeVar('T')
def is_ubuntu(versions: Optional[List[str]] = None)... |
import logging
import math
import os
import random
from subprocess import run
logger = logging.getLogger('kim_compare_lammps')
class potfit_run(object):
def __init__(self, binary, model, config, directory):
self.binary = binary
self.config = config
self.directory = directory
self.model = model
... |
from .compat import PY2, PY3
from .universaldetector import UniversalDetector
from .version import __version__, VERSION
def detect(byte_str):
"""
Detect the encoding of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
"""
... |
# -*- 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),
]
operati... |
import datetime
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations, \
BaseDatabaseWrapper, BaseDatabaseClient, BaseDatabaseValidation, \
BaseDatabaseIntrospection
from .creation import NonrelDatabaseCreation
class NonrelDatabaseFeatures(BaseDatabaseFeatures):
can_return_id_from_in... |
"""Generate some standard test data for debugging TensorBoard.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import bisect
import math
import os
import os.path
import random
import shutil
import numpy as np
from six.moves import xrange # pylint: dis... |
# encoding: UTF-8
import sys
from time import sleep
from PyQt4 import QtGui
from vnksotptd import *
#----------------------------------------------------------------------
def print_dict(d):
"""按照键值打印一个字典"""
for key,value in d.items():
print key + ':' + str(value)
#----------------... |
import os
import stat as statmod
def _mode_to_kind(mode):
if statmod.S_ISREG(mode):
return statmod.S_IFREG
if statmod.S_ISDIR(mode):
return statmod.S_IFDIR
if statmod.S_ISLNK(mode):
return statmod.S_IFLNK
if statmod.S_ISBLK(mode):
return statmod.S_IFBLK
if statmod.S_... |
import os
import unittest
from glob import glob
from airflow.models import DagBag
from tests.test_utils.asserts import assert_queries_count
ROOT_FOLDER = os.path.realpath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir)
)
NO_DB_QUERY_EXCEPTION = ["/airflow/example_dags/example_sub... |
import logging
from webkitpy.tool.bot.irc_command import IRCCommand
from webkitpy.tool.bot.irc_command import Help
from webkitpy.tool.bot.irc_command import Hi
from webkitpy.tool.bot.irc_command import Restart
from webkitpy.tool.bot.ircbot import IRCBot
from webkitpy.tool.bot.patchanalysistask import PatchAnalysisTask... |
class ModuleDocFragment(object):
DOCUMENTATION = '''
options:
api_version:
description:
- Use to specify the API version. Use to create, delete, or discover an object without providing a full
resource definition. Use in conjunction with I(kind), I(name), and I(namespace) to identify a
specifi... |
import copy
from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
from tests import test_utils
from treeherder.client import TreeherderResultSetCollection
from treeherder.model.models import (FailureClassification,
Job,
... |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
"""Listado y creación del consolidado anual"""
import cgi
import cgitb; cgitb.enable()
import funciones
import datos
import pagina
import htm
import csv
import StringIO
def listado():
"""Listado de consolidado"""
pag = pagina.Pagina("Consolidado anual", 4)
prin... |
#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from nagios import N... |
"""
WSGI middleware for OpenStack API controllers.
"""
import routes
import webob.dec
import webob.exc
from nova.api.openstack import wsgi
from nova.openstack.common import log as logging
from nova import utils
from nova import wsgi as base_wsgi
LOG = logging.getLogger(__name__)
class FaultWrapper(base_wsgi.Middl... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.facts.network.base import NetworkCollector
from ansible.module_utils.facts.network.generic_bsd import GenericBsdIfconfigNetwork
class OpenBSDNetwork(GenericBsdIfconfigNetwork):
"""
This is the Op... |
"""@package src.wi.tests.main_test
@author Piotr Wójcik
@author Krzysztof Danielowski
@date 11.10.2012
"""
from wi.tests import WiTestCase
import unittest
class MainTests(WiTestCase, unittest.TestCase):
def _test_news_create(self):
driver = self.driver
self.base_url = self.TEST_SERVER
s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
The Iris Dataset
=========================================================
This data sets consists of 3 different types of irises'
(Setosa, Versicolour, and Virginica) petal and sepal
length, stored in a 150x4 numpy... |
from toolset.benchmark.test_types.framework_test_type import FrameworkTestType
from toolset.benchmark.test_types.verifications import basic_body_verification, verify_headers
from time import sleep
class PlaintextTestType(FrameworkTestType):
def __init__(self, config):
self.plaintext_url = ""
kwarg... |
"""cond_v2 and gradient.
This is a version of cond that emits a single If op, as well as the gradient
function for If ops produced by cond_v2. This will eventually replace the
current tf.cond implementation once it reaches feature and performance parity.
"""
from __future__ import absolute_import
from __future__ impo... |
# -*- coding: utf-8 -*-
""" OneLogin_Saml2_Metadata class
Copyright (c) 2010-2021 OneLogin, Inc.
MIT License
Metadata class of OneLogin's Python Toolkit.
"""
from time import gmtime, strftime, time
from datetime import datetime
from defusedxml.minidom import parseString
from onelogin.saml2.constants import OneLog... |
from __future__ import division, print_function, unicode_literals, \
absolute_import
import os
import unittest
import numpy as np
from pymatgen.io.lammps.output import LammpsRun, LammpsLog, LammpsDump
__author__ = 'Kiran Mathew'
__email__ = '<EMAIL>'
test_dir = os.path.join(os.path.dirname(__file__), "..", "..... |
from openerp import models, fields, api
from openerp.addons import decimal_precision as dp
class ProductTemplate(models.Model):
_inherit = 'product.template'
@api.multi
@api.depends('product_variant_ids.immediately_usable_qty')
def _immediately_usable_qty(self):
"""No-op implementation of the... |
import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
def get_fans(shape):
fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])
fan_out = shape[1] if len(shape) == 2 else shape[0]
return fan_in, fan_out
class WeightInitializer(object):
"""
Initializer for creating weights.
... |
#!/usr/bin/python
import os
import re
import types
import ConfigParser
import shlex
class RegistrationBase(object):
def __init__(self, module, username=None, password=None):
self.module = module
self.username = username
self.password = password
def configure(self):
raise NotI... |
from subprocess import call, PIPE, Popen
import sys
import re
import numpy as np
from numpy.linalg import lapack_lite
from numpy.testing import TestCase, dec
from numpy.compat import asbytes_nested
class FindDependenciesLdd:
def __init__(self):
self.cmd = ['ldd']
try:
st = call(self.... |
class ReportField(object):
REPORT_FIELD_TYPES_KNOWN = ['double', 'string', 'date', 'datetime', 'boolean']
REPORT_FIELD_TYPES_FALLBACK = 'string'
REPORT_FIELD_TYPE_MAP = {
'money': 'double',
'integer': 'int',
'bid': 'double',
'long': 'int'
}
def __init__(self, defini... |
__version__ = '0.70a1'
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Manager', 'Pipe', 'cpu_count', 'log_to_stderr', 'get_logger',
'allow_connection_pickling', 'BufferTooShort', 'TimeoutError',
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
'Event',... |
"""OAuth 2.0 utilities for Django.
Utilities for using OAuth 2.0 in conjunction with
the Django datastore.
"""
__author__ = '<EMAIL> (Joe Gregorio)'
import oauth2client
import base64
import pickle
from django.db import models
from oauth2client.client import Storage as BaseStorage
class CredentialsField(models.Fiel... |
import itertools
from datetime import datetime, timedelta
from subprocess import Popen, PIPE
from django.conf import settings
from django.utils import translation
from django.db import connection, transaction
import cronjobs
import commonware.log
import amo
from amo.utils import chunked
from amo.helpers import user_... |
{
"name": "Bolivia Localization Chart Account",
"version": "1.0",
"description": """
Bolivian accounting chart and tax localization.
Plan contable boliviano e impuestos de acuerdo a disposiciones vigentes
""",
"author": "Cubic ERP",
"website": "http://cubicERP.com",
"category": "Localizati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.