content stringlengths 4 20k |
|---|
"""
The reference implementation of usage logger using the Python standard logging library.
"""
from inspect import Signature
import logging
from typing import Any, Optional
def get_logger() -> Any:
"""An entry point of the plug-in and return the usage logger."""
return PandasOnSparkUsageLogger()
def _form... |
"""aaainternal plugin."""
import uuid
import gettext
import os
from otopi import constants as otopicons
from otopi import filetransaction, plugin, util
from ovirt_engine_setup import constants as osetupcons
from ovirt_engine_setup.engine import constants as oenginecons
from ovirt_engine_setup.engine_common import c... |
from mercurial.wireproto import localbatch, remotebatch, batchable, future
# equivalent of repo.repository
class thing(object):
def hello(self):
return "Ready."
# equivalent of localrepo.localrepository
class localthing(thing):
def foo(self, one, two=None):
if one:
return "%s and %... |
"""Tests for third_party.tensorflow.contrib.kernel_methods.python.losses."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.kernel_methods.python import losses
from tensorflow.python.framework import constant_op
... |
from django.test import TestCase
class ObjectListTest(TestCase):
fixtures = ['testdata.json']
def check_pagination(self, url, expected_status_code, object_count=None):
response = self.client.get(url)
self.assertEqual(response.status_code, expected_status_code)
if object_count:
... |
#!/usr/bin/python -u
#
# this tests the entities substitutions with the XmlTextReader interface
#
import sys
import libxml2
try:
import StringIO
str_io = StringIO.StringIO
except:
import io
str_io = io.StringIO
schema="""<element name="foo" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeL... |
import httplib2
import argparse
import base64
import csv
import datetime
import random
import sys
import time
import base64
import domoticz
# This script connects Domoticz with Google Cloud PubSub API
# To make it works :
# 1 - Install the Google API Client Python Library : pip install --upgrade google-api-python-clie... |
import io
import StringIO
from PIL import Image
from PIL import ImageOps
from random import random
# ----------------------------------------
# Image resizing
# ----------------------------------------
def image_resize_image(base64_source, size=(1024, 1024), encoding='base64', filetype='PNG', avoid_if_small=False):
... |
from __future__ import absolute_import, division, print_function
# This is a temporary copy of all the CONDITIONAL_NAMES from _cffi_src so
# we can loop over them and delete them at runtime. It will be removed when
# cffi supports #if in cdef
CONDITIONAL_NAMES = {
"Cryptography_HAS_CMAC": [
"CMAC_CTX_new"... |
from __future__ import unicode_literals
# FIXME: monkey patch the track adder to not throw an exception on missing keys
# to test, try adding Tp3e52picsj55ozzmjtxwb5xpwa
import gmusicapi.protocol
@staticmethod
def build_track_add(store_track_info):
import copy
track_dict = copy.deepcopy(store_track_info)
... |
from ctypes import c_void_p
from types import NoneType
from django.contrib.gis.gdal.error import GDALException
class GDALBase(object):
"""
Base object for GDAL objects that has a pointer access property
that controls access to the underlying C pointer.
"""
# Initially the pointer is NULL.
_ptr ... |
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.forms import UserCreationForm
# import re
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class LoginForm(AuthenticationForm):
username = forms.CharField(l... |
from .user import User
import datetime
from pyramid_mongoengine import MongoEngine
import random
db = MongoEngine()
class Song(db.Document):
title = db.StringField(required=True)
url = db.StringField(required=True)
artist= db.StringField()
original_url = db.StringField()
album = db.StringField()
... |
import os
import sys
import urlparse
import subprocess
import shutil
import contextlib
from os import makedirs
from os.path import exists, join, abspath, basename, dirname, islink
import dockerfile
import util
import platforms
__all__ = ['merge', 'generate']
RELDIR = "library"
ESPB_SCRIPT = "https://github.com/ack/... |
import werkzeug.urls
import openerp
import openerp.addons.web.controllers.main as webmain
class EDI(openerp.http.Controller):
@openerp.http.route('/edi/import_url', type='http', auth='none')
def import_url(self, url):
# http://hostname:8069/edi/import_url?url=URIEncodedURL
req = openerp.http.... |
from __future__ import unicode_literals
import frappe
from frappe.utils.make_random import get_random
from erpnext.accounts.doctype.asset.asset import make_purchase_invoice, make_sales_invoice
from erpnext.accounts.doctype.asset.depreciation import post_depreciation_entries, scrap_asset
def work():
frappe.set_user(f... |
from __future__ import print_function
import numpy as np
import sys
from theano.compat.six.moves import xrange
from theano import function
from theano import tensor as T
from pylearn2.utils import serial
from pylearn2.utils.string_utils import preprocess
def usage():
"""
Run
python make_submission.py <model> <t... |
#!/usr/bin/env python
from __future__ import division
from __future__ import unicode_literals
import sys, math
import argparse
from volk_test_funcs import (create_connection, list_tables, get_results,
helper, timeit, format_results)
try:
import matplotlib
import matplotlib.pyplot ... |
from lib.util.mysqlBaseTestCase import mysqlBaseTestCase
server_requirements = [[]]
servers = []
server_manager = None
test_executor = None
class basicTest(mysqlBaseTestCase):
def test_selectStabilityValidator1(self):
test_cmd = "./gentest.pl --gendata=conf/drizzle/drizzle.zz --grammar=conf/drizzle/subqu... |
"""DNS nodes. A node is a set of rdatasets."""
import StringIO
import dns.rdataset
import dns.rdatatype
import dns.renderer
class Node(object):
"""A DNS node.
A node is a set of rdatasets
@ivar rdatasets: the node's rdatasets
@type rdatasets: list of dns.rdataset.Rdataset objects"""
__slo... |
"""Reuters newswire topic classification dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.keras.python.keras.datasets.reuters import get_word_index
from tensorflow.contrib.keras.python.keras.datasets.reuters import load_da... |
import re
import sys
import os
import subprocess
__doc__ = """This module generates a DEF file from the symbols in
an MSVC-compiled DLL import library. It correctly discriminates between
data and functions. The data is collected from the output of the program
nm(1).
Usage:
python lib2def.py [libname.lib] [outpu... |
"""Execute Ansible sanity tests."""
from __future__ import absolute_import, print_function
import abc
import glob
import json
import os
import re
import sys
from lib.util import (
ApplicationError,
SubprocessError,
display,
run_command,
import_plugins,
load_plugins,
parse_to_list_of_dict,
... |
# ===========================================================================
import pangloss
import numpy
from scipy import interpolate,optimize
# ============================================================================
class SHMR(object):
"""
NAME
SHMR
PURPOSE
The stellar mass - h... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class KeekIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<videoID>\w+)'
IE_NAME = 'keek'
_TEST = {
'url': 'https://www.keek.com/ytdl/keeks/NODfbab',
'file': 'NODfbab.mp4... |
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - Wiki Utility Functions
@copyright: 2000 - 2004 by Jürgen Hermann <<EMAIL>>
@license: GNU GPL, see COPYING for details.
"""
import sys
import os
import re
import urllib
import config
import chartypes
# Exceptions
class InvalidFileNameError(Exception):
... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ReadDevice(Choreography):
def __init__(self, temboo_session):
"""
Create a ne... |
import collections
import email.utils
from http import HTTPStatus
import io
import typing
import httpolice
from mitmproxy import ctx
import mitmproxy.flow
import mitmproxy.http
import mitmproxy.net.http
import mitmproxy.types
__version__ = '0.10.0.dev1'
class MitmproxyHTTPolice:
def __init__(self):
se... |
# http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html
# http://appfusedjango.googlecode.com/svn/trunk/tests/xmlrunner.py
"""
XML Test Runner for PyUnit
"""
# Written by Sebastian Rittau <<EMAIL>> and placed in
# the Public Domain. With contributions by Paolo Borelli.
__revision__ = "$Id: /private... |
import os
import sys
import pexpect
import datetime
import time
import thread
import string
import getpass
import socket
import tempfile
import logging
#import zoni
from zoni.data.resourcequerysql import *
from zoni.hardware.hwswitchinterface import HwSwitchInterface
from zoni.data.resourcequerysql import ResourceQuer... |
__all__ = ['Process', 'current_process', 'active_children']
#
# Imports
#
import os
import sys
import signal
import itertools
#
#
#
try:
ORIGINAL_DIR = os.path.abspath(os.getcwd())
except OSError:
ORIGINAL_DIR = None
#
# Public functions
#
def current_process():
'''
Return process object represent... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# kate: space-indent on; indent-width 4; mixedindent off; indent-mode python;
from django import template
from django.urls import get_script_prefix
from django.conf import settings
register = template.Library()
class StaticURLNode(template.Node):
def __init__(self, url):... |
from pyglet.gl import *
class DrawEnv(object):
'''Sets up drawing environment.
My have either or both of a "before" and "after" method.
'''
pass
class DrawBlended(DrawEnv):
'''Sets up texture env for an alpha-blended draw.
'''
def before(self):
glPushAttrib(GL_ENABLE_BIT | GL_CO... |
from rally.task import scenario
from rally.plugins.openstack.scenarios.nova import utils as nova_utils
from rally.plugins.openstack.scenarios.neutron import utils as neutron_utils
from rally.plugins.openstack.scenarios.glance import utils as glance_utils
from rally.task import types
from rally.task import validation
... |
"""
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
try:
from django... |
import sys
import gettext
__trans = gettext.translation('pisi', fallback=True)
_ = __trans.ugettext
import pisi
import pisi.context as ctx
import pisi.atomicoperations as atomicoperations
import pisi.pgraph as pgraph
import pisi.util as util
import pisi.ui as ui
import pisi.db
def remove(A, ignore_dep = False, ignor... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.parsing.mod_args import ModuleArgsParser
from ansible.errors import AnsibleParserError
from ansible.compat.tests import unittest
class TestModArgsDwim(unittest.TestCase):
# TODO: add tests that construct ModuleA... |
import prodlot_wizard |
"""
*********************
*********************
*********************
This code has not been tested with a BublCam.
The BublOscClient.js client is the only documentation I can find for the
custom commands.
*********************
*********************
*********************
"""
"""
Extensions to the Open Spherical Camer... |
r"""Fixer for unicode.
* Changes unicode to str and unichr to chr.
* If "...\u..." is not unicode literal change it into "...\\u...".
* Change u"..." into "...".
"""
from ..pgen2 import token
from .. import fixer_base
_mapping = {u"unichr" : u"chr", u"unicode" : u"str"}
class FixUnicode(fixer_base.BaseFix):
... |
"""Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... |
from __future__ import print_function
import os, tempfile
from argparse import ArgumentParser, REMAINDER
from os.path import exists, expanduser, join, isdir, isfile, realpath, dirname, abspath
# Temporary imports and (re)definitions while porting mx from Python 2 to Python 3
import sys
if sys.version_info[0] < 3:
... |
"""Pre-trained ImageNet networks."""
import sys
from typing import Any, Callable, Dict, NamedTuple, Optional, Tuple
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as tf_slim
# pylint: disable=unused-import
# Workaround of missing slim's import
# see https://github.com/tensorflow/tensorflow/... |
# -*- coding: utf-8 -*-
"""
thriftpy.parser
~~~~~~~~~~~~~~~
Thrift parser using ply
"""
from __future__ import absolute_import
import os
import sys
from .parser import parse, parse_fp
def load(path, module_name=None, include_dirs=None, include_dir=None):
"""Load thrift file as a module.
The ... |
# -*- coding: utf-8 -*-
"""Util funtions for XBMC server settings."""
from maraschino.tools import using_auth, get_setting_value
from maraschino.models import Module, Setting, XbmcServer
def server_settings():
"""Get settings for active XBMC server instance"""
# query all configured XBMC servers from the db
... |
"""Tests for Keras loss functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import numpy as np
from tensorflow.python import keras
from tensorflow.python.framework import constant_op
from tensorflow.python.framework impor... |
# -*- coding: utf-8 -*-
"""Panel data analysis for short T and large N
Created on Sat Dec 17 19:32:00 2011
Author: Josef Perktold
License: BSD-3
starting from scratch before looking at references again
just a stub to get the basic structure for group handling
target outsource as much as possible for reuse
Notes
--... |
from Cython.TestUtils import CythonTest
class TestCodeWriter(CythonTest):
# CythonTest uses the CodeWriter heavily, so do some checking by
# roundtripping Cython code through the test framework.
# Note that this test is dependant upon the normal Cython parser
# to generate the input trees to the CodeW... |
#from OpenGL.GL import GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW, glFlush
from OpenGL.GL import *
from OpenGL.GLU import *
import pyopencl as cl
import sys
import numpy
import timing
timings = timing.Timing()
class Part2(object):
def __init__(self, num, dt, *args, **kwargs):
self.clinit()
self.loadProgra... |
from mercurial.i18n import _
import common, server
import errno, os, socket, struct
class QueryFailed(Exception):
pass
def start_server(function):
"""
Decorator.
Tries to call function, if it fails, try to (re)start inotify server.
Raise QueryFailed if something went wrong
"""
def decorate... |
#!/usr/bin/env python
'''
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <<EMAIL>>
PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
PURPOSE WITH OR WITHOUT F... |
from __future__ import print_function
import argparse
import time
import yaml
import json
import os
import requests
parser = argparse.ArgumentParser('telegram-client')
parser.add_argument('--config-file', '-f', default='~/.telegram/client.yaml', help='config file location (default ~/.telegram/client.yaml)')
parser.ad... |
from __future__ import absolute_import
import logging
import operator
import os
import tempfile
import shutil
import warnings
try:
import wheel
except ImportError:
wheel = None
from pip.req import RequirementSet
from pip.basecommand import RequirementCommand
from pip.locations import virtualenv_no_global, dis... |
"""HTTP library functions.
This module contains functions for building an HTTP application
framework: any one, not just one whose name starts with "Ch". ;) If you
reference any modules from some popular framework inside *this* module,
FuManChu will personally hang you up by your thumbs and submit you
to a public canin... |
import logging
import pytest
from plenum.test.helper import checkViewNoForNodes, waitForViewChange, sdk_send_random_and_check
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.node_request.helper import sdk_ensure_pool_functional
from plenum.test.pool_transactions.helper imp... |
"""
envelopes.conn
==============
This module contains SMTP connection wrapper.
"""
import smtplib
import socket
TimeoutException = socket.timeout
__all__ = ['SMTP', 'GMailSMTP', 'SendGridSMTP', 'MailcatcherSMTP',
'TimeoutException']
class SMTP(object):
"""Wrapper around :py:class:`smtplib.SMTP` cl... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.gce import gce_connect
try:
import libcloud
from libcloud.compute.types import Provider
... |
from django.core.urlresolvers import reverse # noqa
from django import http
from mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.api import cinder
from openstack_dashboard.api import keystone
from openstack_dashboard.test import helpers as test
class VolumeTests(test.BaseAdminVie... |
"""Manage multi codes
Revision ID: 14e13cf7a042
Revises: 29fc422c56cb
Create Date: 2015-05-07 15:31:55.271785
"""
# revision identifiers, used by Alembic.
revision = '14e13cf7a042'
down_revision = '12660cd87568'
from alembic import op
import sqlalchemy as sa
map_merge = []
map_merge.append({"table_name": "network"... |
"""Produce a table showing the translation status of each app by language.
@author Ellen Spertus (<EMAIL>)
"""
import argparse
import os
from common import read_json_file
# Bogus language name representing all messages defined.
TOTAL = 'qqq'
# List of key prefixes, which are app names, except for 'Apps', which
# ha... |
from django.conf import settings
from django.core.cache.backends.base import DEFAULT_TIMEOUT
from django_redis import get_redis_connection
from django_redis.client import DefaultClient
from redis_key_tagging.client import RedisKeyTagging
class EruditCacheClient(DefaultClient):
def set(
self,
key,... |
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... |
import pytest
from flask import url_for
from har import app, db
from har.model import user
@pytest.fixture
def setup():
app.config['TESTING'] = True
app.config['SECRET_KEY'] = 'secretkey'
db.create_all()
yield
db.drop_all()
@pytest.fixture
def create_user():
user_id = user.create_user('email... |
#!/usr/bin/env python
'''Collection of the shared exceptions used in testing'''
class TestingFrameworkException(Exception):
'''Generic exception for this testing framework, mostly a base class for others'''
_message = 'A generic testing framework error occured'
detail = None
debugInfo = None
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
EXAMPLES = r"""
tasks:
- name: run show sys software on remote devices
voss_command:
... |
# -*- coding: utf-8 -*-
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
from flask.ext.login import LoginManager
from flask.ext.pagedown import PageDown
bootstrap... |
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from operator import or_
from sentry.models import (
ApiKey, AuditLogEntry, AuditLogEntryEvent, OrganizationMemberType
)
from sentry.web.frontend.base import OrganizationView
DEFAULT_S... |
import copy
from sahara import context
from sahara.db.templates import utils
from sahara.tests.unit.conductor import base
from sahara.tests.unit.db.templates import common as c
class FakeNGT(object):
def __init__(self, id):
self.node_group_template_id = id
class FakeCluster(object):
def __init__(se... |
import os
import unittest
from vsg.rules import process
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_023_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDir, '... |
from __future__ import absolute_import, print_function
import parser
import sys
import warnings
import copy
import numpy
from . import ast_tools
from . import slice_handler
from . import size_check
from . import converters
from . import inline_tools
from .inline_tools import attempt_function_call
function_catalog = ... |
from common_fixtures import * # NOQA
quay_creds = {}
quay_creds["email"] = os.environ.get('QUAY_EMAIL')
quay_creds["username"] = os.environ.get('QUAY_USERNAME')
quay_creds["password"] = os.environ.get('QUAY_PASSWORD')
quay_creds["image"] = os.environ.get('QUAY_IMAGE')
quay_creds["serverAddress"] = "quay.io"
quay_cred... |
#!/usr/bin/python
#coding: utf-8
import numpy as np
def softmax_loss_native(W,X,y,reg):
dW = np.zeros_like(W)
dW_each = np.zeros_like(W)
num_train = X.shape[0]
num_label = W.shape[1]
f = X.dot(W)
f_max = np.reshape(np.max(f, axis=1),(num_train,1))
# or f_max = np.max(f, axis=1, keepdi... |
"""
Self-updating from GitHub
.. versionadded:: 1.9
.. note::
This module is not intended to be used directly. Automatic updates
are controlled by the ``update_settings`` :class:`dict` passed to
:class:`~workflow.workflow.Workflow` objects.
"""
from __future__ import print_function, unicode_literals
impo... |
#!/usr/bin/env python
import bisect
class OrderedDict(object):
def __init__(self, dictionary=None):
self.__keys = []
self.__dict = {}
if dictionary is not None:
if isinstance(dictionary, OrderedDict):
self.__dict = dictionary.__dict.copy()
self._... |
"""
Hmmer classes
"""
import data
import logging
import re
import string
from cgi import escape
from galaxy.datatypes.metadata import MetadataElement
from galaxy.datatypes import metadata
import galaxy.model
from galaxy import util
from sniff import *
log = logging.getLogger(__name__)
class Hmm( data.Text ):
"""... |
"""
Views to support the edX Notes feature.
"""
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import Http404
from edxmako.shortcuts import render_to_response
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from courseware.courses import get_c... |
#!/usr/bin/env python
import os, signal, time, re
import unittest
import psutil
from subprocess import PIPE
class GpsshTestCase(unittest.TestCase):
# return count of stranded ssh processes
def searchForProcessOrChildren(self):
euid = os.getuid()
count = 0
for p in psutil.process_it... |
from rally.benchmark.scenarios import base
from rally.benchmark import utils as bench_utils
class CeilometerScenario(base.Scenario):
"""Base class for Ceilometer scenarios with basic atomic actions."""
RESOURCE_NAME_PREFIX = "rally_ceilometer_"
def _get_alarm_dict(self, **kwargs):
"""Prepare and... |
import PIL, PIL.Image
import pyagg
def resample(raster, width=None, height=None, cellwidth=None, cellheight=None):
raster = raster.copy()
del raster._cached_mask # so that mask can be recreated for changed raster
print "copied",raster.bbox
if width and height:
# calculate new cell dimensions... |
#
# test_codecmaps_kr.py
# Codec mapping tests for ROK encodings
#
from test import support
from test import multibytecodec_support
import unittest
class TestCP949Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp949'
mapfileurl = 'http://www.unicode.org/Publi... |
import os
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova import utils
from nova.volume.encryptors import base
LOG = logging.getLogger(__name__)
class CryptsetupEncryptor(base.VolumeEncryptor):
"""A VolumeEncryptor based on dm-crypt.
This VolumeE... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('Crawler', '0001_initial'),
('auth', '0006_require_contenttypes_0002'),
migrations.swappable_... |
import os
from fontbakery.checkrunner import Section, PASS, FAIL, WARN, ERROR, INFO, SKIP
from fontbakery.callable import condition, check, disable
from fontbakery.constants import PriorityLevel
from fontbakery.message import Message
from fontbakery.fonts_profile import profile_factory
from fontbakery.profiles.univers... |
from webkitpy.common.net.bugzilla import Attachment
from webkitpy.tool.steps.abstractstep import AbstractStep
class PostDiffForRevert(AbstractStep):
def run(self, state):
comment_text = "Any committer can land this patch automatically by \
marking it commit-queue+. The commit-queue will build and test \
... |
import bpy
import sys
from mathutils import Matrix, Vector, Euler, Quaternion
from collections import namedtuple
# http://www.blender.org/forum/viewtopic.php?t=19102&highlight=batch+render
# blender -b data/mech.blend --python blenderexp.py -- extra args
print("Argv:", sys.argv)
def pm(mat):
print("Matrix(%6.2f ... |
#!/usr/bin/python
import sys, argparse, re, os
from SequenceBasics import read_fasta_into_hash, encode_name
from GenePredBasics import GenePredEntry as GPD
from subprocess import Popen, PIPE
from StatisticsBasics import average, median
from multiprocessing import cpu_count
import gzip
null = open(os.devnull,'w')
def ... |
"""Self-test suite for Crypto.Cipher.Blowfish"""
__revision__ = "$Id$"
from Crypto.Util.py3compat import *
# This is a list of (plaintext, ciphertext, key) tuples.
test_data = [
# Test vectors from http://www.schneier.com/code/vectors.txt
('0000000000000000', '4ef997456198dd78', '0000000000000000'),
('ff... |
import sys
from StringIO import StringIO
from django.test import TestCase
from django.db import models
from regressiontests.signals_regress.models import Author, Book
signal_output = []
def pre_save_test(signal, sender, instance, **kwargs):
signal_output.append('pre_save signal, %s' % instance)
if kwargs.get... |
#! /usr/bin/env python2.6
# -*- mode: python; coding: utf-8; -*-
import os, sys, shelve, shutil
from os.path import join
# Way to get project root from any script importing this one :-)
PROJROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..'))
BUILDDIR = join(PROJROOT, 'build')
TOOLSDIR ... |
# encoding: 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):
# Changing field 'Query.value'
db.alter_column('twitter_query', 'value', self.gf('django.db.models.fie... |
import datetime
import pathlib
import folium
import bokeh
# from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
from app_ctdprofiles import ctd_profile_plot
class CtdProfilesCore:
""" """
def __init__(self):
""" """
def createMap(self, lat_long_d... |
"""Implementation of :class:`PolynomialRing` class. """
from __future__ import print_function, division
from sympy.polys.domains.ring import Ring
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.polyerrors import CoercionFailed, GeneratorsError
from sympy.utilities import public
@pub... |
from setuptools import setup, find_packages
setup(
name='linaro-django-pagination',
# Magic version handling with versiontools
version=":versiontools:linaro_django_pagination:__version__",
author='Zygmunt Krynicki',
author_email='<EMAIL>',
description="linaro-django-pagination",
long_descr... |
#!/usr/bin/env python
# coding:utf-8
# manning 2015-1-27
import lxml.html
import urlparse
import time
import sys
sys.path.append("..")
from fetch import fetcher
from config.config import *
from node import UrlNode,HtmlNode
def timestamp():
return str(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
def cra... |
"""This example creates a campaign in a given advertiser.
To create an advertiser, run create_advertiser.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication i... |
from openerp.osv import fields, osv
from openerp.tools.sql import drop_view_if_exists
class report_stock_lines_date(osv.osv):
_name = "report.stock.lines.date"
_description = "Dates of Inventories and latest Moves"
_auto = False
_order = "date"
_columns = {
'id': fields.integer('Product Id'... |
"""
Module implementing the AdBlock icon for the main window status bar.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QAction, QMenu
from E5Gui.E5ClickableLabel import E5ClickableLabel
import UI.PixmapCache
class AdBlockIcon(E5ClickableLabel):
"""
Cla... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
# Note, sha1 is the only hash algorithm compatible with python2.4 and with
# FIPS-140 mode (as of 11-2014)
try:
from hashlib import sha1 as sha1
except ImportError:
from sha import sha as sha1
# Backwards compat... |
import agents as ag
def HW2Agent() -> object:
def program(percept):
bump, status = percept
# if program.startTop == 'false' and bump == 'None':
# action = 'Up'
# return action
# if bump == 'None':
# action = 'Up'
# return action
... |
import unittest
import os
from SeleniumLibrary import (SeleniumLibrary, _server_startup_command,
_server_startup_params, FIREFOX_TEMPLATE_ARG, FIREFOX_PROFILE_DIR,
FIREFOX_DEFAULT_PROFILE, SELENIUM_SERVER_PATH)
class TestGetBrowser(unittest.TestCase):
def setUp(self):
self.lib = Selenium... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.