content stringlengths 4 20k |
|---|
"""Unit test for Google Test's break-on-failure mode.
A user can ask Google Test to seg-fault when an assertion fails, using
either the GTEST_BREAK_ON_FAILURE environment variable or the
--gtest_break_on_failure flag. This script tests such functionality
by invoking googletest-break-on-failure-unittest_ (a program wr... |
from dataclasses import dataclass
from collections import deque
from .fighter import Fighter, FakeFighter
@dataclass
class Round:
fighter: Fighter
win: bool = False
def __str__(self):
return '{1}{0}{1}'.format(self.fighter, '__' if self.win else '')
class Player:
def __init__(self, member,... |
from ImageScripter import *
from elan import *
ScriptSettings.Threshold = .96
#Messaging#################################################
Say("Checking the messaging page")
Configurator.messaging.Click()
#Configurator.messagingpage.SetThreshold(.98)
Configurator.messagingpage.Wait(seconds=10)
Say("Checking the messagi... |
"""Run the helper as a server."""
import logging
from twisted.internet import reactor, protocol, task
from twisted.protocols.basic import LineReceiver
from helper.core import App
logging.basicConfig(level='INFO')
app = App()
app.protocol = None
def tick():
"""See if we need to quit."""
whi... |
import unittest
from stubo.ext.xmlutils import XPathValue
from stubo.testing import DummyModel
from stubo.model.request import StuboRequest
class TestXMLManglerPutStub(unittest.TestCase):
def _make(self, **kwargs):
from stubo.ext.xmlexit import XMLManglerPutStub
return XMLManglerPutStub(**kwargs)... |
"""distutils.cygwinccompiler
Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows. It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
"""
# problems:
#
# * if you use a msvc com... |
from openerp import models, fields, api
from openerp.exceptions import ValidationError
class AccountMoveTemplate(models.Model):
_name = 'account.move.template'
_inherit = 'account.document.template'
@api.model
def _company_get(self):
return self.env['res.company']._company_default_get(
... |
"""
Test text channel not being recreated because although there were still
pending messages, we destroyed it with extreme prejudice.
"""
import dbus
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import call_async, EventPattern, wrap_channel, assertEquals
import constants as... |
import socorro.lib.ConfigurationManager as cm
import datetime
from socorro.unittest.config.commonconfig \
import databaseHost as database_hostname
try:
from socorro.unittest.config.commonconfig \
import databasePort as database_port
except:
database_port = 5432
from socorro.unittest.config.commonconfig \
... |
"""
WebJournal element - Displays vertical subnavigation menu in detailed
article pages.
"""
from invenio.bibformat_engine import BibFormatObject
from invenio.messages import gettext_set_language
from invenio.webjournal_utils import \
parse_url_string, \
make_journal_url, \
get_journal_articles,\
ge... |
import logging
import time
from datetime import datetime
from boto.sdb.db.model import Model
from boto.sdb.db.property import StringProperty, IntegerProperty, BooleanProperty
from boto.sdb.db.property import DateTimeProperty, FloatProperty, ReferenceProperty
from boto.sdb.db.property import PasswordProperty, ListPrope... |
import sketchdlg
from Tkinter import Frame, Label, IntVar
from Tkinter import RIGHT, BOTTOM, X, Y, BOTH, LEFT, TOP, GROOVE, E,\
DISABLED, NORMAL
from tkext import UpdatedButton, MyEntry
from miniscroll import MiniScroller
from sketchdlg import PropertyPanel
from Sketch.const import SELECTION
from Sketch.Graphic... |
"""
Extra HTML Widget classes
"""
import time
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
from django.utils.formats import get_format
from django.conf import setting... |
import logging
import os
import random
import re
import shutil
import string
import sys
import tempfile
from webkitpy.common.memoized import memoized
from webkitpy.common.system.executive import Executive, ScriptError
from .scm import AuthenticationError, SCM, commit_error_handler
_log = logging.getLogger(__name__)
... |
from openerp.osv import osv
class hr_payslip_employees(osv.osv_memory):
_inherit ='hr.payslip.employees'
def compute_sheet(self, cr, uid, ids, context=None):
run_pool = self.pool.get('hr.payslip.run')
if context is None:
context = {}
if context and context.get('active_... |
import os
import sys
from stat import *
import pwd
import grp
def main():
module = AnsibleModule(
argument_spec = dict(
path = dict(required=True),
follow = dict(default='no', type='bool'),
get_md5 = dict(default='yes', type='bool'),
get_checksum = dict(defau... |
"""Tests for Parsing Covering metric."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
import numpy as np
from deeplab.evaluation import parsing_covering
from deeplab.evaluation import test_utils
# See the definition ... |
"""
Component that will help set the Dlib face detect processing.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/image_processing.dlib_face_detect/
"""
import logging
import io
from homeassistant.core import split_entity_id
# pylint: disable=unused-impo... |
from PyQt4 import QtGui # Import the PyQt4 module we'll need
import sys # We need sys so that we can pass argv to QApplication
import design # This file holds our MainWindow and all design related things
# it also keeps events etc that we defined in Qt Designer
import os # For listing directory methods
class Ex... |
from lib.aws.exception import AwsServiceException
class EBErrorCode(object):
'''Elastic Beanstalk error code'''
TooManyApplicationsException = 'TooManyApplicationsException'
TooManyConfigurationTemplates = 'TooManyConfigurationTemplates'
OperationInProgress = 'OperationInProgress'
So... |
# Django settings for github_jenkins project.
import os
import social_auth
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '<EMAIL>'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
... |
"""Query results cacher."""
from invenio_search.cache import get_results_cache, set_results_cache
class CacheOp(object):
"""Store results in cache."""
def __init__(self, query, collection=None):
"""Define query that should be cached."""
self.query = query
self.collection = collectio... |
"""Scans the Chromium source for histograms that are absent from histograms.xml.
This is a heuristic scan, so a clean run of this script does not guarantee that
all histograms in the Chromium source are properly mapped. Notably, field
trials are entirely ignored by this script.
"""
import commands
import extract_hi... |
import numpy as np
from pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show,semilogx, semilogy
import scipy.fftpack
import os.path
import struct
import argparse
import PatternGeneration.DebugTools as d
# Example script to read patterns and test outputs
parser = argparse.ArgumentParse... |
from __future__ import print_function
import subprocess
import tempfile
import uuid
# A temporary directory on the Android device.
DEVICE_TEMP_DIR = '/data/local/tmp'
def shell(args):
"""
Execute 'adb shell' with the given arguments.
Raise an exception if 'adb shell' returns a non-zero exit code.
... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class EchoMskIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?echo\.msk\.ru/sounds/(?P<id>\d+)'
_TEST = {
'url': 'http://www.echo.msk.ru/sounds/1464134.html',
'md5': '2e44b3b78daff5b458e4dbc... |
from openerp import tools
from openerp.osv import fields,osv
class hr_holidays_remaining_leaves_user(osv.osv):
_name = "hr.holidays.remaining.leaves.user"
_description = "Total holidays by type"
_auto = False
_columns = {
'name': fields.char('Employee', size=64),
'no_of_leaves': fields.... |
"""Consume and serialize all of the data from a running TensorBoard instance.
This program connects to a live TensorBoard backend at given port, and saves
all of the data to local disk JSON in a predictable format.
This makes it easy to mock out the TensorBoard backend so that the frontend
may be tested in isolation.... |
"""
This example demonstrates the proper use of project: lazgui
"""
import sys
import os
sys.path.insert(0, os.path.abspath("../../")) # needed to find lazgui development version
from lazgui.gui_factory import *
Lay = get_layout(layout_type='vstack', Left=41, Height=0, Top=42, Width=0,
TopMargi... |
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from scipy._build_utils import numpy_nodepr_api
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('signal', parent_package, top_path)
conf... |
"""
Current non-native dependencies in selenium package. If desired to have
script run 'headless' (without any browser opening), then need
additional python selenium PhantomJS dependency.
Instructions for headless operation:
- replace 'driver = webdriver.Firefox()' line with
'driver = webdriver.PhantomJS()'... |
try:
from cs import CloudStack, CloudStackException, read_config
has_lib_cs = True
except ImportError:
has_lib_cs = False
# import cloudstack common
from ansible.module_utils.cloudstack import *
class AnsibleCloudStackVolume(AnsibleCloudStack):
def __init__(self, module):
super(AnsibleCloudS... |
import glob
import sys
import os
import re
try:
import subprocess
except ImportError:
def popen(argv):
try:
si, so = os.popen4(' '.join(argv))
return so.read().strip()
except:
raise IOError('lsusb failed')
else:
def popen(argv):
try:
... |
"""The tests for the heat control thermostat."""
import unittest
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
STATE_OFF,
TEMP_CELCIUS,
)
from homeassistant.components import thermostat
from tests.common import get_test_home_assistant
... |
"""This is the docstring for the example.py module. Modules names should
have short, all-lowercase names. The module name may have underscores if
this improves readability.
Every module should have a docstring at the very top of the file. The
module's docstring may extend over multiple lines. If your docstring doe... |
from myternaryutility import TernaryPlot
import matplotlib.cm as cm
import numpy
import pylab, copy
from colorsys import rgb_to_hsv
from colorsys import hsv_to_rgb
pylab.figure(figsize=(6, 3))
ax=pylab.gca()
#stp = TernaryPlot(ax, ellabels=['Au', 'Cu', 'Si'])
stp = TernaryPlot(ax, ellabels=['A', 'B', 'C'])
stp.grid(n... |
"""
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogram... |
"""
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... |
from sympy.core import (S, symbols, Eq, pi, Catalan, EulerGamma, Lambda,
Dummy, Function)
from sympy.core.compatibility import StringIO
from sympy import erf, Integral, Piecewise
from sympy import Equality
from sympy.matrices import Matrix, MatrixSymbol
from sympy.printing.codeprinter import Ass... |
import os
import sys
from slicc.parser import SLICC
usage="%prog [options] <files> ... "
version="%prog v0.4"
brief_copyright='''
Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
Copyright (c) 2009 The Hewlett-Packard Development Company
All Rights Reserved.
'''
def nprint(format, *args):
pass
def eprint(... |
import os
import subprocess
from conf import SspkdConfig
from errors import *
from util import SspkdUtil
class SspkdPull(object):
def __init__(self):
self.cf = SspkdConfig()
self.util = SspkdUtil()
def _pull(self):
if self.cf.server.enabled:
with open(self.cf.server.databa... |
'''
Takes selected materials and replaces them with Redshift materials imported from shaderFilePath.
Finds the gammaCorrect node attached to the Redshift material's "diffuse_color" attribute, and assigns it the color value of the selected material(s). If it does not find a gammaCorrect node, it simply assign the color... |
"""distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
__revision__ = "$Id$"
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly ... |
'''
YouTube plugin for XBMC
Copyright (C) 2010-2012 Tobias Ussing And Henrik Mosgaard Jensen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... |
from __future__ import print_function
from bokeh.util.browser import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, ColumnDataSource, PanTool, WheelZoomTool
)
from bokeh.resources import INL... |
import json
from django.templatetags.static import static
from wagtailtinymce.rich_text import TinyMCERichTextArea
class DigiHelTinyMCERichTextArea(TinyMCERichTextArea):
plugins = [
'anchor',
'autolink',
'charmap',
'code',
'codesample',
'contextmenu',
'def... |
#!/usr/bin/env python
# File created on 25 May 2010
from __future__ import division
__author__ = "Antonio Gonzalez Pena"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Antonio Gonzalez Pena", "Greg Caporaso"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Antonio Gonzalez Pena"
__... |
# -*- coding: utf-8 -*-
import pytz
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CourseTeam.last_activity_at'
db.add_column('t... |
#!/usr/bin/env python
from pymongo import MongoClient
import pymongo
HOST = "wfSciwoncGW:<EMAIL>:27001/?authSource=admin"
c = MongoClient('mongodb://'+HOST)
dbname = "googlew"
task = "task_events"
ginfo = "general_info"
statscpumemory = "stats_cpumemory"
maxmincpumemory = "maxmin_cpumemory"
mediancpu = "median_cpu... |
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import (
InvalidElementStateException, WebDriverException)
from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal ... |
"""
Invenio mimetype helper functions.
Usage example:
TODO
"""
import re
from invenio.base.globals import cfg
from mimetypes import MimeTypes
from six import iteritems
from werkzeug import cached_property, LocalProxy
from thread import get_ident
try:
import magic
if hasattr(magic, "open"):
CFG_H... |
import numpy as np
import scipy.stats.stats
from . import distributions
from .._lib._bunch import _make_tuple_bunch
__all__ = ['_find_repeats', 'linregress', 'theilslopes', 'siegelslopes']
# This is not a namedtuple for backwards compatibility. See PR #12983
LinregressResult = _make_tuple_bunch('LinregressResult',
... |
#!/usr/bin/env python3.4
__author__ = 'mdc_hk'
version = '1.0'
#===========================================================================================================
import datetime, logging, multiprocessing, os, re, subprocess, sys, time
import pandas as pd
from pandas import Series
from bs4 import BeautifulSoup... |
#AATC crypto module
import codecs,recvall,ast,os,AATC_Config,AATC_CryptoBeta
from Crypto.Cipher import AES,PKCS1_OAEP
from Crypto.PublicKey import RSA
class Crypter:
"""
A class to encrypt and decrypt a connection with AES. Takes a connection object and mode and sets up a secret key for both participants.
... |
# coding: utf-8
import unittest
from geoalchemy2.shape import from_shape, WKTElement
from shapely.geometry import Point
from niamoto.testing import set_test_path
set_test_path()
from niamoto.conf import settings
from niamoto.data_providers.base_plot_provider import *
from niamoto.db import metadata as niamoto_db_me... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import xbmcplugin,xbmcgui,xbmc,xbmcaddon
import os,sys,urllib
def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=sys.argv[2]
cleanedparams=params.replace('?','')
if (par... |
import Ice, sys, math, traceback
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
class C(QWidget):
def __init__(self, endpoint, modules):
QWidget.__init__(self)
self.Lista=list();
self.ic = Ice.initialize(sys.argv)
self.mods = modules
self.prx = self.ic.stringToPro... |
from cStringIO import StringIO
#from RawServer import RawServer
try:
True
except:
True = 1
False = 0
from BT1.Encrypter import protocol_name
default_task_id = []
class SingleRawServer:
def __init__(self, info_hash, multihandler, doneflag, protocol):
self.info_hash = info_hash
... |
"""
Django settings for waliki_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ... |
#!/usr/bin/env python
# coding: utf8
"""
ExtendedLoginForm is used to extend normal login form in web2py with one more login method.
So user can choose the built-in login or extended login methods.
"""
from gluon import current, DIV
class ExtendedLoginForm(object):
"""
Put extended_login_form under web2py/g... |
from msrest.serialization import Model
class PolicyAssignment(Model):
"""The policy definition.
:param display_name: The display name of the policy assignment.
:type display_name: str
:param policy_definition_id: The ID of the policy definition.
:type policy_definition_id: str
:param scope: T... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
initialize handlers
"""
import tornado.web
import tornado.escape
import tornado.ioloop
from lib import verify, encrypt, mail
from db import db_machine
from lib.salt_api import SaltAPI as sapi
import json
import check
from lib.logger import log
from tornado.concurre... |
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.utils import http
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from openstack_dashboard import api
class AddPoolLink(tables.LinkAction):... |
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also a table here mapping operators to their names in the
token module; the Python tokenize module reports all operators as... |
""" This module removes all objects/arrays from JS source code and replace them with LVALS.
Also it has s function translating removed object/array to python code.
Use this module just after removing constants. Later move on to removing functions"""
OBJECT_LVAL = 'PyJsLvalObject%d_'
ARRAY_LVAL = 'PyJsLvalArray%d_'
fro... |
from collections import defaultdict
from django.conf import settings
from django.template.base import TemplateSyntaxError, Library, Node, TextNode,\
token_kwargs, Variable
from django.template.loader import get_template
from django.utils.safestring import mark_safe
from django.utils import six
register = Library(... |
# -*- coding: utf-8 -*-
"""
written by Georg Raiser 20.10.2015
questions/bugs to <EMAIL>
"""
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import scipy as sp
import sys
import os
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
import tifffile
class interactive_traces_e... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
qualities,
determine_ext,
)
class TeacherTubeIE(InfoExtractor):
IE_NAME = 'teachertube'
IE_DESC = 'teachertube.com videos'
_VALID_URL = r'https?://(?:www\.)?teachert... |
'''
Charting library for Weblate.
'''
from weblate.trans.models import Change
from weblate.lang.models import Language
from weblate.trans.views.helper import get_project_translation
from django.shortcuts import get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.models import User
from djan... |
"""
This is the Docutils (Python Documentation Utilities) "math" sub-package.
It contains various modules for conversion between different math formats
(LaTeX, MathML, HTML).
:math2html: LaTeX math -> HTML conversion from eLyXer
:latex2mathml: LaTeX math -> presentational MathML
:unichar2tex: Unicode character to ... |
import os
import signal
import socket
import sys
import time
import unittest
import warnings
import cherrypy
import cherrypy.process.servers
from cherrypy._cpcompat import BadStatusLine, ntob
from cherrypy.test import helper
engine = cherrypy.engine
thisdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
cla... |
"""
Utility for saving locals.
"""
import sys
import pydevd_vars
def is_save_locals_available():
try:
if '__pypy__' in sys.builtin_module_names:
import __pypy__
save_locals = __pypy__.locals_to_fast
return True
except:
pass
try:
import ctypes
... |
import unittest
import command
import mle
import thread_cert
from command import CheckType
LEADER = 1
ROUTER1 = 2
class Cert_5_1_06_RemoveRouterId(thread_cert.TestCase):
TOPOLOGY = {
LEADER: {
'mode': 'rdn',
'panid': 0xface,
'allowlist': [ROUTER1]
},
R... |
from pandac.PandaModules import *
from toontown.toon import ToonDNA
from direct.fsm import StateData
from direct.gui.DirectGui import *
from MakeAToonGlobals import *
import random
from toontown.toonbase import TTLocalizer
from direct.directnotify import DirectNotifyGlobal
from toontown.toontowngui import TeaserPanel
i... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
... |
"""Connection to PowerVM hypervisor through NovaLink."""
from oslo_log import log as logging
from oslo_utils import excutils
from pypowervm import adapter as pvm_apt
from pypowervm import const as pvm_const
from pypowervm import exceptions as pvm_exc
from pypowervm.helpers import log_helper as log_hlp
from pypowervm.h... |
# -*- coding: utf-8 -*-
from openerp.tests import common
class TestWebsiteBlogCommon(common.TransactionCase):
def setUp(self):
super(TestWebsiteBlogCommon, self).setUp()
Users = self.env['res.users']
group_blog_manager_id = self.ref('base.group_document_user')
group_employee_id =... |
import gevent
import gevent.queue
from lymph.exceptions import Timeout, Nack, RemoteError
from lymph.core.messages import Message
class Channel(object):
def __init__(self, request, server):
self.request = request
self.server = server
class RequestChannel(Channel):
def __init__(self, request... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
import json
from itertools import chain
from ansible.module_utils._text import to_bytes, to_text
from ansible.module_utils.network.common.utils import to_list
from ansible.plugins.cliconf import CliconfBase, enable_mode... |
import sys
import subprocess
import os
import traceback
import signal
from zephyr_mirror_backend import parse_args
def die(signal, frame):
# We actually want to exit, so run os._exit (so as not to be caught and restarted)
os._exit(1)
signal.signal(signal.SIGINT, die)
(options, args) = parse_args()
sys.path... |
#!/usr/bin/env python
import os, re, sys
import subprocess
native_modules = ['nw_test_loop_without_handle',
'bignum',
'dtrace-provider',
'ref',
'lame',
];
script_dir = os.path.dirname(__file__)
native_root = os.path.join(script_... |
"""Pure-Python RC4 implementation."""
from .rc4 import RC4
from .cryptomath import *
def new(key):
return Python_RC4(key)
class Python_RC4(RC4):
def __init__(self, keyBytes):
RC4.__init__(self, keyBytes, "python")
S = [i for i in range(256)]
j = 0
for i in range(2... |
from _pydevd_bundle import pydevd_constants
from _pydev_imps._pydev_saved_modules import socket
_cache = None
def get_localhost():
'''
Should return 127.0.0.1 in ipv4 and ::1 in ipv6
localhost is not used because on windows vista/windows 7, there can be issues where the resolving doesn't work
properly... |
"""Tests for contrib.compiler.jit."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.compiler import jit
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import function
from tensorflow.python.fra... |
#configuration of the ControlPlot machinery
from collections import namedtuple
controlPlot = namedtuple("controlPlot", ["label","module","classname","kwargs"])
eventCollection = namedtuple("eventCollection",["label","collection"])
eventProducer = namedtuple("eventProducer", ["label","module","function","kwar... |
"""Test RPCs related to blockchainstate.
Test the following RPCs:
- gettxoutsetinfo
- getdifficulty
- getbestblockhash
- getblockhash
- getblockheader
- getchaintxstats
- getnetworkhashps
- verifychain
Tests correspond to code in rpc/blockchain.cpp.
"""
from decimal import Decimal
imp... |
import glob
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.2)
def generate_dataframe(country, data="new_data"):
path = "../data/wikipedia_{}/{}".format(country, data)
... |
from __future__ import unicode_literals
from .testapp.models import Mixed
from .testapp.models import Project
from .testapp.models import ProjectGroupObjectPermission
from .testapp.models import ProjectUserObjectPermission
from django.contrib.auth.models import Group, Permission
from django.test import TestCase
from gu... |
#Declare and initialize your variables
country = ""
province = ""
orderTotal = 0
totalWithTax = 0
#I am declaring variables to hold the tax values used in the calculations
#That way if a tax rate changes, I only have to change it in one place instead
#of searching through my code to see where I had a specific numeric ... |
from __future__ import unicode_literals
import io
import optparse
import os.path
import re
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
README_FILE = os.path.join(ROOT_DIR, 'README.md')
PREFIX = r'''%YOUTUBE-DL(1)
# NAME
youtube\-dl \- download videos from youtube.com or other video platf... |
import sys
from datetime import datetime
from django.apps import apps
from django.db import models
from django.utils import six
from django.utils.timezone import utc
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from .abstract_mixin import Abstrac... |
#!/usr/bin/env python
import os
import re
import yaml
import argparse
try:
import pyrax
HAS_PYRAX = True
except ImportError:
HAS_PYRAX = False
from ansible.module_utils.six.moves import input
def rax_list_iterator(svc, *args, **kwargs):
method = kwargs.pop('method', 'list')
items = getattr(svc,... |
# -*- mode: python -*- |
"""ANTLR3 runtime package"""
# begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2008 Terence Parr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code ... |
from __future__ import with_statement
from os.path import join, dirname
from cStringIO import StringIO
from logilab.common.testlib import TestCase, unittest_main
from logilab.common.changelog import ChangeLog
class ChangeLogTC(TestCase):
cl_class = ChangeLog
cl_file = join(dirname(__file__), 'data', 'Change... |
"""\
========================
Doctree to HTML Renderer
========================
Renderer for converting docutils document trees to HTML output with Kamaelia
website specific directives, and automatic links for certain text patterns.
"""
import textwrap
import inspect
import pprint
import time
from docutils import c... |
#!/usr/bin/env python
from distutils.core import setup, Extension
import os
from distutils.sysconfig import get_config_vars
(opt,) = get_config_vars('OPT')
os.environ['OPT'] = " ".join(
flag for flag in opt.split() if flag != '-Wstrict-prototypes'
)
pathplanner = Extension('_PathPlannerNative',
sources =... |
"""
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form here... |
from IPy import IP
from collections import namedtuple
from gi.repository import GLib
from pyanaconda import constants
from pyanaconda.threads import threadMgr, AnacondaThread
from pyanaconda.ui.gui import GUIObject
from pyanaconda import nm
__all__ = ["ISCSIDialog"]
STYLE_NONE = 0
STYLE_CHAP = 1
STYLE_REVERSE_CHAP =... |
from django.contrib import admin
from django.db import models
from django.forms import CheckboxSelectMultiple
from django.utils.translation import ugettext_lazy as _
from contact.models import Contact, Address
class AddressInline(admin.TabularInline):
model = Address
max_num = 10
min_num = 2
extra = 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.