content string |
|---|
from __future__ import absolute_import
import copy
from django.conf import settings
from django.db import models
from django.db.models.loading import cache
from django.test import TestCase
from django.test.utils import override_settings
from .models import (
Child1,
Child2,
Child3,
Child4,
Child5,... |
import logging
import os
from metrics import Metric
class MediaMetric(Metric):
"""MediaMetric class injects and calls JS responsible for recording metrics.
Default media metrics are collected for every media element in the page,
such as decoded_frame_count, dropped_frame_count, decoded_video_bytes, and
deco... |
from openerp.addons.web import http
from openerp.addons.web.http import request
class WebsiteCertifiedPartners(http.Controller):
@http.route(['/certifications',
'/certifications/<model("certification.type"):cert_type>'], type='http', auth='public',
website=True)
def certified... |
# -*- coding: utf-8 -*-
# pylint: skip-file
"""Manual tests"""
import pytest
from cfme import test_requirements
pytestmark = [
pytest.mark.ignore_stream('upstream'),
pytest.mark.manual,
test_requirements.retirement
]
@pytest.mark.tier(2)
def test_retire_infra_vms_folder():
"""
test the retire fu... |
"""
Verifies that when multiple values are supplied for a gyp define, the last one
is used.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
os.environ['GYP_DEFINES'] = 'key=value1 key=value2 key=value3'
test.run_gyp('defines.gyp')
test.build('defines.gyp')
test.must_contain('action.txt', 'value3')
# The last... |
__author__ = "huhamhire <<EMAIL>>"
import os
import sys
import shutil
from __version__ import __version__
SCRIPT = "hoststool.py"
SCRIPT_DIR = os.getcwd() + '/'
RELEASE_DIR = "../release/"
# Shared package settings and metadata
NAME = "HostsUtl"
VERSION = __version__
DESCRIPTION = "HostsUtl - Hosts Setup Utility"
A... |
from django import template
register = template.Library()
@register.inclusion_tag('admin/prepopulated_fields_js.html', takes_context=True)
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and in... |
from openerp import models, api
class StockAccountImprovedStockMove(models.Model):
_inherit = 'stock.move'
@api.model
def default_get(self, fields_list):
result = super(StockAccountImprovedStockMove, self).default_get(fields_list)
picking_id = result.get('default_picking_id') or self.env.... |
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
try:
from botocore.exceptions import BotoCoreError, Cl... |
import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... |
"""Uploads the results to the flakiness dashboard server."""
# pylint: disable=E1002,R0201
import logging
import os
import shutil
import sys
import tempfile
import xml
# Include path when ran from a Chromium checkout.
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__),
... |
source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
# entry of test
def main():
# expected error texts - for different compilers
expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope",
"'SyntaxError' : undeclared identifier",
... |
import logging
import paho.mqtt.client as mqtt
import socket
import datetime
from server import Lazy, Server
from emaproto import SPSB, STATLEN
from command import Command, COMMAND
from dev.todtimer import Timer
# FLASH Pages where History data re stored
FLASH_START = 300
FLASH_END = 300
# tog info every NPLUBLI... |
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
import werkzeug
import datetime
import time
from openerp.tools.translate import _
class sale_quote(http.Controller):
@http.route([
"/quote/<int:order_id>",
"/quote/<int:order_id>/<token... |
# Module related with dataset
import os
import urllib
import zipfile
import numpy as np
def download(dataset_name = 'UCI HAR'):
""""Download database to local folder
"""
# Init
dataset_valid = False
dataset_folder = "./"
download_folder = os.path.abspath("../dataset/donwload/") + "... |
"""Test that the contrib module shows up properly."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
from tensorflow.python.platform import googletest
class ContribTest(googletest.TestCase):
def testContrib(self):
# pylint: disable=... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'DocumentPermission.perms'
db.alter_column(u'desktop_do... |
# -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import posixpath
from jinja2 import BaseLoader, Environment as BaseEnvironment, \
TemplateNotFound
from .glo... |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... |
"""
pip install m3u8 first, please
"""
import sys
import m3u8
import time
import urllib2
import os
url = "http://localhost:20119/cctv21/encoder/0/playlist.m3u8"
media_sequence = 0
playlist = m3u8.load(url)
while playlist.is_variant:
url = playlist.base_uri + "/" + playlist.playlists[0].uri
playlist = m3u8.lo... |
import copy
class Lambda(object):
"""
Lambda lambda-like class
Acts like a lambda function, but its string representation
is Python code that yields the object when executed.
>>> f = Lambda('x : x**2')
>>> f(1.41)
1.9880999999999998
>>> g = eval(str(f))
>>> g(2.82)
7.95239999... |
import types
import unittest
import arff
class ConversorStub(object):
def __init__(self, r_value):
self.r_value = r_value
def __call__(self, value):
return self.r_value(value)
class COOStub(object):
def __init__(self, data, row, col):
self.data = data
self.row = row
... |
# Django settings for minha_grade_fisl project.
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.pa... |
from __future__ import unicode_literals
from datetime import date, datetime
from django.test import SimpleTestCase, override_settings
from django.test.utils import TZ_SUPPORT, requires_tz_support
from django.utils import dateformat, translation
from django.utils.dateformat import format
from django.utils.timezone imp... |
"""
Url Length Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import logging
from scrapy.http import Request
from scrapy.exceptions import NotConfigured
logger = logging.getLogger(__name__)
class UrlLengthMiddleware(object):
def __init__(self, maxlength):
self.maxlength ... |
"""\
Application errors.\
"""
__license__ = """\
Copyright (c) 2014 - 2017 Jiří Kučera.
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 restriction, including without limitation the right... |
import cv2
import Tool
from scipy import ndimage
class Denoise(Tool.Tool):
def on_init(self):
self.id = "denoise"
self.name = "Denoise"
self.icon_path = "ui/PF2_Icons/Denoise.png"
self.properties = [
# Detailer
Tool.Property("enabled", "Denoise", "Header", F... |
"""
This package contains Docutils Reader modules.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import utils, parsers, Component
from docutils.transforms import universal
if sys.version_info < (2,5):
from docutils._compat import __import__
class Reader(Component):
"""
Abstract base ... |
from django import template
from django.apps import apps
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self... |
"Implementation of tzinfo classes for use with datetime.datetime."
from __future__ import unicode_literals
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import force_str, force_text, DEFAULT_LOCALE_ENCODING
# Python's doc say: "A tzinfo subclass must have an __init__() method that ca... |
"""
=======================
MNIST dataset benchmark
=======================
Benchmark on the MNIST dataset. The dataset comprises 70,000 samples
and 784 features. Here, we consider the task of predicting
10 classes - digits from 0 to 9 from their raw images. By contrast to the
covertype dataset, the feature space is... |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... |
"""docs/source/programmers_guide_src/code/performance-diagnostic_calls.py"""
import PyU4V
# Initialise PyU4V Unisphere connection
conn = PyU4V.U4VConn()
# Get a list of performance categories
category_list = conn.performance.get_performance_categories_list()
# Get a list of supported metrics for the category 'FEDir... |
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
employees = get_employees(filters)
departments_result = get_department(filters)
departments = []
if departments_result:
for department in departments_result... |
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EXT = {
'executable': 'exe',
'loadable_module': 'dll',
'shared_library': 'dll',
'static_library': 'lib',
}
def _GetLargePdbShimCcPath():
"""Returns... |
import logging
import os
import platform
import requests
import socket
import fcntl
import struct
logger = logging.getLogger(__name__)
def address_by_route():
logger.debug("Finding address by querying local routing table")
addr = os.popen("/sbin/ip route get 8.8.8.8 | awk '{print $NF;exit}'").read().strip()
... |
import re
from livestreamer.plugin import Plugin, PluginError, PluginOptions
from livestreamer.plugin.api import http, validate
from livestreamer.stream import HLSStream
LOGIN_PAGE_URL = "http://www.livestation.com/en/users/new"
LOGIN_POST_URL = "http://www.livestation.com/en/sessions.json"
_csrf_token_re = re.compi... |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
'''
retain - Command-line utility that removes all files except the ones
specified on the command line.
Usage:
------
retain [-fnrsv] [-d directory] filename [...]
Options:
--------
--directory <dir> The directory to operate on. Defaults to the current
... |
#=======================================================================
#
# Python Lexical Analyser
#
# Traditional Regular Expression Syntax
#
#=======================================================================
from Regexps import Alt, Seq, Rep, Rep1, Opt, Any, AnyBut, Bol, Eol, Char
from Errors import Plex... |
from otp.ai.AIBaseGlobal import *
from direct.task.Task import Task
from pandac.PandaModules import *
from DistributedNPCToonBaseAI import *
from toontown.estate import BankGlobals
class DistributedNPCBankerAI(DistributedNPCToonBaseAI):
FourthGagVelvetRopeBan = config.GetBool('want-ban-fourth-gag-velvet-rope', 0)
... |
from typing import TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any
... |
import unittest
import numpy
import chainer
from chainer.backends import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'func_name': ['cos', 'sin', 'tan'],
'shape': [(3, 2), ()],
... |
"""A wrapper for TensorFlow SWIG-generated bindings."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ctypes
import sys
import traceback
from tensorflow.python.platform import self_check
# Perform pre-load sanity checks in order to produce a mor... |
# -*- coding: utf-8 -*-
"""
ipcai2016
Copyright (c) German Cancer Research Center,
Computer Assisted Interventions.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE for details
"""
"""
Crea... |
from __future__ import absolute_import
import pytest
from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleFailJson, AnsibleExitJson
from ansible.module_utils import basic
from ansible.modules.network.check_point import checkpoint_host
OBJECT = {'name': 'foo', 'ipv4-address': '192.168.0.15'}
... |
"""Compressed Sparse Row matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['csr_matrix', 'isspmatrix_csr']
import numpy as np
from scipy._lib.six import xrange
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
... |
#!/usr/bin/python
#-*- coding: iso-8859-15 -*-
# SADR METEOLLSKY
# http://www.sadr.fr
# SEBASTIEN LECLERC 2018
# Inspired by Marcus Degenkolbe
# http://indilib.org/develop/tutorials/151-time-lapse-astrophotography-with-indi-python.html
# allsky frame script
import sys, time, logging
import PyIndi
import pyfits
import ... |
import unittest
try:
import unittest.mock as mock
except ImportError:
import mock
from cloudbaseinit import conf as cloudbaseinit_conf
from cloudbaseinit.metadata.services import ec2service
from cloudbaseinit.tests import testutils
CONF = cloudbaseinit_conf.CONF
class EC2ServiceTest(unittest.TestCase):
... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AnonymousUserId'
db.create_table('student_anonymoususerid', (
('id', self.gf('dj... |
import os
from subprocess import Popen, PIPE
from bases.FrameworkServices.SimpleService import SimpleService
from bases.collection import find_binary
class ExecutableService(SimpleService):
def __init__(self, configuration=None, name=None):
SimpleService.__init__(self, configuration=configuration, name=... |
#!/usr/bin/env python
"""
Helper script to update sampleproject's translation catalogs.
When a bug has been identified related to i18n, this helps capture the issue
by using catalogs created from management commands.
Example:
The string "Two %% Three %%%" renders differently using trans and blocktrans.
This issue i... |
'''
Created on Nov 9, 2011
@author: sean
'''
from graphlab.meta.testing import py2only
from graphlab.meta.decompiler.tests import Base
import unittest
class Simple(Base):
def test_assign(self):
'a = b'
self.statement('a = b')
def test_assign2(self):
'a = b = c'
self.statemen... |
from . import constants
import re
class CharSetProber:
def __init__(self):
pass
def reset(self):
self._mState = constants.eDetecting
def get_charset_name(self):
return None
def feed(self, aBuf):
pass
def get_state(self):
return self._mState
def get_... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
class CallbackModule(CallbackModule_default): # pylint: disable=too-few-public-methods,no-init
'''
Override for the default callback m... |
"""
RPC Controller
"""
import datetime
import traceback
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
import oslo_utils.importutils as imp
import six
from webob import exc
from clictest.common import client
from clictest.common import exception
from clictest.common... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'} |
"""
These integration tests exist solely to test the interaction between pyggybank and GPG on the CLI.
All attempts should be made to avoid extending these tests in preference for unit tests of the functions
themselves (where necessary, mocking out the GPG interactions).
TODO: It would be great to bring these tests in... |
from . import constants
from .escsm import (HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel,
ISO2022KRSMModel)
from .charsetprober import CharSetProber
from .codingstatemachine import CodingStateMachine
from .compat import wrap_ord
class EscCharSetProber(CharSetProber):
def __init__(self):
... |
'''
Distribution function module for Barnes-Hutt n-body simulation developed by Matt Griffiths and James Archer.
Example distribution written by Matt Griffiths, list idea concieved by James Archer.
Special thanks to Matt Sanderson for ideas regarding distribution implementation.
Avaliable for use under a GPL v3 licenc... |
import os
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django application and its con... |
from decimal import Decimal
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import AreaField
from django.contrib.gis.measure import (
Area as AreaMeasure, Distance as DistanceMeasure,
)
from django.core.exceptions import FieldError
from django.db.models import Fl... |
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Components.FileList import FileList
from Components.Sources.StaticText import StaticText
from Components.MediaPlayer import PlayList
from Components.config import config, getConfigListEntry, ConfigSubsection, configfile, ConfigText, Conf... |
import agents as ag
import envgui as gui
import random
# ______________________________________________________________________________
loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world
def RandomVacuumAgent():
"Randomly choose one of the actions from the vacuum environment."
p = ag.Ra... |
import logging
import sys
import unittest
import re
from datetime import timedelta
from airflow.contrib.sensors.hdfs_sensors import HdfsSensorFolder, HdfsSensorRegex
from airflow.exceptions import AirflowSensorTimeout
class HdfsSensorFolderTests(unittest.TestCase):
def setUp(self):
if sys.version_info[0] ... |
#!/usr/bin/python
from .main import *
from .transaction import *
from .bci import *
from .deterministic import *
from .blocks import *
# Takes privkey, address, value (satoshis), fee (satoshis)
def send(frm, to, value, fee=10000):
return sendmultitx(frm, to + ":" + str(value), fee)
# Takes privkey, "address1:va... |
"""
Parser that converts (C style) binary structs named tuples.
The struct can be read from a file or a byte string.
"""
import struct
import collections
def _make_struct_class(name, names):
class Struct(object):
_names = names
def __init__(self, **kwargs):
vars(self).update(kwargs)
... |
import constants, sys
from constants import eStart, eError, eItsMe
from charsetprober import CharSetProber
class MultiByteCharSetProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mDistributionAnalyzer = None
self._mCodingSM = None
self._mLastChar = ['\x00... |
#ImportModules
import ShareYourSystem as SYS
#ImportModules
import ShareYourSystem as SYS
LateralWeightVariablesList=[
[[-100.]]
]
#Check
for __LateralWeightVariable in LateralWeightVariablesList:
#Define
MyStabilizer=SYS.StabilizerClass(
).stationarize(
_MeanWeightVariable=__Lateral... |
from tkinter import *
from tkinter import ttk
import connection
import paramiko
import threading
import sqlite3
import time
import os
import random
class LogFile(ttk.Frame):
def __init__(self,master,filterFrame,con,log,addr,tempdir):
ttk.Frame.__init__(self,master)
self.master = master
se... |
# -*- coding: utf-8 -*-
from koalixcrm.accounting.rest.account_rest import OptionAccountJSONSerializer
from rest_framework import serializers
from koalixcrm.accounting.accounting.product_category import ProductCategory
from koalixcrm.accounting.models import Account
class ProductCategoryMinimalJSONSerializer(seriali... |
#!/usr/bin/env python
class UnionFind:
def __init__(self):
self.parent = {}
self.rank = {}
def root(self, a):
current_item = a
path = []
while self.parent[current_item] != current_item:
path.append(current_item)
current_item = self.parent[curren... |
import json
from booby import Model
from ot_api.endpoints import GET_URL
from ot_api.exceptions import NoParamException
from .utils import build_endpoint_url
class OpentopicModel(Model):
"""
Base Model class. Provide functionalists for needed in all opentopic objects return by endpoints
"""
parser = ... |
import numpy as np
from numpy.testing import assert_allclose
from menpo.image import BooleanImage
from menpo.shape import PointCloud
def test_boolean_image_constrain_landmarks():
mask = BooleanImage.init_blank((10, 10), fill=False)
mask.landmarks['test'] = PointCloud(
np.array([[1, 1], [8, 1], [8, 8],... |
import pytest
from cylc.flow.batch_sys_handlers.lsf import BATCH_SYS_HANDLER
@pytest.mark.parametrize(
'job_conf,lines',
[
( # basic
{
'batch_system_conf': {},
'directives': {},
'execution_time_limit': 180,
'job_file_path': ... |
import sys
import csv
import json
import os
import time
try:
import twitter
except ImportError:
print("""\
You need to ...
pip install twitter
If pip is not found you might have to install it using easy_install.
If it does not work on your system, you might want to follow instructions
at https://github.com... |
from lxml import etree
from xmodule.editing_module import XMLEditingDescriptor
from xmodule.xml_module import XmlDescriptor
import logging
from xblock.fields import String, Scope
from exceptions import SerializationError
log = logging.getLogger(__name__)
class RawDescriptor(XmlDescriptor, XMLEditingDescriptor):
... |
#!/usr/bin/env python3.4
# ---------------------------------------------------------------------------- #
import os, csv, glob, re
import pandas as pd
from Constants import ConvPercentage
from tqdm import tqdm
# ---------------------------------------------------------------------------- #
os.chdir('../../../../Desktop... |
import sys
import os
def usage():
print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
print("")
print("PHYTYPES is a comma separated list of:")
print("A => A-PHY")
print("AG => Dual A-PHY G-PHY")
print("G => G-PHY")
print("LP => LP-PHY")
print("N ... |
"""
Unit tests for contentstore.views.library
More important high-level tests are in contentstore/tests/test_libraries.py
"""
from contentstore.tests.utils import AjaxEnabledTestClient, parse_json
from contentstore.utils import reverse_course_url, reverse_library_url
from contentstore.views.component import get_compon... |
from __future__ import division, print_function, absolute_import
from math import sqrt, exp, sin, cos
from numpy.testing import (assert_warns, assert_,
assert_allclose,
assert_equal)
from numpy import finfo
from scipy.optimize import zeros as cc
from scipy.optim... |
# -*- coding: utf-8 -*-
"""
This file is part of the Frozen Fields add-on for Anki.
Main Module, hooks add-on methods into Anki.
Copyright: (c) 2012-2015 Tiago Barroso <https://github.com/tmbb>
(c) 2015-2018 Glutanimate <https://glutanimate.com/>
License: GNU AGPLv3 <https://www.gnu.org/licenses/agpl.htm... |
""" Launch interactive function.
This launch strategy will interactively compute each pylada job. This will
block the interpreter.
"""
__docformat__ = "restructuredtext en"
def launch(self, event, jobfolders):
""" Launch jobs interactively.
This call will block until each job is finished in tu... |
from airflow.models import BaseOperator
from airflow.utils import timezone
from airflow.utils.decorators import apply_defaults
from airflow.api.common.experimental.trigger_dag import trigger_dag
import json
class DagRunOrder(object):
def __init__(self, run_id=None, payload=None):
self.run_id = run_id
... |
"""Logging control and utilities.
Control of logging for SA can be performed from the regular python logging
module. The regular dotted module namespace is used, starting at
'sqlalchemy'. For class-level logging, the class name is appended.
The "echo" keyword parameter, available on SQLA :class:`.Engine`
and :class... |
"""
Handles Jingle RTP sessions (XEP 0167)
"""
import socket
import nbxmpp
import gi
from gi.repository import Farstream
gi.require_version('Gst', '1.0')
from gi.repository import Gst
from gi.repository import GLib
from common import gajim
from common.jingle_transport import JingleTransportICEUDP
from common.jingle... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# IMPORTS
# ==============================================================================
class Mapper(object):
"""
"""
_new_mappers = Fals... |
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class WithTagTests(SimpleTestCase):
@setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'})
def test_with01(self):
output = self.engine.render_to_string('with01', {'dict': {'k... |
#!/usr/bin/python
'''
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
import math
import pprint
def withinStdDev(n):
"""Returns the percent of samples within n std deviations of the normal."""
return math.erf(n / math.sqrt(2))
def... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=... |
from pygments.lexer import RegexLexer, bygroups, include, combined, words
from pygments.token import *
import sphinx
class JamLexer(RegexLexer):
name = "Jam"
aliases = ["jam"]
filenames = ["*.jm"]
INTEGER_REGEX = r"[0-9]([0-9_]*[0-9])?"
tokens = {
'root': [
(r"#.*?$", Comment)... |
"""
===========
N2H+ fitter
===========
Reference for line params:
Dore (Private Communication), improving on the determinations from
L. Pagani, F. Daniel, and M. L. Dubernet A&A 494, 719-727 (2009)
DOI: 10.1051/0004-6361:200810570
http://www.strw.leidenuniv.nl/~moldata/N2H+.html
http://adsabs.harvard.edu/abs/2005M... |
"""distutils.errors
Provides exceptions used by the Distutils modules. Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).
This module is safe to use in "from ... import *" mode; it... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... |
"""
This file has functions about generating bounding box regression targets
"""
import numpy as np
from ..logger import logger
from bbox_transform import bbox_overlaps, bbox_transform
from rcnn.config import config
def compute_bbox_regression_targets(rois, overlaps, labels):
"""
given rois, overlaps, gt la... |
import dragonfly
import dragonfly.pandahive
import bee
from bee import connect
import math, functools
from panda3d.core import NodePath
import dragonfly.scene.unbound
import dragonfly.std
import dragonfly.io
import dragonfly.canvas
import Spyder
# ## random matrix generator
from random import random
def random_m... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: aci_access_sub_port_block_to_access_port
short_description: ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: purefb_dsrole
version_added: '2.8'
short_description: Config... |
import json
import os
import re
import subprocess
import sys
class MockInputApi(object):
"""Mock class for the InputApi class.
This class can be used for unittests for presubmit by initializing the files
attribute as the list of changed files.
"""
def __init__(self):
self.json = json
self.re = re
... |
__revision__ = "src/engine/SCons/Memoize.py issue-2856:2676:d23b7a2f45e8 2012/08/05 15:38:28 garyo"
__doc__ = """Memoizer
A metaclass implementation to count hits and misses of the computed
values that various methods cache in memory.
Use of this modules assumes that wrapped methods be coded to cache their
values in... |
"""IntPy support sub-package
This sub-package organizes the code of support for IntPy package.
It was developed in CIn/UFPE (Brazil) by Rafael Menezes Barreto
<<EMAIL>, <EMAIL>> and it's free software.
"""
from intpy.support import rounding
from intpy.support import stdfunc
from intpy.support.general import * |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.