content stringlengths 4 20k |
|---|
import codecs
import sys
from datetime import date
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Sum
from montanha.models import (
Institution, Expense, ExpenseNature, Legislator, Supplier, PerNature,
PerNatureByYear, PerNatureByMonth, PerLeg... |
"""
Web Coverage Server (WCS) methods and metadata. Factory function.
"""
import urllib2
import etree
from coverage import wcs100, wcs110, wcsBase
def WebCoverageService(url, version=None, xml=None, cookies=None, timeout=30):
''' wcs factory function, returns a version specific WebCoverageService object '''
... |
import argparse
from nested_sampling import NestedSampling, MonteCarloWalker, Harmonic, run_nested_sampling, Replica
"""
To run this example a dispatcher and N workers must have been started beforehand
"""
def main():
parser = argparse.ArgumentParser(description="do nested sampling on a p[article in a n-dimension... |
# coding: utf8
from __future__ import unicode_literals
from ...attrs import LIKE_NUM
_num_words = set("""
nul een één twee drie vier vijf zes zeven acht negen tien elf twaalf dertien
veertien twintig dertig veertig vijftig zestig zeventig tachtig negentig honderd
duizend miljoen miljard biljoen biljard triljoen tril... |
import unittest
from telemetry.core import browser_options
from telemetry.core.chrome import desktop_browser_finder
from telemetry.unittest import system_stub
# This file verifies the logic for finding a browser instance on all platforms
# at once. It does so by providing stubs for the OS/sys/subprocess primitives
# ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textwrap import dedent
from pants.backend.codegen.targets.java_ragel_library import JavaRagelLibrary
from pants.backend.codegen.tasks.ragel_gen import ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
import time
from copy import deepcopy
from ansible.module_utils.basic import A... |
import os
import time
import unittest
import test_environment
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import datastore_file_stub
from google.appengine.api import mail_stub
from google.appengine.api import urlfetch_stub
from google.appengine.api import user_service_stub
#from google... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
xpath_text,
parse_duration,
ExtractorError,
)
class EyedoTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?eyedo\.tv/[^/]+/(?:#!/)?Live/Detail/(?P<id>[0-9]+)'
_TEST = {
'ur... |
"""distutils.command.install_lib
Implements the Distutils 'install_lib' command
(install all Python modules)."""
__revision__ = "$Id$"
import os
import sys
from distutils.core import Command
from distutils.errors import DistutilsOptionError
# Extension for Python source files.
if hasattr(os, 'extsep'):
PYTHON... |
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint, cstr, filter_strip_join
from webnotes.webutils import WebsiteGenerator, clear_cache
class DocType(WebsiteGenerator):
def __init__(self, doc, doclist=None):
self.doc = doc
self.doclist = doclist
def validate(self):
if self... |
#!/usr/bin/python
from gi.repository import Gtk
import subprocess
class LauncherWindow(Gtk.Window):
"""
FreeRDP launcher window.
"""
def __init__(self):
"""
Initialize the window and widgets
"""
Gtk.Window.__init__(self, title="Python FreeRDP Launcher")
tabl... |
"""
Character attribute manipulation API.
This module provides a domain-specific language (using Python syntax)
for the creation of text with additional display attributes associated
with it. It is intended as an alternative to manually building up
strings containing ECMA 48 character attribute control codes. It
cur... |
from openerp import models, fields
class fetchmail_server(models.Model):
_inherit = 'fetchmail.server'
error_notice_template_id = fields.Many2one(
'email.template', string="Error notice template",
help="Set here the template to use to send notice to sender when "
"errors occur wh... |
"""Module/script to byte-compile all .py files to .pyc (or .pyo) files.
When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.
Without arguments, if compiles all modules on sys.path, without
recursing into subdir... |
from __future__ import unicode_literals
import getopt
class InvalidOptionArgument(Exception):
def __init__(self, msg):
super(InvalidOptionArgument, self).__init__(msg)
self.msg = msg
def __find_arg_in_options__(arg, options):
for opt in options:
if opt[0].find(arg) == 0:
return opt
return None
def __fin... |
from __future__ import unicode_literals
from .fragment import FragmentFD
from ..compat import compat_urllib_error
from ..utils import urljoin
class DashSegmentsFD(FragmentFD):
"""
Download segments in a DASH manifest
"""
FD_NAME = 'dashsegments'
def real_download(self, filename, info_dict):
... |
import hashlib
import json
import logging
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import csrf_exempt
from foldit.models import Score, PuzzleComplete
from student.models import... |
"""FunMC utilities implemented via JAX."""
import functools
import jax
from jax import lax
from jax import random
from jax import tree_util
from jax.experimental import stax
import jax.numpy as jnp
__all__ = [
'assert_same_shallow_tree',
'block_until_ready',
'flatten_tree',
'get_shallow_tree',
'i... |
from oslo.config import cfg
from st2common import transport
from st2common.models.db.trigger import triggertype_access, trigger_access, triggerinstance_access
from st2common.persistence.base import (Access, ContentPackResource)
class TriggerType(ContentPackResource):
impl = triggertype_access
@classmethod
... |
"""Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... |
"""website.files.models.ext is home to subclasses of FileNode that provide
additional functionality and have no place in website.files.models.base
"""
import os
from website.files.models.base import FileNode
class PathFollowingFileNode(FileNode):
"""A helper class that will attempt to track the its file
thro... |
'''Abstract DIIS code used by the different DIIS implementations'''
import numpy as np
from horton.log import log, timer
from horton.exceptions import NoSCFConvergence
from horton.meanfield.utils import compute_commutator, check_dm
from horton.meanfield.convergence import convergence_error_commutator
__all__ = []
... |
import sys,struct,zlib,os
import binascii
from optparse import OptionParser
from intelhex import IntelHex
DEFAULT_DEVICE="0x0483:0xdf11"
DEFAULT_NAME=b'ST...'
def named(tuple,names):
return dict(list(zip(names.split(),tuple)))
def consume(fmt,data,names):
n = struct.calcsize(fmt)
return named(struct.unpack(fmt,... |
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import pandas as pd
import pandas._libs.lib as lib
import pandas.util.testing as tm
class TestMisc(object):
def test_max_len_string_array(self):
arr = a = np.array(['foo', 'b', np.nan], dtype='object')
assert lib.max_len_string_array(arr... |
"""Test the test support."""
from __future__ import absolute_import
import filecmp
import re
from os.path import join, isdir
from tests.lib import SRC_DIR
def test_tmp_dir_exists_in_env(script):
"""
Test that $TMPDIR == env.temp_path and path exists and env.assert_no_temp()
passes (in fast env)
"""
... |
# -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib... |
"""
.. module:: Smoothing
Smoothing
*************
:Description: Smoothing
:Authors: bejar
:Version:
:Created on: 21/07/2016 8:14
"""
__author__ = 'bejar'
from scipy.sparse.linalg import spsolve
import numpy as np
import scipy as scp
from scipy import sparse
from scipy.sparse import linalg
def num... |
import re
from libcloud.common.base import ConnectionUserAndKey
from libcloud.common.base import Response
from libcloud.common.types import ProviderError
OK_CODES = ['200', '211', '212', '213']
ERROR_CODES = ['401', '403', '405', '406', '407', '408', '409', '410', '411',
'412', '413', '414', '450', '4... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
EXAMPLES = r'''
- name: Task to boot a system using an ISO from an HP iLO interface only if the system is an HP server
hpilo_boot:
host: YOUR_ILO_ADDRESS
login: YOUR_ILO... |
import logging
from openerp.osv import fields, osv
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
class sale_configuration(osv.TransientModel):
_inherit = 'sale.config.settings'
_columns = {
'group_invoice_so_lines': fields.boolean('Generate invoices based on the sales ... |
import numpy as np
from scipy.optimize import anneal, brute
def get_thresh_from_rate(n, dt=0.02, expected_rate=0.33, tmin=0.001, tmax=0.2,
tstep=1E-2):
n = np.atleast_2d(n)
nc, nt = n.shape
expected_nspikes = expected_rate * nc * nt * dt
def loss(thresh, n, expected_nspikes... |
import os
import subprocess
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.port.base import Port
from webkitpy.port.pulseaudio_sanitizer import PulseAudioSanitizer
from webkitpy.port.xvfbdriver import XvfbDriver
class GtkPort(Port):
port_name = "gtk"
def __init__... |
#-*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
import logging
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.encoding import force_text
from twilio.rest import TwilioRestClient
from .models import OutgoingSMS
logger = log... |
"""summarize and compare the component sizes in installed-files.txt."""
import sys
bin_size1 = {}
bin_size2 = {}
bin_sizes = [bin_size1, bin_size2]
file_sizes = {}
def PrintUsage():
print "usage: " + sys.argv[0] + " filename [filename2]"
print ""
print " Input file is installed-files.txt from the build outpu... |
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import struct
import zlib
import numpy as np
import h5py
import math
import cooler
import pandas as pd
from collections import OrderedDict
version = 'dummy'
NORMS = ['VC', 'VC_SQRT', 'KR']
#read function
def readcstr(f):
... |
def main(request, response):
import simplejson as json
f = file('config.json')
source = f.read()
s = json.JSONDecoder().decode(source)
url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1])
url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0])
response.headers.set("Content... |
from Stack import Stack
import Types
import unittest
from Parser.ParserContext import ParserContext
from MethodDefinition import MethodDefinition
from Parser.MethodParser import MethodParser
from Method import Method
from Instructions.Ret import Ret
from Variable import Variable
class DebugHooks:
PreMethod, PostMe... |
from openerp.tools.translate import _
from openerp.osv import fields, osv
from openerp import pooler
class report_webkit_actions(osv.osv_memory):
_name = "report.webkit.actions"
_description = "Webkit Actions"
_columns = {
'print_button':fields.boolean('Add print button', help="Check this to add a P... |
from django.contrib.postgres.fields import ArrayField
from django.utils import timezone
from django.db import models
from osf.utils.fields import NonNaiveDateTimeField
from website import settings
from osf.models.base import BaseModel, ObjectIDMixin
from osf.utils.datetime_aware_jsonfield import DateTimeAwareJSONField... |
# -*- coding: utf-8 -*-
import unittest
from picard.util import parse_amazon_url
class ParseAmazonUrlTest(unittest.TestCase):
def test_1(self):
url = 'http://www.amazon.com/dp/020530902X'
expected = {'asin': '020530902X', 'host': 'amazon.com'}
r = parse_amazon_url(url)
self.asser... |
Latin2_HungarianCharToOrderMap = (
255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # ... |
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.admin.utils import unquote
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (
AdminPass... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class LinkedServicesOperations(object):
"""LinkedServicesOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
... |
import controllers
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
# local storage in browser
import sys
from javascript import JSObject
from browser import window, console
has_local_storage = hasattr(window, 'localStorage')
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not has_local_storage... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... |
import numpy as np
from exceptions import NotImplementedError, KeyError
class _Residual:
def __init__(self):
self.res = []
def __call__(self, rk):
self.res.append(rk)
def itercount(self):
return len(self.res)
def clear(self):
... |
from openerp.addons.portal_project.tests.test_access_rights import TestPortalProjectBase
from openerp.exceptions import AccessError
from openerp.osv.orm import except_orm
from openerp.tools import mute_logger
class TestPortalProjectBase(TestPortalProjectBase):
def setUp(self):
super(TestPortalProjectBase... |
from openerp import models, fields, api, _
from openerp.tools.float_utils import float_round
class AccountMoveLineReconcile(models.TransientModel):
"""
Account move line reconcile wizard, it checks for the write off the reconcile entry or directly reconcile.
"""
_name = 'account.move.line.reconcile'
... |
import time
from openerp.osv import fields
from openerp.osv import osv
from openerp.tools.translate import _
from openerp import SUPERUSER_ID
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare
class StockMove(osv.osv):
_inherit = 'stock.move'
_columns = {
'production_id': fields.... |
"""
Django database routers are described here:
https://docs.djangoproject.com/en/dev/topics/db/multi-db/#using-routers
"""
class DefaultRouter(object):
def db_for_read(self, model, **hints):
"""
Reads from nodeshot2 db
"""
if model._meta.app_label != 'oldimporter':
ret... |
"""
Verifies that a project hierarchy created with the --generator-output=
option can be built even when it's relocated to a different path.
"""
import TestGyp
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])
test.writable(test.workpath('src'), False)
test.run_gyp('prog1.gy... |
from sqlalchemy import (
# BigInteger,
Column,
ForeignKey,
Integer,
Text,
UniqueConstraint,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import (
scoped_session,
sessionmaker,
# relationship,
)
from zope.sqlalchemy import ZopeTransactionExt... |
"""Main entry point for the NaCl SDK buildbot.
The entry point used to be build_sdk.py itself, but we want
to be able to simplify build_sdk (for example separating out
the test code into test_sdk) and change its default behaviour
while being able to separately control excactly what the bots
run.
"""
import buildbot_c... |
import unittest
from peacock.utils.FileCache import FileCache
from peacock.utils import Testing
from PyQt5 import QtWidgets
class Tests(Testing.PeacockTester):
qapp = QtWidgets.QApplication([])
def checkFileCache(self, fc, dirty=True, val={}, path_data={}):
self.assertEqual(fc.dirty, dirty)
se... |
# config
port = "COM3"
# Code to be able to use this script with virtalArduino
if ('virtual' in globals() and virtual):
virtualArduino = Runtime.start("virtualArduino", "VirtualArduino")
virtualArduino.connect(port)
#
# Initiate the Arduino
arduino = Runtime.start("Arduino","Arduino")
arduino.connect(port)
# A... |
"""Tests for overprint/knockout.
This has been placed in a separate file so output can be passed to printers
"""
__version__='''$Id: test_pdfgen_overprint.py 3757 2010-08-19 12:08:11Z damian $'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import uni... |
import contextlib
import datetime
import logging
import os
import sqlite3
import threading
from typing import ( # NOQA
Dict,
Iterator,
Optional,
)
import brokkoly.resource
logger = logging.getLogger(__name__)
class ThreadLocalDBConnectionManager:
_connections = {} # type: Dict[int, sqlite3.Connec... |
from enigma import RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, eTimer, gFont
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap
from Components.ScrollLabel import ScrollLabel
from Components.GUIComponent import GUIComponent
... |
from __future__ import unicode_literals
import copy
from django.conf import settings
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.core.exceptions import FieldError
from django.db import models, DEFAULT_DB_ALIAS
from django.db... |
import psycopg2
from flask import Blueprint, current_app, render_template, request, session, redirect, url_for
events_app = Blueprint('events_app', __name__)
@events_app.route('/show_events')
def show_events():
if session.get('logged_in')== None:
return redirect(url_for("loginpage"))
with psycopg2.co... |
"""
Templating for ops docstrings
"""
from typing import Dict, Optional
def _make_flex_doc(op_name, typ):
"""
Make the appropriate substitutions for the given operation and class-typ
into either _flex_doc_SERIES or _flex_doc_FRAME to return the docstring
to attach to a generated method.
Parameter... |
# -*- coding: utf-8 -*-
"""
werkzeug.testsuite.urls
~~~~~~~~~~~~~~~~~~~~~~~
URL helper tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from StringIO import StringIO
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.data... |
from __future__ import absolute_import, unicode_literals
import logging
import os
import stat
import string
import threading
import urllib
import urlparse
from mopidy import compat, exceptions
from mopidy.compat import queue
from mopidy.internal import encoding, xdg
logger = logging.getLogger(__name__)
XDG_DIRS =... |
"""
discovery service module
mostly just a place to keep all the information regarding discovery, and export
it to xml
Author: Henrik Thostrup Jensen <htj _at_ nordu.net>
Copyright: NORDUnet (2014)
"""
from xml.etree import ElementTree as ET
from opennsa import constants as cnt
from opennsa.shared import xmlhelper,... |
"""
Base exception handling.
"""
_FATAL_EXCEPTION_FORMAT_ERRORS = False
class SupervisorException(Exception):
"""Base RDB Exception.
To correctly use this class, inherit from it and define
a 'message' property. That message will get printf'd
with the keyword arguments provided to the constructor.
... |
"""CPU profiler that works by sampling the call stack periodically.
This profiler provides a very simplistic view of where your request is spending
its time. It does this by periodically sampling your request's call stack to
figure out in which functions real time is being spent.
PRO: since the profiler only samples ... |
from __future__ import unicode_literals
from copy import deepcopy
from django.views.generic import ListView, FormView
from django.core.urlresolvers import reverse
from django.http import Http404
from framework.auth.core import get_user
from website.conferences.model import Conference, DEFAULT_FIELD_NAMES
from website... |
import os
import sys
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "django-storymarket",
version = "1.0a3",
description = "Sync Django models to Storymarket.",
long_description = read('README.rst'),... |
from __future__ import unicode_literals
"""assign/unassign to ToDo"""
import frappe
from frappe import _
from frappe.desk.form.load import get_docinfo
def get(args=None):
"""get assigned to"""
if not args:
args = frappe.local.form_dict
get_docinfo(frappe.get_doc(args.get("doctype"), args.get("name")))
return ... |
from pycsw.core import util
from pycsw.core.etree import etree
#NAMESPACE = 'http://www.fgdc.gov/metadata/csdgm'
NAMESPACE = 'http://www.opengis.net/cat/csw/csdgm'
NAMESPACES = {'fgdc': NAMESPACE}
XPATH_MAPPINGS = {
'pycsw:Identifier': 'idinfo/datasetid',
'pycsw:Title': 'idinfo/citation/citeinfo/title',
'... |
from test_framework import BitcoinTestFramework
from util import *
from pprint import pprint
from time import sleep
# Create one-input, one-output, no-fee transaction:
class RawTransactionsTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
... |
from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import models
class CustomUserNonUniqueUsername(AbstractBaseUser):
"""
A user with a non-unique username.
This model is not invalid if it is used with a custom authentication
backend which supports non-unique username... |
import os, shutil
org_dataset_dir = '/home/han/code/data/dogsvscats'
org_dataset_train_dir = os.path.join(org_dataset_dir, 'train')
base_dir = os.path.join(org_dataset_dir, 'small')
# os.mkdir(base_dir)
train_dir = os.path.join(base_dir, 'train')
val_dir = os.path.join(base_dir, 'validation')
test_dir = os.path.joi... |
# Test Case TF-IDF Stat Package
# Department of Computer Science at Harbin Engineering University
# This is the test case feature vector extraction script
#------------------------------------------------------------------
#------------------------------------------------------------------
# Import part , should... |
"""Public API functions for the event system.
"""
from __future__ import absolute_import
from .. import util, exc
from .base import _registrars
from .registry import _EventKey
CANCEL = util.symbol('CANCEL')
NO_RETVAL = util.symbol('NO_RETVAL')
def _event_key(target, identifier, fn):
for evt_cls in _registrars[... |
from flask_user import UserMixin
from flask_user.forms import RegisterForm
from flask_wtf import Form
from wtforms import StringField, SubmitField, validators
from app import db
# Define the User data model. Make sure to add the flask_user.UserMixin !!
class User(db.Model, UserMixin):
__tablename__ = 'users'
... |
from distutils import log, dir_util
import os, sys
from setuptools.extern.six.moves import map
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install ... |
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.http import HttpResponseBadRequest
from django.shortcuts import get_object_or_404, render_to_response
from django.views.generic import ListView, View
from django.core.urlresolvers import reve... |
"""RBAC Role based parametrization and checking
The purpose of this fixture is to allow tests to be run within the context of multiple different
users, without the hastle or modifying the test. To this end, the RBAC module and fixture do not
require any modifications to the test body.
The RBAC fixture starts by recei... |
__revision__ = "$Id$"
## Description: function Send_SRV_Mail
## This function sends an email confirming the revision
## has been carried on with success
## Author: T.Baron
## PARAMETERS: addressesSRV: list of addresses to send this email to.
## c... |
"""ORCID utils."""
from __future__ import absolute_import, division, print_function
import hashlib
import re
from itertools import chain
from elasticsearch_dsl import Q
from flask import current_app
from six.moves.urllib.parse import urljoin
from StringIO import StringIO
from sqlalchemy import type_coerce
from sqlal... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class SignRawTransactionsTest(BitcoinTestFramework):
"""Tests transaction signing via RPC command "signrawtransaction"."""
def setup_chain(self):
print('Initializing test directory ' + self.options.tmpdir... |
"""Contains the data classes of the Yahoo! Media RSS Extension"""
__author__ = '<EMAIL> (Jeff Scudder)'
import atom.core
MEDIA_TEMPLATE = '{http://search.yahoo.com/mrss//}%s'
class MediaCategory(atom.core.XmlElement):
"""Describes a media category."""
_qname = MEDIA_TEMPLATE % 'category'
scheme = 'scheme'... |
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
from operator import itemgetter
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
# ---------------------------------------------------------
# Account Finan... |
#!/usr/bin/env python
import sys
import os
import re
from collections import defaultdict
from math import floor
from math import isnan
root_dir = sys.argv[1]
prefix = sys.argv[2]
do_iso = sys.argv[3]
method2stats = defaultdict(list)
fileCount = 0;
for f in os.listdir(root_dir):
fp = root_dir+"/"+f
if os.pat... |
"""Create threads to run multiple enqueue ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.python.training.queue_runner_impl import *
# pylint: enable=wildcard-import
from tenso... |
import json
import logging
import sys
from passivetotal.common.utilities import is_ip
log = logging.getLogger('passivetotal')
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setForma... |
# coding: utf-8
from django import template
from django.utils.encoding import smart_unicode
from django.utils.safestring import mark_safe
register = template.Library()
@register.inclusion_tag('filebrowser/include/_response.html', takes_context=True)
def query_string(context, add=None, remove=None):
"""
Allow... |
import pkg_resources
import pkgutil
from numina.drps.drpsystem import DrpSystem
from numina.core.pipeline import InstrumentDRP, Pipeline
def assert_valid_instrument(instrument):
assert isinstance(instrument, InstrumentDRP)
pipes = instrument.pipelines
assert 'default' in pipes
for k, v in pipes.item... |
import json
import logging
import os
import sys
import tempfile
import time
import unittest
import test_env_bot_code
test_env_bot_code.setup_test_env()
# third_party/
from depot_tools import auto_stub
from depot_tools import fix_encoding
import requests
import bot_auth
import remote_client
from utils import file_pat... |
import re
import json
import urllib, urllib2
from datetime import datetime
"""
All schemes have one ConceptScheme description. It contains a
mixture of general and per version meta data about a scheme. This
set of routines will print out these details about the schemes
in a Simple Knowledge Service's Triple Store... |
from evelink import api
class EVE(object):
"""Wrapper around /eve/ of the EVE API."""
@api.auto_api
def __init__(self, api=None):
self.api = api
@api.auto_call('eve/CharacterName', map_params={'id_list': 'IDs'})
def character_names_from_ids(self, id_list, api_result=None):
"""Retr... |
#!/usr/bin/python
"""
create Autosupport module to enable, disable or modify
"""
# (c) 2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ver... |
"""
Utility functions based on igakit.
"""
from __future__ import absolute_import
import numpy as nm
from sfepy.base.base import Struct
from sfepy.discrete.fem import Mesh
from sfepy.mesh.mesh_generators import get_tensor_product_conn
import six
from six.moves import range
def create_linear_fe_mesh(nurbs, pars=None):... |
from useful.singleton import Singleton
import urllib.error
import sys
from urllib.parse import quote_plus, quote
try:
str
except NameError:
def _is_unicode(x):
return 0
else:
def _is_unicode(x):
return isinstance(x, str)
HTTP_BEGIN = "http://"
HHTPS_BEGIN = "https://"
TYPE_HTML = 'text/ht... |
import array
import sys
if sys.version > '3':
basestring = str
xrange = range
unicode = str
from abc import ABCMeta
import copy
import numpy as np
import warnings
from py4j.java_gateway import JavaObject
from pyspark import since
from pyspark.ml.linalg import DenseVector, Vector
from pyspark.ml.util impo... |
import gobject
import pygst
pygst.require("0.10")
import gst
from core import Input, INPUT_TYPE_AUDIO
CAPABILITIES = INPUT_TYPE_AUDIO
class ALSAInput(Input):
def __init__(self):
Input.__init__(self, CAPABILITIES)
self.audio_src = gst.element_factory_make("alsasrc", "audio_src")
self.add(s... |
"""Unittest that directly tests the output of the pure-Python protocol
compiler. See //google/protobuf/reflection_test.py for a test which
further ensures that we can use Python protocol message objects as we expect.
"""
__author__ = '<EMAIL> (Will Robinson)'
from google.apputils import basetest
from google.protobuf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.