content stringlengths 4 20k |
|---|
"""Test script for the grp module."""
import unittest
from test import test_support
grp = test_support.import_module('grp')
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
# check that a grp tuple has the entries and
# attributes promised by the docs
self.as... |
import time
from cinderclient import exceptions as cinder_exceptions
import testtools
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.openstack.common import log as logging
from tempest.scenario import manager
import tempest.test
LOG = logging.getLogger(__name__)
c... |
from oslo_utils import strutils
import webob
from nova.api.openstack import common
from nova.api.openstack.compute.views import flavors as flavors_view
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.compute import flavors
from nova import exception
from nova.i18n import _
from ... |
from dftestlib import dftest
class testString(dftest.DFTest):
trace_file = "http.cap"
def test_eq_1(self):
dfilter = 'http.request.method == "HEAD"'
self.assertDFilterCount(dfilter, 1)
def test_eq_2(self):
dfilter = 'http.request.method == "POST"'
self.assertDFilterCount(d... |
# From https://github.com/magical/nlzss
# used http://code.google.com/p/u-lzss/source/browse/trunk/js/lib/ulzss.js as
# a guide
from sys import stderr
from collections import defaultdict
from operator import itemgetter
from struct import pack, unpack
class SlidingWindow:
# The size of the sliding window
size... |
from nose.tools import assert_raises
import gevent
import sys
from zerorpc import zmq
import zerorpc
from testutils import teardown, random_ipc_endpoint, TIME_FACTOR
def test_close_server_bufchan():
endpoint = random_ipc_endpoint()
server_events = zerorpc.Events(zmq.ROUTER)
server_events.bind(endpoint)
... |
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF). It generates
5-tuples with these members:
the token type (see token.py)
... |
from yaql.language import specs
from yaql.language import yaqltypes
from murano.dsl import dsl
from murano.dsl import helpers
@dsl.name('io.murano.system.GC')
class GarbageCollector(object):
@staticmethod
@specs.parameter('publisher', dsl.MuranoObjectParameter(decorate=False))
@specs.parameter('subscribe... |
from libsaas import http, parsers
from libsaas.services import base
from . import resource
class ResourceMixin(object):
def create(self, *args, **kwargs):
raise base.MethodNotSupported()
def update(self, *args, **kwargs):
raise base.MethodNotSupported()
def delete(self, *args, **kwargs... |
'''
This module holds the constants used for specifying the states of the debugger.
'''
STATE_RUN = 1
STATE_SUSPEND = 2
PYTHON_SUSPEND = 1
try:
__setFalse = False
except:
import __builtin__
setattr(__builtin__, 'True', 1)
setattr(__builtin__, 'False', 0)
class DebugInfoHolder:
#we have to put it... |
"""Prints paths between gyp targets.
"""
import json
import os
import sys
import time
from collections import deque
def usage():
print """\
Usage:
tools/gyp-explain.py [--dot] chrome_dll# gtest#
"""
def GetPath(graph, fro, to):
"""Given a graph in (node -> list of successor nodes) dictionary format,
yields... |
import imp
from io import StringIO
from pluggdapps.plugin import Plugin, implements
from tayra import BaseTTLPlugin
def __traceback_decorator__( frames ):
from copy import deepcopy
from os.path import basename
def _map2ttl( frame ):
filename = frame.fil... |
import unittest2
from appengine_fixture_loader.loader import load_fixture
from google.appengine.ext import testbed
from google.appengine.ext import ndb
from helpers.match_helper import MatchHelper
from models.event import Event
from models.match import Match
class TestAddSurrogates(unittest2.TestCase):
def setU... |
"""JSON utility functions."""
from collections import deque
import json
import logging
import os
import tempfile
from typing import Any, Callable, Dict, List, Optional, Type, Union
from homeassistant.core import Event, State
from homeassistant.exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name__)... |
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
import glib
import pynotify
import sys
import os
import subprocess
import re
import time
QUERY = "\"Owner=\'Nobody\' AND ( Status=\'new\' OR Status=\'open\' ) AND ( Queue!=\'spambin\' AND Queue!=\'maildrop\' AND Queue!=\'learnspam\' )\""
TIME = 30 # i... |
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compat import python_implementation, string_types
from .util import in_venv
__all__ = ['interpret']
class Evaluator(object):
"""
A limited evaluator for Python expressions.
"... |
#!/usr/bin/env python3
#
# cppcheck addon for naming conventions
# An enhanced version. Configuration is taken from a json file
# It supports to check for type-based prefixes in function or variable names.
#
# Example usage (variable name must start with lowercase, function name must start with uppercase):
# $ cppcheck... |
#!/usr/bin/env python
#
# Generated by generateDS.py.
#
import sys
import extensions2_sup as supermod
etree_ = None
Verbose_import_ = False
( XMLParser_import_none, XMLParser_import_lxml,
XMLParser_import_elementtree
) = range(3)
XMLParser_import_library = None
try:
# lxml
from lxml import etree ... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import time
from ansible.module_utils._text import to_bytes
from ansible.plugins.callback import CallbackBase
try:
from junit_xml import TestSuite, TestCase
HAS_JUNIT_XML = True
except ImportError:
HAS_JUNIT... |
import sys
import re
from subprocess import Popen, PIPE
from xml.etree import ElementTree
def space_to_camelcase(value):
output = ""
first_word_passed = False
for word in value.split(" "):
if not word:
output += "_"
continue
if first_word_passed:
output ... |
"""
"""
import codecs
import re
import pandas as pd
import numpy as np
class Entry:
def __init(self):
self.name = None
self.text = None
self.pandas_type = None
self.qps_type = None
self.start = None
self.size = None
self.max_sel = None
self.response... |
"""Tests for slim.nets.resnet_v1."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from nets import resnet_utils
from nets import resnet_v1
slim = tf.contrib.slim
def create_test_input(batch_size, height, wid... |
#!/usr/bin/python
from Bio import AlignIO
import sys
print "Usage: sat_cutter.py AlignFileFasta"
try:
file = sys.argv[1]
except:
raw_input = ("Introduce Alignment in FASTA format: ")
#open output file
out = open(file+".cut.fas","w")
#load alignment
align = AlignIO.read(open(file),"fasta")
#get reference s... |
"""Package resources into an apk.
See https://android.googlesource.com/platform/tools/base/+/master/legacy/ant-tasks/src/main/java/com/android/ant/AaptExecTask.java
and
https://android.googlesource.com/platform/sdk/+/master/files/ant/build.xml
"""
# pylint: enable=C0301
import optparse
import os
import shutil
from u... |
"""
Base class for Scrapy spiders
See documentation in docs/topics/spiders.rst
"""
import logging
import warnings
from scrapy import signals
from scrapy.http import Request
from scrapy.utils.trackref import object_ref
from scrapy.utils.url import url_is_from_spider
from scrapy.utils.deprecate import create_deprecated... |
""" example the downloads some fully polarimetric data from ESA's
PolSAR test data set and filters it with NL-SAR """
import os
import urllib.request
import zipfile
import gdal
import matplotlib.pyplot as plt
import numpy as np
# Add build directory to the python search paths for finding the module
# without install... |
import argparse
import sys
from ros_buildfarm.argument import \
add_argument_distribution_repository_key_files
from ros_buildfarm.argument import add_argument_distribution_repository_urls
from ros_buildfarm.argument import add_argument_dockerfile_dir
from ros_buildfarm.common import get_distribution_repository_key... |
# -*- coding: utf-8 -*-
"""
A list of Mexican states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from django.utils.translation import ugettext_lazy as _
STATE_CHOICES = (
('AGU', _(u'Aguascalientes')),
('BCN', _(u... |
# Apply the brighter fatter correction
config.isr.doBrighterFatter=False
config.charImage.repair.cosmicray.nCrPixelMax=1000000
# Useul to get to avoid deblending of satellite tracks
config.calibrate.deblend.maxFootprintSize=2000 # 2200
# Use psfex instead of pca
import lsst.meas.extensions.psfex.psfexPsfDeterminer
c... |
import json
from nose.tools import eq_, ok_, raises, assert_true
from speaklater import make_lazy_string
from . import setup
from .test_basic import CustomModelView, create_models
class Translator:
translate = False
def __call__(self, string):
if self.translate:
return 'Translated: "{0}... |
import socket
import sys
import re
import os
USAGE = '''
Usage: python get.py [action] [files...]
Available actions:
pull - get file to local repository
install - get file to local repository and push onto device
'''
DEFAULTCONFIG = [
"DEFAULT_HOST = 'localhost'",
"DEFAULT_PORT = 5000",
"BUFFERSIZ... |
import optparse
import tempfile
from systrace import trace_result
from systrace import tracing_agents
class FakeAgent(object):
def __init__(self, contents='fake-contents'):
self.contents = contents
self.stopped = False
self.filename = None
self.config = None
self.timeout = None
def StartAgen... |
from __future__ import absolute_import, unicode_literals
import csv
from babel import Locale
from django.core.management.base import BaseCommand
from molo.core.models import (
Languages, Tag, ArticlePage, ArticlePageTags, Main, SectionIndexPage,
TagIndexPage)
class Command(BaseCommand):
def add_arguments... |
# Fabric file for scampcat
import ConfigParser
import datetime
import os
from fabric.api import run, local, env, get, prompt, sudo, cd
from fabric.contrib import django
from fabric.contrib.console import confirm
django.settings_module('scampcat.settings.alfredo')
from django.conf import settings
here_dir = os.path.d... |
"""
Views for the credit Django app.
"""
import datetime
import json
import logging
from django.conf import settings
from django.http import (
HttpResponse,
HttpResponseBadRequest,
HttpResponseForbidden,
Http404
)
from django.utils.decorators import method_decorator
from django.views.decorators.csrf im... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: mso_schema_site_anp_epg_subnet
short_description: Manage sit... |
"""
This file tests that we can learn and predict the particularly vexing case of a
single constant signal!
"""
import numpy as np
import unittest2 as unittest
from nupic.research import fdrutilities as fdrutils
from nupic.research.TP import TP
from nupic.research.TP10X2 import TP10X2
from nupic.support.unittesthelpe... |
#!/usr/bin/python
from unittest import TestCase, main
from common import createClient, connectClient, startNufw
from nuauth import Nuauth
from nuauth_conf import NuauthConf
from inl_tests.iptables import Iptables
from filter import HOST, VALID_PORT
from plaintext import USERDB, PlaintextAcl, PlainPeriodXML, Period
from... |
import json
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.views.generic.base import TemplateView
from django.http import HttpResponse
from django.shortcuts import render
from manifold.core.query impor... |
from functools import update_wrapper
from django.apps import apps
from django.conf import settings
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.db.models.base import ModelBa... |
from collections import OrderedDict
import csv
import xlrd
def _e(s):
if type(s) is unicode:
return s.encode('utf8')
elif s is None:
return ''
else:
return str(s)
def _is_true(s):
return s not in ('F', 'False', 0, '', None, False)
class LuxTaxGenerator:
def __init__(s... |
import chainer
import chainermn
import copy
def create_mnbn_model(link, comm, communication_backend='auto'):
"""Create a link object with MultiNodeBatchNormalization.
Returns a copy of `link`, where BatchNormalization is replaced
by MultiNodeBatchNormalization.
Args:
link: Link object
... |
import os
import re
from invenio.shellutils import run_shell_command, run_process_with_timeout, Timeout
from invenio.plotextractor_output_utils import get_converted_image_name, \
write_message
def untar(original_tarball, sdir):
"""
Here we decide if our file is a... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
#
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import os
import re
from ansible.module_utils.basic import AnsibleModule
def match_opt(o... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
PointsFromLines.py
---------------------
Date : August 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**********... |
#!/usr/bin/python
"""ARP scan a given network"""
import logging
import subprocess
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
__author__ = "James R. Aylesworth"
__copyright__ = "Copyright 2018"
__license__ = "GPL"
__version__ = "1.0.0"
__maintainer__ = "James R. Aylesworth"
__emai... |
from pyticketswitch.price_band import PriceBand
from pyticketswitch.mixins import JSONMixin
class TicketType(JSONMixin, object):
"""Describes a collection of tickets.
Generally this represents a part of house in a venue, but may have other
meanings in contexts outside theater and music.
Attributes:
... |
from django.contrib import admin
from . import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs... |
from django.forms import widgets
from django.forms.fields import BooleanField, CharField
from django.utils.translation import ngettext_lazy, gettext_lazy as _
from django.utils.text import Truncator
from django.utils.safestring import mark_safe
from django.forms.fields import IntegerField
from entangled.forms import E... |
import distutils.spawn
import logging
import os
import re
import stat
import subprocess
from telemetry.core.platform import desktop_platform_backend
from telemetry.core.platform import ps_util
class PosixPlatformBackend(desktop_platform_backend.DesktopPlatformBackend):
# This is an abstract class. It is OK to hav... |
from __future__ import division
import ast
import copy
from ..compat import cstrerror
from .. import qtall as qt4
from .. import document
from .veuszdialog import VeuszDialog
def _(text, disambiguation=None, context="CustomDialog"):
"""Translate text."""
return qt4.QCoreApplication.translate(context, text, di... |
"""Handles all VCS (version control) support"""
from __future__ import absolute_import
import errno
import logging
import os
import shutil
import sys
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip.exceptions import BadCommand
from pip.utils import (display_path, backup_dir, call_subprocess,
... |
"""Writes the most recent "Cr-Commit-Position" value on the master branch
to a C header file.
Usage: last_commit_position.py <dir> <outfile> <headerguard>
<dir>
Some directory inside the repo to check. This will be used as the current
directory when running git. It's best to pass the repo toplevel directory... |
from pybrain.structure.modules.linearlayer import LinearLayer
from pybrain.structure.moduleslice import ModuleSlice
from pybrain.structure.connections.identity import IdentityConnection
from pybrain.structure.networks.feedforward import FeedForwardNetwork
from pybrain.structure.connections.shared import MotherConnectio... |
import github.GithubObject
import github.GitAuthor
import github.GitObject
class GitTag(github.GithubObject.CompletableGithubObject):
"""
This class represents GitTags as returned for example by http://developer.github.com/v3/todo
"""
@property
def message(self):
"""
:type: strin... |
from django.conf.urls import url
from quizes import views
urlpatterns = [
url(r'^quizes/?$', views.viewQuizes.as_view()),
url(r'^quizes/create/?$', views.createQuiz.as_view()),
url(r'^quizes/(?P<pk>\d+)/?$', views.singleQuiz.as_view()),
# url(r'^questions/?$', views.viewQuestions.as_view()),
# url(r'^... |
# coding: utf-8
"""
Functions to convert unicode IRIs into ASCII byte string URIs and back. Exports
the following items:
- iri_to_uri()
- uri_to_iri()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
from encodings import idna # noqa
import codecs
import re
import sys
from ... |
#!/usr/bin/env python
from __future__ import print_function
import logging
import re
import scrapy
from scrapy import Request
from scrapy.linkextractors import IGNORED_EXTENSIONS
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from scrapy.utils.url import url_has_any_extension
from typing import Any, Ge... |
from typing import Any, Dict, Optional
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import check_send_webhook_message
from ... |
import time
import gevent
import pytest
from Crypt import CryptConnection
from Connection import ConnectionServer
@pytest.mark.usefixtures("resetSettings")
class TestConnection:
def testSslConnection(self, file_server):
file_server.ip_incoming = {} # Reset flood protection
client = ConnectionSe... |
import base64
import xml.etree.ElementTree as ET
from collections import namedtuple
from datetime import datetime
from openerp import exceptions, SUPERUSER_ID, tools
from openerp.osv import fields, osv
from openerp.tools.translate import _
INTRASTAT_XMLNS = 'http://www.onegate.eu/2010-01-01'
class xml_decl(osv.Trans... |
# encoding: cinje
: def searchwindow ctx
<div id="searchModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"> Advanced Search</h4>
... |
#!/usr/bin/env python
import os
import glob
import sys
from lib.config import s3_config
from lib.util import electron_gyp, execute, rm_rf, safe_mkdir, s3put
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
SYMBOLS_DIR = 'dist\\symbols'
DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\li... |
{'name': 'Advanced Reconcile Transaction Ref',
'description': """
Advanced reconciliation method for the module account_advanced_reconcile
========================================================================
Reconcile rules with transaction_ref
""",
'version': '1.0.1',
'author': "Camptocamp,Odoo Community Assoc... |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... |
#!/usr/bin/python2.4
'''Post a message to twitter'''
__author__ = '<EMAIL>'
import ConfigParser
import getopt
import os
import sys
import twitter
USAGE = '''Usage: tweet [options] message
This script posts a message to Twitter.
Options:
-h --help : print this help
--consumer-key : the twitter consum... |
"""Unit tests for WebJournal."""
__revision__ = \
"$Id$"
# pylint invenio/modules/webjournal/lib/webjournal_tests.py
import unittest
from invenio.webjournal_utils import compare_issues
from invenio.webjournal import issue_is_later_than
#from invenio import webjournal_utils
from invenio.testutils import make_te... |
from __future__ import print_function
import time
import tempfile
import shutil
import unittest
import email.utils
from contextlib import contextmanager
import pytest
from scrapy.http import Response, HtmlResponse, Request
from scrapy.spider import Spider
from scrapy.settings import Settings
from scrapy.exceptions imp... |
import hashlib
import os
import shutil
import stat
import time
from django.conf import settings
from django.core.cache import cache
import commonware.log
import cronjobs
from files.models import FileValidation
log = commonware.log.getLogger('z.cron')
@cronjobs.register
def cleanup_extracted_file():
log.info('... |
import os
from telemetry.core import discover
from telemetry.core import profile_creator
BASE_PROFILE_TYPES = ['clean', 'default']
PROFILE_CREATORS = {}
PROFILE_TYPE_MAPPING = {
'typical_user': 'chrome/test/data/extensions/profiles/content_scripts1',
'power_user': 'chrome/test/data/extensions/profiles/extension... |
from msrest.serialization import Model
class RegistryListCredentialsResult(Model):
"""The response from the ListCredentials operation.
:param username: The username for a container registry.
:type username: str
:param passwords: The list of passwords for a container registry.
:type passwords:
... |
import sys
import time
from pyspark.sql import SparkSession
if __name__ == "__main__":
"""
Usage: autoscale
"""
print("Starting autoscale test")
spark = SparkSession \
.builder \
.appName("AutoScale") \
.getOrCreate()
sc = spark._sc
initialRdd = sc.parallelize... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
import traceback
try:
import ovirtsdk4.types as otypes
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.ovirt import (
B... |
"""
Module responsible for translating reference sequence data into GA4GH native
objects.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hashlib
import json
import os
import random
import pysam
import ga4gh.datamodel as datamodel
import ga4gh.... |
#
# Sample data for testing
#
leadins = """To characterize a linguistic level L,
On the other hand,
This suggests that
It appears that
Furthermore,
We will bring evidence in favor of the following thesis:
To provide a constituent structure for T(Z,K),
From C1, it follows that
For any tr... |
from django.conf import settings
def get_platrom_url(request=None):
platrom_url = None
if request:
platrom_url = request.META.get('SERVER_NAME')
if platrom_url:
return platrom_url
else:
return settings.PLATFORM_URL |
import datetime
from thumbor.handlers import ImageApiHandler
from thumbor.engines import BaseEngine
import tornado.gen as gen
import tornado.web
##
# Handler to retrieve or modify existing images
# This handler support GET, PUT and DELETE method to manipulate existing images
##
class ImageResourceHandler(ImageApiHan... |
__author__ = 'Neil Butcher'
from PyQt4 import QtGui
class PopulationSortFilterModel(QtGui.QSortFilterProxyModel):
def __init__(self, parent):
QtGui.QAbstractProxyModel.__init__(self, parent)
self.setDynamicSortFilter(True)
self._filters = []
self._antifilters = []
self._so... |
"""
Django settings for bp_mgmt project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... |
import random
import docker
import pytest
from .. import helpers
from ..base import requires_api_version
@requires_api_version('1.21')
class TestNetworks(helpers.BaseTestCase):
def create_network(self, *args, **kwargs):
net_name = u'dockerpy{}'.format(random.getrandbits(24))[:14]
net_id = self.c... |
"""Virgin runner.
This runner handles messages that the Mailman system gives virgin birth to.
E.g. acknowledgment responses to user posts or replybot messages. They need
to go through some minimal processing before they can be sent out to the
recipient.
"""
from mailman.core.pipelines import process
from mailman.cor... |
"""Benchmark for split and grad of split."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import random
import time
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session as session_lib
from tensorf... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
from opaque_keys.edx.keys import CourseKey
log = logging.getLogger(__name__)
def revert_alter_unique(apps, schema_editor):
CertificateTe... |
from argparse import ArgumentParser
import os.path
from sys import argv
from xml.etree import ElementTree
from copy import copy
from ford_xml_parser import FordXmlParser, ParamDesc
from code_formatter import CodeBlock
class Notifications_qml(FordXmlParser):
#Used for qt signal names, because qt signals cannot begi... |
import vtk
import wx
import invesalius.constants as const
import invesalius.data.vtk_utils as vu
BORDER_UP = 1
BORDER_DOWN = 2
BORDER_LEFT = 4
BORDER_RIGHT = 8
BORDER_ALL = BORDER_UP | BORDER_DOWN | BORDER_LEFT | BORDER_RIGHT
BORDER_NONE = 0
class SliceData(object):
def __init__(self):
self.actor = None... |
try:
from .sbterror import SbtError
from .util import maybe
except(ValueError):
from sbterror import SbtError
from util import maybe
import re
class BuildOutputMonitor(object):
def __init__(self, project):
self.project = project
self._parsers = [ErrorParser, TestFailureParser, Mu... |
from __future__ import absolute_import
from chart_studio.api.v2 import folders
from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase
class FoldersTest(PlotlyApiTestCase):
def setUp(self):
super(FoldersTest, self).setUp()
# Mock the actual api call, we don't want to do network te... |
import numpy as np
from numpy.testing import assert_equal, assert_allclose
import scipy.special as sc
def test_symmetries():
np.random.seed(1234)
a, h = np.random.rand(100), np.random.rand(100)
assert_equal(sc.owens_t(h, a), sc.owens_t(-h, a))
assert_equal(sc.owens_t(h, a), -sc.owens_t(h, -a))
def ... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_request,
)
from ..utils import (
qualities,
str_to_int,
)
class ExtremeTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?P<url>extremetube\.com/.*?vi... |
'''This is a custom layout for the RPi InfoScreen wordclock screen.
Custom layouts can be created for the screen by creating a new file in the
"layouts" folder.
Each layout must have the following variables:
LAYOUT: The grid layout. Must be a single string.
MAP: The mapping required... |
import stock_traceability
import stock_move
import stock_splitinto
import stock_partial_picking
import stock_partial_move
import stock_inventory_merge
import stock_fill_inventory
import stock_inventory_line_split
import stock_invoice_onshipping
import stock_location_product
import stock_change_standard_price
import sto... |
import types
import inspect
import re
import traceback
from jsonrpclib import config
iter_types = [
types.DictType,
types.ListType,
types.TupleType
]
string_types = [
types.StringType,
types.UnicodeType
]
numeric_types = [
types.IntType,
types.LongType,
types.FloatType
]
value_types... |
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import getdate
from frappe.model.document import Document
class FiscalYear(Document):
def set_as_default(self):
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name)
frappe.get_doc("Gl... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... |
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import get_current_site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def __call__(self, request, *args,... |
import numpy as np
import cv2
from matplotlib import pyplot as plt
import os
import sys
from scipy import linalg as LA
from matplotlib import cm
##############################Hyperspectral Image PCA Visualization##########################################################################################################... |
"""Tests for MetricSpec."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.metric_spec import MetricSpec
def test_metric(predictions, labels, weights=None):
return pr... |
"""Tests for SparseReorder."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import sparse_tensor
from tensorflow.python.framework import test_util
from tensorflow.python.ops import gradient_checker
fro... |
# Locking mechanism to ensure no two compilations occur simultaneously
# in the same compilation directory (which can cause crashes).
from __future__ import absolute_import, print_function, division
import atexit
import os
import socket # only used for gethostname()
import time
import logging
from contextlib import ... |
from __future__ import absolute_import, division, print_function
import struct
import six
from cryptography.exceptions import (
UnsupportedAlgorithm, _Reasons
)
from cryptography.hazmat.backends.interfaces import HMACBackend
from cryptography.hazmat.primitives import constant_time, hmac
from cryptography.hazmat.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.