gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
import unittest
import sys
import numpy as np
import scipy.sparse as sp
from sklearn.externals.six.moves import cStringIO as StringIO
from sklearn.externals import joblib
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.testing import (assert_raises_regex, assert_true,
... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015-2018 by Exopy Authors, see AUTHORS for more details.
#
# Distributed under the terms of the BSD license.
#
# The full license is in the file LICENCE, distributed with this software.
# ---------------... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module implements classes (called Fitters) which combine optimization
algorithms (typically from `scipy.optimize`) with statistic functions to perform
fitting. Fitters are implemented as callable classes. In addition to the data
to fit, the ``__c... | |
# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse, reverse_lazy
from django.forms import ValidationError
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404, redirect
from django.template import RequestContext
from django.utils.translation i... | |
#!/usr/bin/env python
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Windows platform implementation."""
import errno
import os
import sys
from psutil import _common
from psutil._common import con... | |
#!/bin/python
# Copyright (c) 2013, Arvid Norberg
# 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 source code must retain the above copyright
# notice, this l... | |
# Copyright 2012 Nebula, 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... | |
import lcm
import math
import numpy as np
from crazyflie_t import crazyflie_input_t, crazyflie_controller_commands_t, crazyflie_hover_commands_t, crazyflie_positioninput_t
from threading import Thread
GO_TO_START = True
XHAT_START = [0, -0.61, 0.01, 0, 0, 0, 0, 0, 0, 0, 0, 0]
NOMINAL_W2 = 16.3683
XHAT_DESIRED = [0, -0... | |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from library import match_args_return
from constants import cp0
from conversions import t_from_CT, pt_from_CT
from absolute_salinity_sstar_ct import CT_from_t
from basic_thermodynamic_t import rho_t_exact, alpha_wrt_CT_t_exact
from basic_ther... | |
# Lint as: python3
# Copyright 2020 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 ... | |
import re
import sys
import os
import logging
import time
import hashlib
from urlparse import urlparse
from virus_total_apis import PrivateApi as VirusTotal
import pcap
import decoder
import apikey
from snort import SnortRule
from database import SQLiteTool
logger = logging.getLogger(__name__)
REQUEST_RATE = 300
AP... | |
"""distutils.command.build_ext
Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: build_ext.py,v 1.1.1.1 2006/05/30 06:04:36 hhzhou E... | |
from collections import defaultdict
import logging
from zope.interface import implements
from twisted.internet import defer
from twisted.python.failure import Failure
from lbrynet.conf import MAX_BLOB_INFOS_TO_REQUEST
from lbrynet.core.client.ClientRequest import ClientRequest, ClientPaidRequest
from lbrynet.lbrylive.L... | |
# -*- coding: <utf-8> -*-
import re #, pickle, os, sys
from datetime import datetime, timedelta
import django.utils.timezone as timezone
from django2wrap.models import Agent, Shift, Call, Resource, Case, Comment
from django2wrap.models import Comment
from django.db import connection
from django.conf import settings
HT... | |
from __future__ import unicode_literals
import django
from future.builtins import int, zip
from functools import reduce
from operator import ior, iand
from string import punctuation
from django.apps import apps
from django.core.exceptions import ImproperlyConfigured
from django.db.models import Manager, Q, CharField... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .. import backend as K
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
class _Pooling1D(Layer):
'''Abstract class for different pooling 1D layers.
'''
input_dim = 3
def __init__(self, pool_lengt... | |
#!/usr/bin/python
#
# Copyright (C) 2017 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# SPDX-License-Identifier: GPL-2.0+
#
"""Device tree to platform data class
This supports converting device tree data to C structures definitions and
static data.
"""
import collections
import copy
import sys
import f... | |
# Copyright (c) 2019 PaddlePaddle 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 app... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
import importlib
from logging import getLogger
import os
import sys
logger = getLogger(__name__)
class LoaderInterface(object):
"""Interface for any loader class"""
def load(self, names):
"""
Locates and loads plugin modules using built in strategy
Arguments:
:param ... | |
# -*- coding: utf-8 -*-
"""
wizard.py
"""
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.model import ModelView, fields
from trytond.wizard import (
Wizard, StateView, Button, StateTransition
)
from trytond.pyson import Eval
__all__ = [
'ImportDataWizard', 'ImportDa... | |
# -*- coding: utf-8 -*-
import json
import shutil
from django.core.files.storage import default_storage as storage
import mock
import waffle
from pyquery import PyQuery as pq
from olympia import amo
from olympia.addons.models import Addon, AddonUser
from olympia.amo.tests import TestCase
from olympia.amo.tests.test... | |
# Copyright 2011 Citrix System.
# 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... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
#
# Collective Knowledge (artifact description (reproducibility, ACM meta, etc))
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
cfg={} # Will be updated by CK (meta description of this module)
wor... | |
# 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
# distributed under t... | |
# This module contains the analysis options
# DEBUG options: these options cause angr to set breakpoints in various
# places or raise exceptions when checks fail.
BREAK_SIRSB_START = "BREAK_SIRSB_START"
BREAK_SIRSB_END = "BREAK_SIRSB_END"
BREAK_SIRSTMT_START = "BREAK_SIRSTMT_START"
BREAK_SIRSTMT_END = "BREAK_SIRSTMT_E... | |
import os
from twisted.trial import unittest
from twisted.protocols.policies import WrappingFactory
from twisted.python.filepath import FilePath
from twisted.internet import reactor, defer
from twisted.web import server, static, util, resource
from twisted.web.test.test_webclient import ForeverTakingResource, \
... | |
import os
import sys
import string
import platform
def is_active():
return True
def get_name():
return "Android"
def can_build():
return (os.environ.has_key("ANDROID_NDK_ROOT"))
def get_opts():
return [
('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", ... | |
from ._gobject import *
# girepository - C library
libgirepository = CDLL(find_library('girepository-1.0'))
#
# GIBaseInfo
#
class _GIBaseInfoStub(Structure):
_fields_ = [
('dummy1', gint32),
('dummy2', gint32),
('dummy3', gpointer),
('dummy4', gpointer),
('dummy5', gpointer),
('dummy6', guint32),
('du... | |
# Copyright (c) 2012 Rackspace Hosting
# All Rights Reserved.
# 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/license... | |
# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... | |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import stat
from mox import Mox
from staticgenerator import StaticGenerator, StaticGeneratorException, DummyHandler
import staticgenerator
class CustomSettings(object):
def __init__(self, **kw):
for k,v in kw.iteritems():
setattr(self, k, v)
def g... | |
# Python Tools for Visual Studio
# Copyright(c) Microsoft Corporation
# 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
#
# THI... | |
"""
The Python parts of the Jedi library for VIM. It is mostly about communicating
with VIM.
"""
import traceback # for exception output
import re
import os
import vim
import jedi
import jedi.keywords
from jedi._compatibility import unicode
temp_rename = None # used for jedi#rename
class PythonToVimStr(unicode):... | |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:17754")
else:
access = Se... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import argparse
import torch
import torch.nn as nn
from utils.custom_mlp import MLP, Exp
from utils.mnist_cached import MNISTCached, mkdir_p, setup_data_loaders
from utils.vae_plots import mnist_test_tsne_ssvae, plot_conditional_s... | |
# -*- coding: utf-8 -*-
# import
## batteries
from __future__ import print_function
import os
import sys
import argparse
from itertools import product
## 3rd party
import numpy as np
import pandas as pd
## package
from leylab_pipelines import Utils
from leylab_pipelines.TECAN import Fluent
# functions
def get_desc():... | |
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
import numbers
import copy
import types as pytypes
from operator import add
import operator
import numpy as np
import numba
from numba import types
from numba.typing.templates import infer_global, AbstractTemplate
from numba.typing im... | |
import functools
import hashlib
import json
import random
import uuid
from operator import attrgetter
from django import http
from django.conf import settings
from django.db.models import Q
from django.shortcuts import (get_list_or_404, get_object_or_404, redirect,
render)
from django.uti... | |
# -*- coding: utf-8 -*-
"""Hypertext Transfer Protocol Version 2."""
import struct
import codecs
from . import dpkt
HTTP2_PREFACE = b'\x50\x52\x49\x20\x2a\x20\x48\x54\x54\x50\x2f\x32\x2e\x30\x0d\x0a\x0d\x0a\x53\x4d\x0d\x0a\x0d\x0a'
# Frame types
HTTP2_FRAME_DATA = 0
HTTP2_FRAME_HEADERS = 1
HTTP2_FRAME_PRIORITY = 2... | |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... | |
import os
import copy
import json
from .common import STORJ_HOME
from btctxstore import BtcTxStore
VERSION = "3.0.0" # config version divorced from software version!
DEFAULT_CONFIG_PATH = os.path.join(STORJ_HOME, "config")
class InvalidConfig(Exception):
pass
def read(path, password=None):
""" Read a jso... | |
#
# 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 us... | |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import tim... | |
# vim:fileencoding=utf-8:noet
from powerline.lib.threaded import MultiRunnedThread
from powerline.lib.file_watcher import create_file_watcher
from copy import deepcopy
from threading import Event, Lock
from collections import defaultdict
import json
import codecs
def open_file(path):
return codecs.open(path, enco... | |
"""The :mod:`variation` module defines classes for variation operators.
Variation operators (aka genetic operators) are used in evolutionary/genetic
algorithms to create "child" genomes from "parent" genomes.
"""
from abc import ABC, abstractmethod
from typing import Sequence, Union
import math
from numpy.random imp... | |
# -*- coding: utf-8 -*-
#
# StackStorm documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 7 21:52:49 2014.
#
# 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.
#
... | |
'''
LICENSING
-------------------------------------------------
hypergolix: A python Golix client.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
Nick Badger
badg@muterra.io | badg@nickbadger.com | nickbadger.com
This library is free software; you can redistribute it and/o... | |
"""
Provides functionality to interact with lights.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/light/
"""
import asyncio
from datetime import timedelta
import logging
import os
import csv
import voluptuous as vol
from homeassistant.core import cal... | |
import argparse
import os
import math
import uuid
import tensorflow as tf
import hypergan as hg
import hyperchamber as hc
from hypergan.generators import *
from hypergan.search.random_search import RandomSearch
from hypergan.viewer import GlobalViewer
from common import *
arg_parser = ArgumentParser("Test your gan vs... | |
#!/usr/bin/env python
#
# Copyright (c) 2016, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... | |
import unittest
import datetime
import operator
import pytz
import recurly
recurly.API_KEY = 'blah'
import mocurly.core
import mocurly.backend
class TestAccount(unittest.TestCase):
def setUp(self):
self.mocurly_ = mocurly.core.mocurly()
self.mocurly_.start()
self.base_account_data = {
... | |
# Copyright 2020 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... | |
"""
This module contains the default values for all settings used by Scrapy.
For more information about these settings you can read the settings
documentation in docs/topics/settings.rst
Scrapy developers, if you add a setting here remember to:
* add it in alphabetical order
* group similar settings without leaving ... | |
# 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 u... | |
"""Arithmetics for dense recursive polynomials in `K[x]` or `K[X]`. """
from sympy.polys.densebasic import (
dup_LC, dmp_LC,
dup_degree, dmp_degree,
dup_normal, dmp_normal,
dup_strip, dmp_strip,
dmp_zero_p, dmp_zero,
dmp_one_p, dmp_one,
dmp_zeros
)
from sympy.polys.polyerrors import (
... | |
"""
Adds support for generic thermostat units.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.generic_thermostat/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.core import ... | |
import re
import urllib2
from urllib2 import URLError
class ROTCypher:
''' Class with cypher functionality to convert to and from rot '''
def __init__(self, rot_shift=13):
''' Sets the initial rot shift for th cypher '''
# validate rot n shift
self.rot_shift = validate_shift(rot_shift... | |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | |
# coding=utf-8
# Copyright 2022 The Tensor2Robot 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 ... | |
# Copyright 2012 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/licenses/LICENSE-2.0
#
# Unless required b... | |
from functools import reduce
from dynts.conf import settings
from ...api import timeseries, is_timeseries
class Expr:
'''Base class for abstract syntax nodes
'''
def count(self):
'''Number of nodes'''
return 1
def malformed(self):
return False
@property
def type(self... | |
from common_fixtures import * # NOQA
import json
TEST_SERVICE_OPT_IMAGE = 'ibuildthecloud/helloworld'
TEST_SERVICE_OPT_IMAGE_LATEST = TEST_SERVICE_OPT_IMAGE + ':latest'
TEST_SERVICE_OPT_IMAGE_UUID = 'docker:' + TEST_SERVICE_OPT_IMAGE_LATEST
METADATA_SUBDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
... | |
"""
Title: Timeseries classification from scratch
Author: [hfawaz](https://github.com/hfawaz/)
Date created: 2020/07/21
Last modified: 2021/07/16
Description: Training a timeseries classifier from scratch on the FordA dataset from the UCR/UEA archive.
"""
"""
## Introduction
This example shows how to do timeseries cla... | |
# Copyright 2008 Nokia Siemens Networks Oyj
#
# 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 a... | |
from collections import OrderedDict
import os
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.functional import empty, LazyObject
from django.utils.m... | |
from sympy import Expr, sympify, Symbol, Matrix
from sympy.printing.pretty.stringpict import prettyForm
from sympy.core.containers import Tuple
from sympy.core.compatibility import is_sequence
from sympy.physics.quantum.matrixutils import (
numpy_ndarray, scipy_sparse_matrix,
to_sympy, to_numpy, to_scipy_spar... | |
import itertools
import operator
from collections import defaultdict
import pymongo
from django.core import urlresolvers
from django.template.defaultfilters import slugify
from billy.core import mdb as db, settings
from billy.utils import term_for_session
from .base import Document, RelatedDocuments, ListManager
from... | |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Float,
NoneSet,
Bool,
Integer,
MinMax,
NoneSet,
Set,
String,
Alias,
)
from openpyxl.descriptors.excel i... | |
# Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# 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... | |
#!/usr/bin/env python
#
# Copyright 2015 Cisco 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 applicab... | |
# 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... | |
from __future__ import print_function
import os
import re
import sys
from talib import abstract
# FIXME: initialize once, then shutdown at the end, rather than each call?
# FIXME: should we pass startIdx and endIdx into function?
# FIXME: don't return number of elements since it always equals allocation?
functions ... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Praveen Ramanujam <pramanujam86@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
#
# ... | |
# Copyright 2014 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, ... | |
# Copyright (c) 2015 VMware, 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... | |
from __future__ import division, absolute_import, print_function
from numpy.testing import assert_, assert_allclose, assert_equal
from pytest import raises as assert_raises
import numpy as np
from scipy.optimize._lsq.common import (
step_size_to_bound, find_active_constraints, make_strictly_feasible,
CL_scali... | |
# 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/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ... | |
#
# 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 us... | |
# Copyright (c) 2014 Mirantis 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, so... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import networkx as nx
import copy
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER, DEAD_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_... | |
""" Git Controller tests """
from django.test import TestCase
from django.utils import timezone
from app.logic.gitrepo.models.GitParentModel import GitParentEntry
from app.logic.gitrepo.models.GitCommitModel import GitCommitEntry
from app.logic.gitrepo.models.GitBranchModel import GitBranchEntry
from app.logic.gitrepo... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
# Copyright 2017 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 ag... | |
import unittest
import numpy as np
import math
from pysal.cg.shapes import *
from pysal.cg.standalone import *
class TestBbcommon(unittest.TestCase):
def test_bbcommon(self):
b0 = [0, 0, 10, 10]
b1 = [5, 5, 15, 15]
self.assertEqual(1, bbcommon(b0, b1))
def test_bbcommon_same(self):
... | |
from __future__ import unicode_literals
import errno
import os
import socket
import time
from .common import FileDownloader
from ..compat import (
compat_urllib_request,
compat_urllib_error,
)
from ..utils import (
ContentTooShortError,
encodeFilename,
sanitize_open,
)
class HttpFD(FileDownloade... | |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
"""
Global variables and functions for handling external data sets.
"""
import os,sys,re
from .dadict import DADict
from... | |
# Copyright (c) 2013, Felipe Andres Manzano
# 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 source code must retain the above copyright notice,
# this list of co... | |
from google.appengine.ext import ndb
from consts.media_tag import MediaTag
from controllers.api.api_district_controller import ApiDistrictListController, ApiDistrictEventsController, ApiDistrictRankingsController, ApiDistrictTeamsController
from controllers.api.api_event_controller import ApiEventController, ApiEventT... | |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | |
from __future__ import unicode_literals
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.encoding import python_2_unicode_compatible
from django.util... | |
import random
import sys
import time
import pytest
import ray
from ray.exceptions import TaskCancelledError, RayTaskError, \
GetTimeoutError, WorkerCrashedError, \
ObjectLostError
from ray.test_utils import SignalActor
def valid_exceptions(use_force):
if use... | |
import requests
import json
import time
import multiprocessing
from functools import wraps
class RateLimitError(Exception):
'''A rate-limit-specific error'''
def __init__(self, value):
'''
Args:
value: Rate Limit error code for the API'''
self.value = str(value) + ' Error/... | |
#!/usr/bin/env python
#
# Copyright (c) 2010-2012 Appcelerator, Inc. All Rights Reserved.
# Licensed under the Apache Public License (version 2)
import os, sys, re
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.abspath(os.path.join(this_dir, "..")))
from common import dict_has_non_empt... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Restricted environment to execute application's code
-------------------------------------------------... | |
#
# Copyright (c) 2005 Canonical
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as publi... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2016
:license:
MIT License
"""
import os
import platform
import h5netcdf
import numpy as np
import pytest
from pyexodus import exodus
_p = [
{"io_size": 4, "word_size": 4, "f_dtype": np.float32},
{"i... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 27 15:58:48 2015
@author: haoran
"""
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import pickle
import os
#import nltk
import matplotlib.pyplot as plt
from nltk.corpus import wordnet as wn
import scipy.io as sio
import datetime
import math... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.