gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
if len(sys.argv) > 1:
sys.path.insert(0, sys.argv.pop(1))
import unittest
import viennagrid.wrapper
##################
# LINEAR DOMAINS #
##################
class TestLinearCartesian1D_Segmentation(unittest.TestCase):
def setUp(self):
self.vertices = [
... | |
# -*- coding: utf-8 -*-
from twisted.enterprise import adbapi
from sqlite3 import Row
class Table(object):
modified = None
cursor = None
schema = None
joindata = None
fielddata = None
def __init__(self, *args, **kwargs):
self.modified = set()
self.attributes = [('id', None, int)] + self.attributes
se... | |
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
This module is used to cache per-collection field information.
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2018, G. Klyne"
__license__ = "MIT (http://opensource.org/licen... | |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
"""archvyrt provisioner base module"""
# stdlib
import logging
import os
import subprocess
# archvyrt
import archvyrt.tools as tools
LOG = logging.getLogger(__name__)
class Provisioner:
"""
Base provisioner for domain
"""
def __init__(self, domain):
"""
Initialize provisioner
... | |
"""A kernel manager for multiple kernels"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import
import os
import uuid
import zmq
from traitlets.config.configurable import LoggingConfigurable
from ipython_genutils.importstring i... | |
import os, glob, shutil, traceback
import PIL_Helper
TYPE, TITLE, COLOR, VALUE, FLAVOR = range(5)
DIRECTORY = "BaBOC"
PAGE_WIDTH = 3
PAGE_HEIGHT = 3
TOTAL_CARDS = PAGE_WIDTH*PAGE_HEIGHT
workspace_path = os.path.dirname("workspace")
card_set = os.path.dirname("deck.cards")
CardPath = "BaBOC/cards/"
ResourcePath = "... | |
# Class definition:
# SiteInformation
# This class is responsible for downloading, verifying and manipulating queuedata
# Note: not compatible with Singleton Design Pattern due to the subclassing
import os
import re
import commands
import urlparse
from pUtil import tolog, getExtension, replace, readpar, getDirec... | |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from streampy import Stream
from streamcollector import Collector
from compatibility import _comparer
import unittest
class CreationTest(unittest.TestCase):
def test_create_stream_without_params(self):
s = Stream()
self.assertEquals(0, s.size())
def test_create_stream_with_list_params(self):
... | |
import sys
import threading
import os
import ast
import imp
import inspect
import ctypes
import socket
import json
import re
import traceback
import ltipy
import time
import asyncore
import signal
import lttools
oldout = sys.stdout
olderr = sys.stderr
stop = False
local = True
threads = []
currentClient = 0
class Pri... | |
__author__ = 'cmantas'
from CassandraNode import CassandraNode as Node, get_script_text
from CassandraNode import get_all_nodes
from VM import Timer, get_all_vms
from time import sleep
from json import loads, dumps
from os import remove
from os.path import isfile
orchestrator = None
seeds = [] # the seed node(s)... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
# -*- coding: latin-1 -*-
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary... | |
##########################################################################
#
# Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | |
## @file
# This file is used to define class objects of INF file [Guids] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License wh... | |
# coding=utf-8
import re
_RE_FIND_FIRST_CAP = re.compile('(.)([A-Z][a-z]+)')
_RE_SPAN_OF_CAPS = re.compile('([a-z0-9])([A-Z])')
def camelcase_to_underscore(name):
return _RE_SPAN_OF_CAPS.sub(r'\1_\2',
_RE_FIND_FIRST_CAP.sub(r'\1_\2', name)
).lower(... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generate a sitemap for osf.io"""
import boto3
import datetime
import gzip
import os
import shutil
import urlparse
import xml
import django
django.setup()
import logging
import tempfile
from framework import sentry
from framework.celery_tasks import app as celery_app
fr... | |
# Copyright (c) 2006-2007 Open Source Applications Foundation
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com>
# Copyright (c) 2009 Domen Kozar <domen@dev.si>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP 9 soft forks.
Connect to a single node.
regtest lock-in with 108/144 block signalling
activat... | |
# This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://... | |
"""
a series of tests which assert the behavior of moving objects between
collections and scalar attributes resulting in the expected state w.r.t.
backrefs, add/remove events, etc.
there's a particular focus on collections that have "uselist=False", since in
these cases the re-assignment of an attribute means the prev... | |
import logging
import time
import Queue
import threading
import sys
from Tkinter import *
from pystates import StateMachine
if sys.platform=='linux2':
from neopixel import *
import math
import random
class NullClass:
def set(self,state):
pass
class QuickChange:
def __init__(self, handle_pixel):
self.... | |
"""Test AdaNet summary single graph implementation for TF 2.
Copyright 2019 The AdaNet Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/lice... | |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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
(at your option) any later version.
T... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
from collections import OrderedDict
import sys
import json
import random
import numpy as np
import tensorflow as tf
from opts import distributed
from opts.sgd_opt import SgdOpt
from opts.momentum_opt import MomentumOpt
from opts.adam_opt import AdamOpt
from opts.adamng_opt import AdamNGOpt
from opts.rnnprop_opt impor... | |
from __future__ import unicode_literals
import datetime
from decimal import Decimal
import unittest
import warnings
from django import test
from django import forms
from django.core.exceptions import ValidationError
from django.db import connection, models, IntegrityError
from django.db.models.fields import (
Aut... | |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helpers related to multiprocessing."""
import atexit
import builtins
import itertools
import logging
import multiprocessing
import multiprocessing.dummy
i... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, Inc.
# All Rights Reserved.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
import numpy as np
from .utils import expand_array
import os
import json
from pkg_resources import resource_stream, Requirement
DEFAULT_START_YEAR = 2013
class Parameters(object):
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
PARAM_FILENAME = "params.json"
params_path = os.path.join(CUR_PATH, PA... | |
#!/usr/bin/env python
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | |
from test.support import run_unittest, check_warnings
import cgi
import os
import sys
import tempfile
import unittest
from io import StringIO, BytesIO
class HackedSysModule:
# The regression test will have real values in sys.argv, which
# will completely confuse the test of the cgi module
argv = []
std... | |
# -*- coding: utf-8 -*-
import os
import sys
import cv2
import numpy as np
from datetime import datetime
from keras.optimizers import SGD
from keras.layers import Input, merge, ZeroPadding2D
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.convolutional import Convolution2D
from keras.layers.... | |
"""
file: components.py
author: Yoann Dupont
MIT License
Copyright (c) 2018 Yoann Dupont
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 ri... | |
#stdlib imports
import errno, stat, time, subprocess, os
from pathlib import Path
#project imports
from . import elektra_util
from .elektra_util import *
startup_time = time.time()
#the following methods map 1:1 to the FUSE interface
#returns a map containing file attributes, i.e. the result of the stat command
def... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
from io import BytesIO
import PIL.Image
import PIL.ImageDraw
import wand.image
from . import utils
from .table import TableFinder
class COLORS(object):
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
TRANSPARENT = (0, 0, 0, 0)
DEFAULT_FILL = COLORS.BLUE + (50,)
DEFAULT_STROKE = COLORS.RED... | |
# coding: utf-8
"""
KubeVirt API
This is KubeVirt API an add-on for Kubernetes.
OpenAPI spec version: 1.0.0
Contact: kubevirt-dev@googlegroups.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Virtua... | |
import collections
import dask.dataframe as dd
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis.udf.vectorized import analytic, elementwise, reduction
from ..udf import nullable
# --------
# Fixtures
... | |
from conans.model.options import Options, PackageOptions, OptionsValues
from conans.model.requires import Requirements
from conans.model.build_info import DepsCppInfo
from conans import tools # @UnusedImport KEEP THIS! Needed for pyinstaller to copy to exe.
from conans.errors import ConanException
from conans.model.en... | |
from __future__ import unicode_literals
import warnings
from django.db import models
from django.db.utils import DatabaseError
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.test.utils import isolate_apps
from django.utils.deprecation import RemovedInDjan... | |
#!/usr/bin/python
import json
import boto3
import sys
import time
import timeit
from datetime import datetime, timedelta
# Pretty print a JSON object - for debugging
def pretty(d, indent=0):
for key, value in d.iteritems():
print '\t' * indent + str(key)
if isinstance(value, dict):
p... | |
from datetime import datetime
import re
import traceback
import warnings
import numpy as np
import pandas as pd
from collections import defaultdict
from pandas.tslib import OutOfBoundsDatetime
from .core import indexing, ops, utils
from .core.formatting import format_timestamp, first_n_items
from .core.variable impor... | |
"""Local Media Source Implementation."""
from __future__ import annotations
import logging
import mimetypes
from pathlib import Path
import shutil
from aiohttp import web
from aiohttp.web_request import FileField
import voluptuous as vol
from homeassistant.components import http, websocket_api
from homeassistant.com... | |
"""
Make sure that Pipe and Pipeline classes work
TODO: Make below code work
if not len_pipe.has_next():
break
"""
from django.test import override_settings
from django.test import TestCase
from ozpcenter.recommend.graph_factory import GraphFactory
from ozpcenter.recommend import recommend_utils
from ozpcenter.pi... | |
# encoding: utf-8
# Copyright 2013 maker
# License
#-*- codeing: utf-8 -*-
import simplejson as json
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User as DjangoUser
from maker.core.models import User, Group, ... | |
import os
import re
import numpy as np
from multiprocessing import Process
#from matplotlib.pyplot import plot, show
import tensorflow as tf
from tensorflow.python.client import timeline
import tensorflow.contrib.slim as slim
from . import util
from ..ops import forward_warp
from .image_warp import image_warp
from .u... | |
# Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import errno
import subprocess
import time
import os
import pprint
import urllib.parse, urllib.request
import shutil
import traceback
import asyncore
from http.server import HTTPServer, SimpleHTTPReq... | |
#!/usr/bin/env python2.5
#
# Copyright 2010 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | |
"""The tests for the automation component."""
import asyncio
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.core import State
from homeassistant.setup import setup_component, async_setup_component
import homeassistant.components.automation as automation
from homeassis... | |
# -*- coding: utf-8 -*-
#
# ChainerCV documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 3 16:38:20 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
from __future__ import unicode_literals
import os
import logging
import random
import sys
from classification.rext.kernelmodels import ReModel
from subprocess import Popen, PIPE
import platform
import itertools
import codecs
from classification.results import ResultsRE
from config import config
from text.pair import P... | |
'''
Copyright 2016, EMC, Inc.
Author(s):
George Paulos
This script initializes RackHD stack after install.
- loads SKU packs
- loads default SKU
- sets auth user
- restarts nodes for discovery
- discovers switches and/or PDUs if available
- checks node discovery
- assigns node OBM settings... | |
"""Emulated fixed-point arithmetic, also useful for quires.
"""
from ..titanic import digital
from ..titanic import gmpmath
from ..fpbench import fpcast as ast
from ..titanic.ops import OP
from . import evalctx
from . import mpnum
from . import ieee754
from . import posit
from . import fixed
from . import interpreter... | |
import argparse
import logging
import os
from ceph_deploy import hosts
from ceph_deploy.cliutil import priority
from ceph_deploy.lib import remoto
from ceph_deploy.util.constants import default_components
from ceph_deploy.util.paths import gpg
LOG = logging.getLogger(__name__)
def sanitize_args(args):
"""
a... | |
#!/usr/bin/env python
import sys
import struct
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from cmapdb import CMapDB, CMapParser, FileUnicodeMap, CMap
from encodingdb import EncodingDB, name2unicode
from psparser import PSStackParser
from psparser import PSEOF
from pspa... | |
import itertools
import operator
import sys
if sys.version_info[0] != 3:
from functools import reduce
from functools import wraps
from peewee import *
from playhouse.tests.base import compiler
from playhouse.tests.base import database_initializer
from playhouse.tests.base import log_console
from playhouse.tests.ba... | |
import os
from django.test import TransactionTestCase
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from rest_framework.exceptions import ValidationError as DRF_ValidationError
from hs_core.testing import MockIRODSTestCaseMixin
from hs_core import hydroshare
from hs_... | |
__author__ = "Martin Pilat"
import sys
import time
import joblib
import pprint
import os
import ml_metrics as mm
import numpy as np
import pandas as pd
from sklearn import cross_validation, preprocessing, decomposition, feature_selection, metrics
import networkx as nx
import custom_models
import utils
import inspec... | |
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import os
import re
import types
from optparse import OptionValueError
from subprocess import PIPE
from tim... | |
# Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
<<<<<<< HEAD
<<<<<<< HEAD
from test.support import TESTFN
import unittest
from test import audiotests
from audioop import byteswap
import sys
import sunau
class SunauTest(audiotests.AudioWriteTests,
audiotests.AudioTestsWithSourceFile):
module = sunau
class SunauPCM8Test(SunauTest, unittest.Test... | |
'''
Created on 17.03.2016
@author: stefan
'''
import unittest
from lenatu import tools
import lenatu
import ast
class TestScope(unittest.TestCase):
def setUp(self):
self.cache = {}
def test_module_global(self):
src = """
x = 1
"""
self.assertSame(src,
... | |
import single_robot_behavior
import behavior
import constants
import robocup
import main
from enum import Enum
import math
import planning_priority
## The Defender behavior positions a robot on a certain area of the field and defends it
class Defender(single_robot_behavior.SingleRobotBehavior):
class State(Enum):... | |
import unittest
class FakeRecord(object):
def __init__(self, msg, extra={}):
self.msg = msg
for k, v in extra.items():
setattr(self, k, v)
class StatzHandlerTests(unittest.TestCase):
def cls(self):
from statzlogger import StatzHandler as cls
return cls
de... | |
#!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
"""Wrapper for `tlgu` command line utility.
Original software at: ``http://tlgu.carmen.gr/``.
TLGU software written by Dimitri Marinakis and available at
`<http://tlgu.carmen.gr/>`_ under GPLv2 license.
TODO: the arguments to ``convert_corpus()`` need some rationalization, and
``divide_works()`` should be incorporat... | |
import math
import sys
import random
DEBUG = False
#------- Some "Helper" functions ---------------
# Segregating out instances that take a particular value
# attributearray is an N x 1 array.
def segregate(attributearray, value):
outlist = []
for i in range(0, len(attributearray)):
if(attributearray... | |
#!/usr/bin/env python
from glob import glob
import os
import numpy
import pyfits
import matplotlib
from matplotlib import pyplot
from matplotlib import cm
from numpy import log, log10, exp, power, pi
from numpy.polynomial.chebyshev import Chebyshev
from scipy.stats import scoreatpercentile
from scipy.special import ga... | |
import string
import random
import io
import pytest
import numpy as np
import validate_docstrings
validate_one = validate_docstrings.validate_one
from pandas.util.testing import capture_stderr
class GoodDocStrings(object):
"""
Collection of good doc strings.
This class contains a lot of docstrings that... | |
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | |
# Copyright 2016 NOKIA
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | |
"""Arcam media player."""
import logging
from arcam.fmj import DecodeMode2CH, DecodeModeMCH, IncomingAudioFormat, SourceCodes
from arcam.fmj.state import State
from homeassistant import config_entries
from homeassistant.components.media_player import BrowseMedia, MediaPlayerEntity
from homeassistant.components.media_... | |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
The descriptors used to define generated elements of the mojo python bindings.
"""
import array
import itertools
import struct
import mojo.bindings.ref... | |
import re
from jsonschema import _utils
from jsonschema.exceptions import FormatError, ValidationError
from jsonschema.compat import iteritems
def patternProperties(validator, patternProperties, instance, schema):
if not validator.is_type(instance, "object"):
return
for pattern, subschema in iterite... | |
# coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
impor... | |
# Copyright 2010 Hakan Kjellerstrand hakank@gmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
"""Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
Example of invocation (use to test the script):
python makerelease.py --platform=msvc6,msvc71,msvc80,msvc90,mingw -ublep 0.6.0 0.7.0-dev
When testing this script:
python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,min... | |
"""
N.B. this is a v2 of the distortions_corrector started in Dec 2017 -MAR
This file contains the Distortions_corrector.
An object used to correct distortions using an interactive procedure
involving repeated measurements.
"""
from qcodes.instrument.base import Instrument
from qcodes.instrument.parameter import Man... | |
# Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | |
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky
# 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 must retain the above copyright notice, this
# list of condit... | |
#!/usr/bin/python
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
DOCUMENTATION = '''
---
module: monasca_alarm_definition
short_description: crud operations on Monasca alarm definitions
description:
- Performs crud operations (create/update/delete) on monasca alarm definitions
- Monasca project... | |
# Written by Bram Cohen
# see LICENSE.txt for license information
# For a description of the algorithm see https://wiki.theory.org/BitTorrentSpecification#Choking_and_Optimistic_Unchoking.
from random import randrange
class Choker:
def __init__(self, max_uploads, schedule, done = lambda: False, min_uploads = Non... | |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozil... | |
"""
Gimp image parser (XCF file, ".xcf" extension).
You can find informations about XCF file in Gimp source code. URL to read
CVS online:
http://cvs.gnome.org/viewcvs/gimp/app/xcf/
\--> files xcf-read.c and xcf-load.c
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field im... | |
# -*- coding: utf-8 -*-
import copy
import functools
from rest_framework import status as http_status
import json
import logging
import os
from flask import request, make_response
from mako.lookup import TemplateLookup
from mako.template import Template
import markupsafe
from werkzeug.exceptions import NotFound
impor... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | |
import logging
from io import BufferedReader
import bigchaindb_driver as bd
import prov.graph as provgraph
import prov.model as provmodel
from bigchaindb_driver import pool as bdpool
from networkx import is_directed_acyclic_graph
from networkx import isolates
from networkx import topological_sort
from prov2bigchaindb... | |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | |
from tornado.escape import json_decode, utf8, to_unicode, recursive_unicode, native_str
from tornado.iostream import IOStream
from tornado.template import DictLoader
from tornado.testing import LogTrapTestCase, AsyncHTTPTestCase
from tornado.util import b, bytes_type, ObjectDict
from tornado.web import RequestHandler, ... | |
################################
#### MOCK FUNCTIONS MACROS #####
################################
def defaultMacros(numargs):
ret = ''
for j in range(0,numargs):
ret += '`undef ARG%0d``_NODEFAULT \\\n' % (j)
ret += '`undef ARG%0d``_``DEF%0d \\\n' % (j,j)
ret += '`undef NAME``_``ARG%0d``_``DEF%0d \\\n'... | |
"""
lexington.regex
===============
Lexington's lexers operate using the derivative of a regular expression.
Python's regular expressions as implemented in the `re` module are not
actually regular expressions, and probably wouldn't give you access to their
derivatives even if they were. So, this implementation is neces... | |
#!/usr/bin/env python
# Copyright (c) 2012 NTT DOCOMO, INC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | |
#!/usr/bin/env python
# Written by Bram Cohen and Uoti Urpala
from bisect import bisect
def unique_lcs(a, b):
# set index[line in a] = position of line in a unless
# unless a is a duplicate, in which case it's set to None
index = {}
for i in xrange(len(a)):
line = a[i]
if line in inde... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 12 12:48:33 2014
@author: ibackus
"""
# DEBUGGING
import sys
# END DEBUGGING
# External modules
import pynbody
SimArray = pynbody.array.SimArray
import numpy as np
import scipy.interpolate as interp
import os
import cPickle as pickle
# ICgen modules
import calc_rho_zr
i... | |
# Copyright 2022 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
# Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.