gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import unicode_literals import re from django.db.models.constants import LOOKUP_SEP from django.db.models.fields import FieldDoesNotExist from django.db.models.lookups import Lookup from django.db.models.expressions import ExpressionNode, Col from django.utils import six gis_lookups = {} class GISLo...
from __future__ import division, unicode_literals from future.builtins import str from copy import copy from django.conf import settings from django.contrib.contenttypes.generic import GenericRelation from django.core.exceptions import ImproperlyConfigured from django.db.models import IntegerField, CharField, FloatFi...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 OpenStack 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/...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
# Copyright 2017 The Forseti Security 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 ap...
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
from sympy import (meijerg, I, S, integrate, Integral, oo, gamma, hyperexpand, exp, simplify, sqrt, pi, erf, sin, cos, exp_polar, polar_lift, polygamma, hyper, log, expand_func) from sympy.integrals.meijerint import (_rewrite_single, _rewrite1, meijerint_indefinite, _infla...
import os import shutil from unittesting import DeferrableTestCase, AWAIT_WORKER from SublimeLinter.tests.parameterized import parameterized as p from SublimeLinter.tests.mockito import ( contains, mock, unstub, verify, when, ) import sublime from SublimeLinter import lint from SublimeLinter.lint ...
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2018 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Collect/MOD10 """ # import general python modules import sys import os import numpy as np import pandas as pd import gdal import urllib import urllib2 fr...
from __future__ import absolute_import import logging import six from django.core.context_processors import csrf from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_protect from dja...
# coding: utf-8 # In[4]: import numpy as np import pandas as pd from sknn.mlp import Classifier, Layer from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import confusion_matrix from sklearn.metrics import log_loss from sklearn.metrics import precision_score from sklearn.metrics import f1_score fro...
from eLCS.Constants import cons from eLCS.Classifier import Classifier import random import copy class ClassifierSet(object): """This module handles all the classifier sets This includes the population, match set and correct sets along with mechanisms and heuristics that act on these sets. This cla...
# Copyright 2011 OpenStack Foundation # Copyright 2012 Justin Santa Barbara # # 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 # #...
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
# Copyright (c) 2012-2014 Andy Davidoff http://www.disruptek.com/ # # 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...
# __BEGIN_LICENSE__ # # Copyright (C) 2010-2013 Stanford University. # All rights reserved. # # __END_LICENSE__ import numpy as np import time from scipy.sparse.linalg.interface import LinearOperator from lflib.lightfield import LightField from lflib.imageio import save_image from lflib.linear_operators import Light...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import datetime import os import socket import struct import threading import time from abc import ABC, abstractmethod from contextlib import contextmanager from dataclasses import datacla...
import random import logging import numpy as np def kill_signal(recordings, threshold, window_size): """ Thresholds recordings, values above 'threshold' are considered signal (set to 0), a window of size 'window_size' is drawn around the signal points and those observations are also killed Return...
#!/usr/bin/env python # -*- coding: utf-8 -*- import imp import os from config import * import instances as inst import util def _prompt_config(lab, path): """Prompt for the lab configuration script""" files = [f for f in os.listdir(path) if f.endswith('.py')] files.sort() if len(files) == 1: ...
""" .. module:: Dispatcher :platform: Unix :synopsis: A useful module indeed. """ from __future__ import with_statement import logging import socket import time from Queue import Queue from itertools import groupby, ifilter, chain import collections try: import simplejson as json except ImportError: imp...
import os import warnings from tempfile import mkstemp import numpy as np from nipy.testing import assert_true, assert_equal, assert_raises, \ assert_array_equal, assert_array_almost_equal, funcfile, parametric from nipy.testing.decorators import if_templates from nipy.utils import templates, DataError from ni...
# coding=utf-8 # Copyright 2022 The Robustness Metrics 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 appli...
import f5 import f5.util import re from bigsuds import ServerError # Convert PoolMember objects into a list of address, port dictionaries def pms_to_addrportsq(poolmembers): """ Converts PoolMembers into a list of address, port dictionaries """ return [{'address': p._node.name, 'port': p._port} for p in poolm...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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.apac...
__version__ = "0.5.1" from collections.abc import Generator class Try_: _unhandled = () @staticmethod def set_unhandled(es=None): """Set a list of the unhandled exceptions. :param es: an iterable of exceptions or None >>> from operator import getitem >>> Try(getitem, []...
import unittest from bowling import BowlingGame # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 class BowlingTest(unittest.TestCase): def roll(self, rolls): [self.game.roll(roll) for roll in rolls] def roll_and_score(self, rolls): self.roll(rolls) return...
from subprocess import Popen, PIPE from os.path import expanduser from gi.repository import Gtk, Gdk import json import sys import time import os import getpass import argparse GPG_ERR_PASSPHRASE = "Bad session key" FILENAME = "entries" DIRECTORY = expanduser("~") + "/.sef" FULLPATH = DIRECTORY + "/" + FILENAME ...
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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 applicabl...
# Copyright 2013 Google Inc. All Rights Reserved. """Some general file utilities used that can be used by the Cloud SDK.""" import errno import hashlib import logging import os import shutil import sys import tempfile import time NUM_RETRIES = 10 # WindowsError only exists when running on Windows try: # pylint: ...
#!/usr/bin/env python # Usage: normalize_acl.py acl.config [transformation [transformation [...]]] # # Transformations: # all Apply all transformations. # 0 - dry run (default, print to stdout rather than modifying file in place) # 1 - strip/condense whitespace and sort (implied by any other transformation) # 2 - get ...
# -*- coding: utf-8 -*- import numpy as np import theano import theano.tensor as T import time import gzip import SupersenseDataReader import BIOF1Validation import keras from keras.models import Sequential from keras.layers.core import Dense, Flatten, Merge, Dropout from keras.optimizers import SGD, adadelta, RMSp...
from mock import patch from nose.tools import eq_ from helper import MockXPI from js_helper import _do_test_raw import validator.xpi as xpi from validator import submain from validator.testcases import content from validator.errorbundler import ErrorBundle from validator.chromemanifest import ChromeManifest from vali...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (...
import logging import random import threading import time from plumbum.commands import BaseCommand, run_proc from plumbum.commands.processes import ProcessExecutionError from plumbum.machines.base import PopenAddons class ShellSessionError(Exception): """Raises when something goes wrong when calling :func:`S...
# 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, software # d...
# coding=utf-8 """ The ELB collector collects metrics for one or more Amazon AWS ELBs #### Configuration Below is an example configuration for the ELBCollector. You can specify an arbitrary amount of regions ``` enabled = true interval = 60 # Optional access_key_id = ... secret_access_key = ......
#!/usr/bin/env python """ Notes on writing new test files: -------------------------------- A test file can contain anything, but usually it is similar to a regular input file (defining a test problem), with a mandatory Test class. This class holds all the test_* functions, as well as the from_conf(), which serves to ...
# Copyright 2017 Google Inc. # # 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,...
''' This Python program parses forms to extract the field names and values. Name: Parse Forms Creator: Matt Gagnon <mattjgagnon@gmail.com> Created: 2012-05-04 Revised: Version: 1.0 Python: 2.6 To do: Execution: fetch a web page with form(s) on it ...
import os import datetime from nose.tools import eq_ import mock import amo import amo.tests from addons import cron from addons.models import Addon, AppSupport from django.core.management.base import CommandError from files.models import File, Platform from lib.es.management.commands.reindex import flag_database, un...
#!/usr/bin/env python """usage: %prog [options] filename Parse a document to a tree, with optional profiling """ import sys import os import traceback from optparse import OptionParser from html5lib import html5parser, sanitizer from html5lib.tokenizer import HTMLTokenizer from html5lib import treebuilders, serializ...
# This is a minimal implementation of the CloudSigma resources # TODO for a full CS implementation define resources for all API resrources + the attachment points of disks and nics. import cloudsigma import time # to sleep import json # to parse the meta so it can be added as an object import base64 # for cloudini...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
import ccd from datetime import datetime, timedelta from functools import reduce, partial import itertools as it import logging import multiprocessing import numpy as np from operator import is_not import warnings import xarray ############################################################################ ## Auxilary F...
import unittest import troposphere.rds as rds from troposphere import If, Parameter, Ref class TestRDS(unittest.TestCase): def test_it_allows_an_rds_instance_created_from_a_snapshot(self): rds_instance = rds.DBInstance( 'SomeTitle', AllocatedStorage=100, DBInstanceClas...
scene.run("BehaviorSetCommon.py") def setupBehaviorSet(): print "Setting up behavior set for gestures..." #scene.loadAssetsFromPath("behaviorsets/MocapReaching/skeletons") #scene.loadAssetsFromPath("behaviorsets/MocapReaching/motions") scene.addAssetPath("script", "behaviorsets/MocapReaching/scripts") # map the z...
# -*- coding: utf-8 -*- # Import python libs import sys import re # Import Salt Testing libs from salttesting import skipIf, TestCase from salttesting.helpers import ensure_in_syspath from salttesting.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch ensure_in_syspath('../../') # Import salt libs from salt.modul...
from StringIO import StringIO import pickle import sys import gc import copy from os import path from numpy.testing import * from numpy.testing.utils import _assert_valid_refcount from numpy.compat import asbytes, asunicode, asbytes_nested import numpy as np if sys.version_info[0] >= 3: import io StringIO = io...
# Copyright (c) 2012 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
# coding:utf-8 __author__ = "seerjk" # import import MySQLdb as mysql db_user = 'root' db_pwd = 'redhat' db_name = 'jiangkun' db_host = '127.0.0.1' db_port = 3306 def execute(sql_str): # connect db = mysql.connect(user=db_user, passwd=db_pwd, db=db_name, host=db_host, port=db_port) db.autocommit(True) ...
# Copyright (c) 2012 NetApp, Inc. All rights reserved. # Copyright (c) 2014 Ben Swartzlander. All rights reserved. # Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Clinton Knight. All rights reserved. # Copyright (c) 2014 Alex Meade. All rights reserved. # Copyright (c) 2014 Andrew Ker...
# 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 with the License. You may obtain # a ...
# Copyright 2016 gRPC 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 writing...
# --------------------------------------------------------------------- # # Copyright (c) 2012 University of Oxford # # 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, incl...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # 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 ...
# Copyright 2017 Capital One Services, LLC # Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from .common import BaseTest, functional # datapipeline is not available in us-east-2 where we run our functional tests # so we do a forced override here. REGION = "us-west-2" class DataPipelineT...
#!/usr/bin/env python3 # Copyright 2018 The Kubernetes 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 appl...
import argparse import json from pprint import pprint from sphinxarg.parser import parse_parser, parser_navigate def test_parse_options(): parser = argparse.ArgumentParser() parser.add_argument('--foo', action='store_true', default=False, help='foo help') parser.add_argument('--bar', action='store_true', ...
# encoding=utf8 """ Tests for the API """ from django.conf import settings from django.core.urlresolvers import reverse from django.test.client import Client from django.test import TestCase from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.models import User from django.contrib.auth.models...
class Stats(object): """ Object for building query params for a global email statistics request """ def __init__( self, start_date=None): """Create a Stats object :param start_date: Date of when stats should begin in YYYY-MM-DD format, defaults to None :type start_da...
from typing import Any, Dict import tensorflow as tf from keras import backend as K from keras.regularizers import l1 from .masked_layer import MaskedLayer class AdaptiveRecurrence: ''' This recurrence class peforms an adaptive number of memory network steps. This is performed in the AdaptiveStep layer....
import base64 import re import struct from hashlib import md5, sha1 from socket import error as socket_error from urllib import quote from gevent.pywsgi import WSGIHandler from geventwebsocket.websocket import WebSocketHybi, WebSocketHixie class WebSocketHandler(WSGIHandler): """Automatically upgrades the connec...
<<<<<<< HEAD <<<<<<< HEAD from test import support gdbm = support.import_module("dbm.gnu") #skip if not supported import unittest import os from test.support import verbose, TESTFN, unlink filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): ...
# # Copyright 2014, NICTA # # This software may be distributed and modified according to the terms of # the BSD 2-Clause license. Note that NO WARRANTY is provided. # See "LICENSE_BSD2.txt" for details. # # @TAG(NICTA_BSD) # '''This code manages the name mangling (and reversal of such) that needs to happen in the temp...
from pgmagick import _pgmagick __version__ = '0.5.5' def __init(): _pgmagick.InitializeMagick("./") __init() class Blob(_pgmagick.Blob): def __init__(self, *args): if len(args) == 1 and isinstance(args[0], str): _pgmagick.Blob.__init__(self) self.update(args[0]) else...
# Copyright 2013: Mirantis 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 b...
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2016 by Contributors # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Modified by Zheng Zhang # -------------------------------------------------------- impor...
# Copyright 2012-2013 Ravello Systems, Inc. # # 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 agree...
#!/usr/bin/env python import json import netaddr import os import openstack import subprocess CTLPLANE_NETWORK_NAME = 'ctlplane' CONF = json.loads(os.environ['config']) def _run_command(args, env=None, name=None): """Run the command defined by args and return its output :param args: List of arguments for t...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
#!/bin/env python #-*-coding:utf-8-*- import pymssql import string import sys import datetime import time reload(sys) sys.setdefaultencoding('utf8') import ConfigParser def get_item(data_dict,item): try: item_value = data_dict[item] return item_value except: pass def get_variables(con...
#Just a copy of the version in python 2.5 to be used if it's not available in jython 2.1 """Simple XML-RPC Server. This module can be used to create simple XML-RPC servers by creating a server and either installing functions, a class instance, or by extending the SimpleXMLRPCServer class. It can also be used to hand...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
#from SureteDuQuebec_PublicDataSystem import Exceptions import Exceptions from Exceptions import ErrorSureteDuQuebec #from SureteDuQuebec_PublicDataSystem.Exceptions import ErrorSureteDuQuebec #from Exceptions import ErrorSureteDuQuebec class DecoratorSQ: DictReference={ 'GlobalKeyNameAssertion':{ 'overwritt...
import os import re import json import urllib2 import urllib import csv, codecs, cStringIO import colander import locale import pytz from email.utils import parseaddr from types import ( IntType, LongType, ) from datetime import ( datetime, timedelta, ) from pyramid.threadlocal import get_curr...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.23 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import si...
#!/usr/bin/python # # Copyright 2013, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. import subprocess from vtdb import tablet3 from vtdb import topology from zk import zkocc import os import utils import tablet # single shard /...
#!/usr/bin/env python3 """ Script to upload 32 bits and 64 bits wheel packages for Python 3.3 on Windows. Usage: "python release.py HG_TAG" where HG_TAG is a Mercurial tag, usually a version number like "3.4.2". Requirements: - Python 3.3 and newer requires the Windows SDK 7.1 to build wheel packages - Python 2.7 re...
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import json import frappe.utils from frappe import _ class SignupDisabledError(frappe.PermissionError): pass no_cache = True def get_context(context): # get s...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
from common import find_mxnet import numpy as np import os, sys print sys.path import mxnet as mx import argparse parser = argparse.ArgumentParser(description="Train RNN on Penn Tree Bank", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--data-dir', type=s...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, Inc. # # 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 # #...
""" Minecraft server instance representation """ import asyncio import fileinput import glob import hashlib import json import logging import os import os.path import re import shlex import requests from . import errors class Server(object): """ A Minecraft server instance """ PROPERTIES_FILE ...
# 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 applicable law or ...
# -*- coding: utf-8 -*- # Copyright (C) 2017, 2018 """ Library used for backup and restore operations """ import subprocess import time import os import asyncio import json from enum import IntEnum from foglamp.common import logger from foglamp.common.storage_client import payload_builder from foglamp.common.storage...
import sys import socket import select import collections import json import errno import os.path try: import ssl assert ssl except ImportError: ssl = False try: from ... import editor from .. import api, cert, msg, shared as G, utils from ..exc_fmt import str_e from . import base, proxy ...
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- # # Copyright 2010 Google Inc. All Rights Reserved. """This is the interface for managing the foreman.""" import json import time from grr.gui import renderers from grr.gui.plugins import flow_management from grr.lib import aff4 from grr.lib import flow ...
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Christopher Lenz # Copyright (C) 2011 Matthew Good # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Mapping from raw JSON data structures to Python objects and vic...
# # Copyright (c) SAS Institute Inc. # # 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 w...
import unittest import numpy as np import os from fipy.tools import dump from scarce.testing import tools from scarce import constant from scarce import fields, geometry class TestFields(unittest.TestCase): @classmethod def tearDownClass(cls): os.remove('planar_mesh_tmp_2.msh') def test_w_pote...
import re import sys import copy import socket from datetime import datetime from decimal import Decimal from collections import Mapping, Container if sys.version_info[0] == 3: _str_type = str _int_types = (int,) else: _str_type = basestring _int_types = (int, long) class SchemaError(ValueError): ...
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Module containing comment model and comment related mixins.""" from sqlalchemy import case from sqlalchemy import orm from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import valid...
# Copyright 2014 OpenStack Foundation # # 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 w...
#!/usr/bin/env python3 # 556D_fug.py - Codeforces.com/problemset/problem/556/D Fug quiz by Sergey 2015 # Standard modules import unittest import sys import re # Additional modules import bisect ############################################################################### # Fastlist Class ##########################...
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib import itertools from functools import wraps from setuptools.extern import six from setuptools.extern.six.moves import urllib, http_client, configparser, map import setuptools from pkg_res...
from datetime import datetime, timedelta import json from rdr_service.clock import FakeClock from rdr_service import clock from rdr_service.code_constants import * from rdr_service.dao.biobank_order_dao import BiobankOrderDao from rdr_service.dao.participant_dao import ParticipantDao from rdr_service.dao.physical_meas...
# -*- coding: utf-8 -*- # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. """ This module is responsible to capture the compiler invocation of any build process. The result of that should be a compilat...
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
# -*- coding: utf-8 -*- ''' FanFilm Add-on Copyright (C) 2015 lambda 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 ...
#!/usr/bin/env python3 # Copyright (c) 2016-2017 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 compact blocks (BIP 152). Version 1 compact blocks are pre-segwit (txids) Version 2 compact block...