content string |
|---|
# This external method pulls in a list of titanServicesLinks from the given url
# the format of the list should be: "%id,,,,,,,%title,,,,,,,%url_expr" with one entry per line
# it then iterates through all the plone sites in the container it is run on (should be the root zope instance)
# and using the list of links, it... |
"""
Copyright (c) 2009 Ryan Kirkman
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, s... |
# coding: utf-8
def userinterface():
## Show menu ##
print
print((80 * '-'))
print (' โโโโโโ โโโ โโโโโโโโโโโโ โโโโโโ โโโ โโโโโโโ โโโโ โโโ ')
print (' โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ ')
print (' โโโโโโโโโโโโโโโ โโโ โโโโโโโโโโโโโโ โโโโโโโโโ โโโ ')
print (' โโโโโโโโโโโโโโโ โโโ ... |
from display.shape import Shape, UnitShape
import osg
from math import pi, cos, sin, sqrt
class Cone(UnitShape):
@classmethod
def name(cls):
return gettext('Cone')
def __init__(self, segments = 32, *args, **keywordArgs):
Shape.__init__(self, *args, **keywordArgs)
... |
""" This module should contain all things associated with time or date that can be shared.
"""
import time
from datetime import datetime as _datetime
import tzlocal
local_tz = tzlocal.get_localzone()
class parsetime(_datetime): # NOQA
""" Modified class with loaders for our datetime formats.
"""
amer... |
# -*- coding: utf-8 -*-
u"""Collecting the basic info of FlexiNS.
"""
from libs.checker import ResultInfo,CheckStatus
from libs.infocache import InfoCache
from libs.flexing import FlexiNG
## Mandatory variables
##--------------------------------------------
module_id = 'fngbase.2016030500'
tag = ['flexins','ba... |
""" Views for the base application """
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from indiefilmrentals.products.models import *
from shop_simplecategories.models import *
from .utils import send_email_to_ohiohd
def home(request):
""" Default view... |
'''
A simple test-case that ensures the forward and backward passes
of the fast, cythonized factorization machine match the forward
and backward passes of the slow, autodiff version.
'''
from __future__ import print_function
import numpy as np
import torch
import torch.nn.functional as F
from fmpytorch.second_order.s... |
from django.contrib.auth.decorators import login_required, permission_required
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render_to_response, get_object_or_404
from django.utils.translation import ugettext as _
from django.template.context import RequestContext
from user_profile.... |
from omsdk.version.sdkversion import OverrideCompatibleEnumPyVersion
from enum import Enum
import sys
if OverrideCompatibleEnumPyVersion:
PY2Enum = (sys.version_info < OverrideCompatibleEnumPyVersion)
PY3Enum = (sys.version_info >= OverrideCompatibleEnumPyVersion)
if PY2Enum:
from enum import EnumValue
... |
#!/usr/bin/env python
"""
epitopepredict, methods for supporting web app
Created Sep 2017
Copyright (C) Damien Farrell
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 v... |
import random
import numpy as np
from ExperimentBase import *
import Constants as C
class ExperimentCombined(ExperimentBase):
def __init__(self, name, histogramType, dataset1, dataset2):
ExperimentBase.__init__(self, name, histogramType)
self.knn1 = None
self.knn2 = None
self.ds1... |
from base64 import b64decode, b64encode
import calendar
from datetime import date, datetime
import json
import six
from collections import OrderedDict
EJSON_KEYWORDS = ("$date", "$type", "$value", "$escape", "$binary")
try:
from datetime import timezone
except ImportError:
from datetime import tzinfo, timedelt... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PSL_Apps/utilityApps/templates/advancedCal.ui'
#
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribu... |
import decimal
from unittest import TestCase
from pyramid import testing
class TestDecimalJSON(TestCase):
def _call_fut(self, **kwargs):
from c2cgeoportal import DecimalJSON
fake_info = {}
return DecimalJSON(**kwargs)(fake_info)
def test_decimal(self):
renderer = self._call_fu... |
from adhocracy import model
from adhocracy.lib.democracy import Decision, DelegationNode
from adhocracy.model import Delegation, Group, Poll, Vote
from adhocracy.tests import TestController
from adhocracy.tests.testtools import tt_get_instance
from adhocracy.tests.testtools import tt_make_proposal, tt_make_user
clas... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0008_org_timezone'),
('rooms', '0001_initial'),
('profiles', '0001_initial'),
]
operations = [
migra... |
from twisted.internet import protocol, defer, reactor
from ooni.nettest import NetTestCase
from ooni.utils import log
class ProcessDirector(protocol.ProcessProtocol):
def __init__(self, d, finished=None, timeout=None, stdin=None):
self.d = d
self.stderr = ""
self.stdout = ""
self.... |
"""Main file for starting Felt.
Handles input parsing, checking parameters and starting the workload run.
"""
import argparse
import sys
import os.path
import commentjson
from models import Scenario, Options
from core import Felt
__license__ = "MIT"
__maintainer__ = "Samuel Vandamme"
__email__ = "<EMAIL>"
__author__... |
"""Module for the RegisterEventHandler action."""
from typing import Iterable
from typing import List
from typing import Text
from typing import Tuple
from ..action import Action
from ..event_handler import BaseEventHandler
from ..launch_context import LaunchContext
from ..launch_description_entity import LaunchDescr... |
import os
import sh
import sys
class Keychain:
identities = []
identities_str = 'need find_identity first'
def __init__(self, name, password=''):
home = os.path.expanduser("~")
# home = os.getenv('HOME')
filename = os.path.join(home, 'Library', 'Keychains', name)
self.f... |
import intmaniac
from intmaniac import maniac_file
from tests.configsetup import *
from tests.mocksetup import *
import yaml
from unittest import TestCase, skipUnless
class TestIntmaniacFileHandling(TestCase):
def setUp(self):
self.config_empty = intmaniac._parse_args([])
self.config_env = intm... |
'''
Created on Sep 30, 2014
@author: gupta
'''
import sys
import json
def read_tweets_topsy(fn,category):
count = 0
with open(fn) as fp:
for line in fp:
try:
js = json.loads(line)
url = js['topsy_trackback_url']
... |
import os.path
import SCons.Script
import SCons.Tool
import logging
import options
import builtin_options
import setup
#//===========================================================================//
_Info = logging.Info
_BuiltinOptions = builtin_options.BuiltinOptions
_Setup = setup.Setup
_EnvOptions = options.... |
"""
A family of response functions for CFProjections.
These function objects compute a response matrix when given an input
pattern and a set of ConnectionField objects. Response functions come
in two varieties: ResponseFunction, and CFPResponseFunction. A
ResponseFunction (e.g. DotProduct) computes the response due ... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from fobi.base import BaseFormFieldPluginForm, get_theme
from fobi.helpers import get_registered_models
from .settings import IGNORED_MODELS
__title__ = 'fobi.contrib.plugins.form_elements.fields.' \
'select_multiple_mptt_mo... |
from django.db import models
from functools import reduce
class NaturalKeyQuerySet(models.QuerySet):
def filter(self, *args, **kwargs):
natural_key_slug = kwargs.pop('natural_key_slug', None)
if natural_key_slug and type(natural_key_slug) is str:
slugs = natural_key_slug.split(
... |
from paravistest import datadir, compare_lists
from presentations import *
import pvserver as paravis
import pvsimple
my_paravis = paravis.myParavis
error =0
# Import MED file
file_path = datadir + "fra.med"
OpenDataFile(file_path)
med_reader = pvsimple.GetActiveSource()
if med_reader is None:
print "Error!!! me... |
import itertools
import os
import shlex
from StringIO import StringIO
from subprocess import PIPE
from tempfile import NamedTemporaryFile
from zipfile import ZipFile, ZIP_DEFLATED
from django.conf import settings
from lxml import etree
from dimagi.utils.subprocess_manager import subprocess_context
CONVERTED_PATHS = ... |
import unittest
import unittest.mock as mock
import os.path
from dbsync import *
class TestDbUpdater(unittest.TestCase):
def setUp(self):
self.db = mock.Mock()
self.sp = mock.Mock()
self.sut = DbUpdater(self.db, self.sp)
def test_when_schema_folder_exists_should_tell_db_to_apply_sche... |
import os
import re
import locale
import logging
from jinja2 import FileSystemLoader, Environment, TemplateSyntaxError, TemplateNotFound
from copy import copy, deepcopy
logger = logging.getLogger('coshsh')
class EmptyObject(object):
pass
class Item(object):
template_cache = {}
@classmethod
def relo... |
"""
Converts a Moses phrase table to a Joshua phrase table. The differences are
(a) adding an LHS and (b) applying -log() to all the model weights.
Usage: gzip -cd grammar.gz | phrase2hiero.py | gzip -9n > grammar.new.gz
Author: Matt Post <<EMAIL>>
Date: June 2016
"""
import sys
import math
import codecs
reload(s... |
"""macostools - Various utility functions for MacOS.
mkalias(src, dst) - Create a finder alias 'dst' pointing to 'src'
copy(src, dst) - Full copy of 'src' to 'dst'
"""
from warnings import warnpy3k
warnpy3k("In 3.x, the macostools module is removed.", stacklevel=2)
from Carbon import Res
from Carbon import File, Fil... |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <<EMAIL>>'
__docformat__ = 'restructuredtext en'
import gc
from PyQt4.Qt import Qt
from calibre.gui2 import Dispatcher
from calibre.gui2.tools import fetch_scheduled_recipe
from calib... |
import renderdoc as rd
import rdtest
class GL_Separable_Geometry_Shaders(rdtest.TestCase):
def get_capture(self):
return rdtest.run_and_capture("demos_x64", "GL_Separable_Geometry_Shaders", 5)
def check_capture(self):
draw = self.find_draw("Draw")
self.controller.SetFrameEvent(draw.e... |
"""Common functions for MongoDB and DB2 backends
"""
from oslo_log import log
import pymongo
import six
from aodh.storage import base
from aodh.storage import models
from aodh.storage.mongo import utils as pymongo_utils
from aodh import utils
LOG = log.getLogger(__name__)
COMMON_AVAILABLE_CAPABILITIES = {
'ala... |
"""
xgds_map_server
"""
__version_info__ = {
'major': 0,
'minor': 1,
'micro': 0,
'releaselevel': 'final',
'serial': 1
}
def get_version():
"""
Return the formatted version information
"""
vers = ["%(major)i.%(minor)i" % __version_info__, ]
if __version_info__['micro']:
... |
"""
Installs and configures AMQP
"""
from packstack.installer import basedefs
from packstack.installer import validators
from packstack.installer import processors
from packstack.installer import utils
from packstack.modules.common import filtered_hosts
from packstack.modules.documentation import update_params_usage
... |
from tempest.api.compute import base
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
class InstanceActionsNegativeTestJSON(base.BaseV2ComputeTest):
"""Negative tests of instance actions"""
create_default_network = True
@cla... |
import _plotly_utils.basevalidators
class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self,
plotly_name="tickformatstops",
parent_name="scatter.marker.colorbar",
**kwargs
):
super(TickformatstopsValidator, self).__init__(... |
# -*- coding: utf-8 -*-
import re
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinxcontrib.napoleon'
]
if os.getenv('SPELLCHECK'):
extensions += 'sphinxcontrib.spelling'... |
from builtins import range
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
# Generator of continuous surfaces
#
# First call:
# status = gen_surface(mesh=mesh) - Initialisation
# Subsequent calls
# yi = gen_surface(period=period, last=last, xi=xi)
#
# period - Set to 1 if the surface is period... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para TV3
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
#import urlparse,urllib2,urllib,re
#import os
#from core import ... |
from rally.plugins.openstack.scenarios.authenticate import authenticate
from tests.unit import test
import mock
AUTHENTICATE_MODULE = (
"rally.plugins.openstack.scenarios.authenticate.authenticate")
class AuthenticateTestCase(test.ScenarioTestCase):
def test_keystone(self):
scenario_inst = authent... |
# encoding: utf-8
import os
import pytest
import csvkit as csv
from collections import defaultdict
def iterate_files(directory, file_extension=None):
""" Iterate all files in folder an subfolders
:param directory: Path to base dir to start iterating from
:param file_extension: "csv" or ".csv"
... |
from django.core.urlresolvers import reverse_lazy
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from picklefield import PickledObjectField
from datahub.helpers.validators import start_with_letter_validator, contains_only_letters_dash_underscore_validator... |
"""PersistentIdentifier store and registration.
Usage example for registering new identifiers::
from flask import url_for
from invenio_pidstore.models import PersistentIdentifier
# Reserve a new DOI internally first
pid = PersistentIdentifier.create('doi','10.0572/1234')
# Get an already reserve... |
"""Unit tests for the ``activation_keys`` paths."""
import httplib
from fauxfactory import gen_integer, gen_string
from nailgun import client, entities
from requests.exceptions import HTTPError
from robottelo.decorators import rm_bug_is_open, skip_if_bug_open
from robottelo.helpers import get_server_credentials, valid... |
from collections import OrderedDict
from typing import Any, Dict
from ...common.params import pop_choice
from ..backend import CollapseToBatch, ExpandFromBatch, Squeeze
from .word_overlap_tuple_matcher import WordOverlapTupleMatcher
class WordTokenTupleMatcher:
"""
``WordTokenTupleMatchers`` operate on tuple... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from .. import models
if TYPE_CHECKING:
... |
import os
import sys
import unittest
import settestpath
import logging
import yum.logginglevels as logginglevels
new_behavior = "NEW_BEHAVIOR" in os.environ.keys()
from yum import YumBase
from yum import transactioninfo
from yum import packages
from yum import packageSack
from yum.constants import TS_INSTALL_STATES,... |
"""
Select a region of the graph.
ginput_rect(ax) selects a region from the axes and continues with the plot.
s = BlockingRectangleSelector(ax) adds a rectangle selector to the axes and
lets the script call s.select() whenever a new region is needed.
demo() shows the selector in action.
"""
from matplotlib.pyplot im... |
# -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
import zipfile
import tarfile
import socket
import fcntl
import struct
def verify_port(port):
'''Raise Type Error if port is not an integer.
Raise ValueError if port is an invlid integer value.
'''
if type(port) !=... |
#!/usr/bin/env python3
"""
Exploit the timing sidechannel in a
stupid login website.
"""
import random
import requests
import string
import sys
import time
# check time with fudge factor
def longerThan(t1, t2, fudge=0.01):
"""
check time length with a fudge factor
"""
if abs(t1 - t2) < fudge:
... |
"""
Creates superformula samples using two variables.
Author(s): Jonah Chazan (<EMAIL>), Wei Chen (<EMAIL>)
"""
import numpy as np
import math
def get_sf_parameters(variables, alpha, beta):
'''
v[0]: s
v[1]: t
'''
parameters = []
for v in variables:
# Set [w, h, m, n1,... |
import unittest
from telemetry.core import exceptions
from telemetry.core import util
from telemetry import decorators
from telemetry.internal.actions import page_action
from telemetry.page import action_runner as action_runner_module
from telemetry.testing import tab_test_case
from telemetry.timeline import model
fro... |
#!/usr/bin/env python
"""
Minard's data from Napoleon's 1812-1813 Russian Campaign.
http://www.math.yorku.ca/SCS/Gallery/minard/minard.txt
"""
# Copyright (C) 2006-2016 by
# Aric Hagberg <<EMAIL>>
# Dan Schult <<EMAIL>>
# Pieter Swart <<EMAIL>>
# All rights reserved.
# BSD license.
import string
i... |
'''ofonod D-BUS mock template'''
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version. See http://www.gnu.org/copylef... |
#!/usr/bin/env python
from suds.transport.https import HttpAuthenticated
from suds.client import Client
from suds import WebFault
import logging
from suds.sax.text import Raw
url = 'https://service.dashcs.com/dash-api/soap/emergencyprovisioning/v1?wsdl'
transport = HttpAuthenticated(username='mah', password='70f55b... |
import unittest
from collections import OrderedDict
from math import exp, log
from pyfluka.base import IllegalArgumentError
from pyfluka.utils import ureg
from pyfluka.base.StoredData import StoredData
from pyfluka.plugins.TimeEvolution import TimeEvolution
from pyfluka.reader import _dh
from pyfluka.utils import Phy... |
from ...template.session.participatingSessionsContentGridsData import ParticipatingSessionsContentGridsData
from ...utility import generateRandomString, generateGridTable
from ...template.gridTableData import GridTableData
from ...models import ResponseGrid
class ParticipatingSessionsContentData(object):
i... |
#Routines for building part objects from eagle board files
from pint import UnitRegistry
from pymomo.exceptions import *
from pymomo.utilities.typedargs import type_system
from ..package import Pad, Pin, Package, Placement
ureg = UnitRegistry()
def part_from_board_element(elem, variant, packages):
"""
Create a Par... |
# wx tutorial menu, toolbar
# Show a frame with menu bar, toolbar, status bar, pop menu
import wx
# popup menu class
class MyPopupMenu(wx.Menu):
def __init__(self, parent):
super(MyPopupMenu, self).__init__()
self.parent = parent
mmi = wx.MenuItem(self, wx.NewId(), 'Minimize')
se... |
# Imports
import pygame
# Import game states
import escmenu
import end
import game
import options
import mainmenu
import button
import translate
import menumusic
import config
import database
import questions
import checkbox
import textbox
import player
import highscores
import listbox
import serverlist
import instruc... |
"""
django-guardian helper functions.
Functions defined within this module should be considered as django-guardian's
internal functionality. They are **not** guaranteed to be stable - which means
they actual input parameters/output type may change in future releases.
"""
from __future__ import unicode_literals
import ... |
"""Unittest for the util/regexp/re2/unicode.py module."""
import os
import StringIO
from google3.pyglib import flags
from google3.testing.pybase import googletest
from google3.util.regexp.re2 import unicode
_UNICODE_DIR = os.path.join(flags.FLAGS.test_srcdir, "google3", "third_party",
"uni... |
"""
a script which produces a product from sources.
REQUIREMENTS:
1. specify the location of the docroot.
2. specify the location of the libs.
3. byte-compile the libs, if any.
4. prompt for dependencies, services, product name,
version, author, (etc.), format.
5. produce and save the archive file.
TODO:
* add e... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
dataobject.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
from picamera import PiCamera
from time import sleep
import threading
import os
class camera:
def __init__(self):
#testing only
self.camera="camera"
self.count=0
self.w=2592
self.h=1944
self.busy=False
def takeShot(self):
#t=threading.Thread(target=self.... |
from django.shortcuts import render
from organization.projects.models import *
from organization.core.views import *
from cartridge.shop.models import Product
class CustomProductDetailView(SlugMixin, DetailView):
model = Product
template_name='shop/product/product_detail.html'
def get_context_data(... |
"""Init."""
from wtforms.utils import unset_value
from .abstract import *
from .date import *
from .doi import *
from .file_upload import *
from .issn import *
from .jinja import *
from .journal import *
from .keywords import *
from .language import *
from .notes import *
from .pages_number import *
from .publisher i... |
from zope.interface import Interface, Attribute
class IDroneDService(Interface):
"""Used to define service modules iterface"""
SERVICENAME = Attribute("""name of this service""")
SERVICECONFIG = Attribute("""a dictionary to hold service configuration""")
service = Attribute("""global service container ... |
"""MisraGries.py: Implements the Misra Gries algorithm for finding frequent
stream elements"""
import random
import collections
import argparse
class MisraGriesSketch:
"""MisraGriesSketch: supports iterating over a stream of data
estimating the frequency of high frequency items.
Instantiating the class in... |
"""
@author <EMAIL>
"""
import sys
import time
from trafficgenerator.tgn_utils import TgnError
from ixnetwork.ixn_object import IxnObject
class IxnRoot(IxnObject):
def __init__(self, **data):
super(IxnRoot, self).__init__(**data)
def get_ports(self):
"""
:return: dictionary {name:... |
import random
import numpy as np
from PIL import Image
def gray_pixels(img_path, resize=None):
""" Return the grayscale pixels of an image """
image = Image.open(img_path).convert('L')
if resize is not None:
image = image.resize(resize, Image.LANCZOS)
pixels = list(image.getdata())
re... |
"""
WSGI config for site1 project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... |
import mock
from oslo.config import cfg
from neutron.db import api as db
from neutron.extensions import providernet as provider
from neutron.openstack.common import importutils
from neutron.plugins.cisco.common import cisco_constants as const
from neutron.plugins.cisco.common import cisco_exceptions as cisco_exc
from... |
import os, sys, traceback
import Ice
import Ice
slice_dir = Ice.getSliceDir()
if not slice_dir:
print(sys.argv[0] + ': Slice directory not found.')
sys.exit(1)
Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
import AllTests
def test(b):
if not b:
raise RuntimeError('test assertion failed')
def r... |
# DEPRECATED, use --play flag to baselines.run instead
import click
import numpy as np
import pickle
from baselines import logger
from baselines.common import set_global_seeds
import baselines.her.experiment.config as config
from baselines.her.rollout import RolloutWorker
@click.command()
@click.argument('policy_fil... |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
print('TensorFlow version: %s' % tf.__version__)
import matplotlib.pyplot as plt
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', validation_size=0, one_hot=False)
img = mnist.train.images[2... |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sqlite3 as lite
import os
##############################################################
def createSimilarSequencesTable(cur):
cur.execute("CREATE TABLE SimilarSequences (\
QUERY_ID VARCHAR(60),\
SUBJECT_ID VARCHAR(60),\
QUERY_TAXON_ID V... |
import functools
from bst_node import BstNode
from test_framework import generic_test
from test_framework.binary_tree_utils import must_find_node
from test_framework.test_utils import enable_executor_hook
def pair_includes_ancestor_and_descendant_of_m(possible_anc_or_desc_0: BstNode,
... |
#!/usr/bin/env python3
"""
This module contains all the code used to test the testee module.
"""
import unittest
import csv
from os import remove
from os.path import realpath, dirname, join, isfile
from auxi.tools.materialphysicalproperties import core as testee
__version__ = '0.3.2'
__license__ = 'LGPL v3'
__copy... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest.mock as mock
import pytest
from kittengroomer import FileBase, KittenGroomerBase
from kittengroomer.helpers import ImplementationRequired
skip = pytest.mark.skip
xfail = pytest.mark.xfail
fixture = pytest.fixture
class TestFileBase:
@fix... |
from __future__ import absolute_import
from __future__ import print_function
from copy import copy
from operator import itemgetter, attrgetter
from uncertainties import ufloat, std_dev, nominal_value
from pychron.core.helpers.isotope_utils import sort_detectors
from pychron.core.helpers.iterfuncs import groupby_key
... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=1>
# Time extracting points from triangular grid ocean model
# <markdowncell>
# Exploring the answer to this stackoverflow question:
# http://stackoverflow.com/questions/26788112/easy-scriptable-way-to-sub-sample-unstructured-thredds-data
... |
import sys
import os
import numpy
import math
timeChunkSize = 0.0
resultDir = os.environ.get('RESULTS')
if resultDir == None :
print ("WARNING! $RESULTS not set! Attempt to write results will fail!\n")
fileInfo = sys.argv[1]
resultsPlace = resultDir+"/"+fileInfo+"/"
if not os.path.exists(resultsPlace):
prin... |
#!/usr/bin/env python
"""Tests for grr_response_server.flows.general.filetypes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import os
from absl import app
from grr_response_client.client_actions import plist
from grr_response_core.lib.rdfvalues im... |
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 DeleteBloodPressureLog(Choreography):
def __init__(self, temboo_session):
"""
... |
"""
Shared GUI widgets
"""
import gio
import glib
import gobject
import gtk
from urllib2 import urlparse
from xl import (
common,
covers,
playlist,
settings,
trax
)
from xlgui.guiutil import get_workarea_size
from xlgui import icons
class AttachedWindow(gtk.Window):
"""
A window a... |
"""
Views for managing volumes.
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from horizon import api
from horizon import forms
from horizon import exceptions
from horizon import messag... |
import httplib2
import logging
from airflow.hooks.base_hook import BaseHook
from airflow.utils import AirflowException
from oauth2client.client import SignedJwtAssertionCredentials, GoogleCredentials
class GoogleCloudBaseHook(BaseHook):
"""
A base hook for Google cloud-related hooks. Google cloud has a shared... |
"""tests/test_exceptions.py.
Tests to ensure custom exceptions work and are formatted as expected
Copyright (C) 2016 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software withou... |
try:
import ujson as json
except ImportError:
import json
import logging
try:
# Test for mypy support (requires Python 3)
from typing import List, Text
except:
pass
class Encoder(object):
"""
An encoder for the Collectd JSON format
See https://collectd.org/wiki/index.php/JSON
Sa... |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# A first Python script
# import sys # Load a library module
#
# print(sys.platform)
# print(2 ** 100) # Raise 2 to a power
# x = 'Spam!'
# print(x * 8) # String repetition
# ๅฐๆ็ๆ็ปฉไปๅปๅนด็72ๅๆๅๅฐไบไปๅนด็85ๅ๏ผ่ฏท่ฎก็ฎๅฐๆๆ็ปฉๆๅ็็พๅ็น๏ผๅนถ็จๅญ็ฌฆไธฒๆ ผๅผๅๆพ็คบๅบ'xx.x%'๏ผๅชไฟ็ๅฐๆฐ็นๅ1ไฝ๏ผ
# s1 = 72
# s2 = 85
# r =... |
from typing import TYPE_CHECKING
from ...file_utils import _BaseLazyModule, is_tokenizers_available, is_torch_available
_import_structure = {
"configuration_wav2vec2": ["WAV_2_VEC_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Wav2Vec2Config"],
"feature_extraction_wav2vec2": ["Wav2Vec2FeatureExtractor"],
"processing... |
#!/usr/bin/env python
from datetime import datetime, time, timedelta
import dateutil.parser
import mycredentials, mysettings
from mysettings import MySettings
import MySQLdb, MySQLdb.cursors
from contextlib import closing
import json
TIME_FORMAT = "%d/%m/%y %H:%M"
def getLatestStatus():
db = MySQLdb.connect(mycrede... |
# Program make a simple calculator that can add, subtract, multiply and divide using functions
# define functions
def add(x, y):
"""This function adds two numbers"""
return x + y
def subtract(x, y):
"""This function subtracts two numbers"""
return x - y
def multiply(x, y):
"""This function multiplie... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import six
from datetime import datetime
from sys import platform
from pelican.tests.support import unittest, get_settings
from pelican.contents import Page, Article, URLWrapper
from pelican.settings import DEFAULT_CONFIG
from pelican.u... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import signals
from django.utils.translation import ugettext_lazy as _
from moocng.courses.models import Course
from moocng.externalapps.exceptions import Insta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.