gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
from __future__ import unicode_literals
import datetime
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.... | |
# Copyright 2013 Mirantis Inc.
# Copyright 2013 Rackspace Hosting.
#
# 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
#
# Unles... | |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A modular python bot based on the twisted matrix irc library
@author Riku 'Shrike' Lindblad (shrike@addiktit.net)
@copyright Copyright (c) 2006 Riku Lindblad
@license New-Style BSD
"""
import re
import sys
import os.path
import time
import urllib
import fnmatch
import HT... | |
# 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 a... | |
'''
this is a module (used as a singleton) that keeps track of the artists, albums,
and tracks we've found so far in the mp3 collection. Keeping track of these is
key to the algorithm of choosing correct album names (see refineGuessCache).
internally there are 3 global dicts.
ARTIST_META_CACHE: just to cach... | |
import os
import glob
import shutil
import itertools
import logging
# The ReadTheDocs build does not include nipype.
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if not on_rtd:
# Disable nipype nipy import FutureWarnings.
import warnings
with warnings.catch_warnings():
warnings.simplefilter(acti... | |
#!/usr/bin/env python
#
# 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 require... | |
#!/usr/bin/env python
# Copyright 2010-2014 RethinkDB, all rights reserved.
import sys
"""This script is used to generate the RDB_MAKE_SERIALIZABLE_*() and
RDB_MAKE_ME_SERIALIZABLE_*() macro definitions. Because there are so
many variations, and because they are so similar, it's easier to just
have a Python script to ... | |
# -*- coding: utf-8 -*-
import mock
from typing import Any, Union, Mapping, Callable
from zerver.lib.actions import (
do_create_user,
get_service_bot_events,
)
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import (
get_realm,
UserProfile,
Recipient,
)
BOT_TYPE_TO_QUEUE_NAME... | |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... | |
import unittest
import numpy as np
from math import pi, cos, sin, acos, atan
from pymicro.crystal.lattice import Lattice, CrystallinePhase, Symmetry, HklObject, HklDirection, HklPlane, SlipSystem
class LatticeTests(unittest.TestCase):
def setUp(self):
print('testing the Lattice class')
def test_equal... | |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import argparse
import math
import numpy as np
import torch
from torch.optim import Adam
import pyro
import pyro.distributions as dist
from pyro import poutine
from pyro.infer import Trace_ELBO
from pyro.infer.autoguide import Au... | |
"""
Python package to interact with UniFi Controller
"""
import shutil
import time
import warnings
import json
import logging
import requests
from urllib3.exceptions import InsecureRequestWarning
"""For testing purposes:
logging.basicConfig(filename='pyunifi.log', level=logging.WARN,
format='%(as... | |
import base64, re, traceback, os, string, sys
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.styles import Style
from poshc2.client.Alias import cs_alias, cs_replace
from poshc2.Colours import Co... | |
#-----------------------------------------------------------------
#Imports
#-----------------------------------------------------------------
import time
import os
import sys
import signal
#-----------------------------------------------------------------
# System import for Raspberry Pi drivers
#--------------------... | |
# encoding: utf-8
import re
from itertools import izip
from crf.data.dataset import DataSet, divide_data, divide_in_two
CASES = ["nom", "gen", "dat", "acc", "inst", "loc", "voc"]
CASE_REGEX = re.compile("(^|:)(%s)($|:)" % '|'.join(CASES))
class Segment(object):
def __init__(self, id, orth="?", base="?", po... | |
from __future__ import division
from unittest import TestCase
from nose_parameterized import parameterized
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
from .. import timeseries
from .. import utils
DECIMAL_PLACES = 8
class TestDrawdown(TestCase):
px_list_1 = np.array(
[100... | |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
import csv
import traceback
import logging
from pymongo import MongoClient
import datetime
from Queue import Queue
from utilsDataFile import Utils
import json
from threading import Thread
from colorama import init
init(autoreset=True)
__author__ = 'asifj'
logging.basicConfig(
format='%(asctime)s.%(msecs)s:%(name)... | |
# Copyright 2018 The Bazel 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 applicable la... | |
from infi.pyutils.lazy import cached_method
from pyvisdk.do.traversal_spec import TraversalSpec
from pyvisdk.do.selection_spec import SelectionSpec
from pyvisdk.do.wait_options import WaitOptions
from logging import getLogger
from re import match, findall
from bunch import Bunch
logger = getLogger(__name__)
INITIAL_... | |
from __future__ import division
from decimal import Decimal, getcontext
from string import ascii_lowercase, maketrans
def format_num(num, decplaces=10):
"Converts a number into a more a readable string-version."
try:
dec = Decimal(num)
# Cut the decimal off at "precision" decimal places.
... | |
import itertools as it
from collections import deque
from Levenshtein import distance
from transactionaldict import TransactionalDict as tdict
class Trie:
_root = None
_terminals = None
_collection_count = None
def __init__(self):
self._root = Node(element='')
self._terminals = set()... | |
#!/usr/bin/env python3
# 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 requir... | |
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010-2012 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/LICENS... | |
'''
A service is one component of a running Sirikata system, e.g. a single
space server, object host, pinto or cseg server. Each service must be
uniquely named and gets isolated storage where it is executed. Usually
a service will be based on a template.
'''
import util
import serviceconfig
import package
import monit... | |
import datetime
import json
import urllib
from uuid import uuid4
from django.test.utils import override_settings
from . import AlertFlavorFactory, AlertFactory, LinkFactory
from fjord.alerts.models import Alert, Link
from fjord.api_auth.tests import TokenFactory
from fjord.base.tests import reverse, TestCase, WHATEVE... | |
"""
ANT (Attention Network Test) implemented in PsychoPy2
Created by Per Baekgaard / pgba@dtu.dk / baekgaard@b4net.dk, September 2015
Licensed under the MIT License:
Copyright (c) 2015,2016 Per Baekgaard, Technical University of Denmark, DTU Informatics, Cognitive Systems Section
Permission is hereby granted, f... | |
#!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
============================
fMRI: OpenfMRI.org data, FSL
============================
A growing number of datasets are available on `OpenfMRI <http://openfmri.org>`_.
This script... | |
from __future__ import with_statement
import os
import sys
import glob
import shutil
import errno
import logging
from contextlib import contextmanager
from plumbum.lib import _setdoc, IS_WIN32
from plumbum.path.base import Path, FSUser
from plumbum.path.remote import RemotePath
try:
from pwd import getpwuid, getpwn... | |
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | |
# -*- coding: utf-8 -*-
from fabric.api import cd, env, require, run, task
from fabric.colors import green, white
from fabric.context_managers import contextmanager, prefix, shell_env
from fabric.operations import put
from fabric.utils import puts
from fabutils import arguments, join, options
from fabutils.context imp... | |
#!/usr/bin/python
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Templating to help generate structured text."""
import logging
import re
_logger = l... | |
import os
import typing
import unittest
from threading import Event
from unittest.mock import Mock, call, patch
import pytest
import requests_mock
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from streamlink.session import Streamlink
from streamlink.stream.hls import HLSStream, HLSStreamReader
fr... | |
import os
import math
from django.conf import settings
from osgeo import osr
from pysqlite2 import dbapi2 as db
from hashlib import md5
from collections import OrderedDict
import sh
import logging
from terrapyn.geocms import dispatch
_log = logging.getLogger('terrapyn.driver_messages')
CACHE_ROOT = getattr(settings... | |
# -*- coding: utf-8 -*-
from cms.admin.change_list import CMSChangeList
from cms.admin.dialog.views import get_copy_dialog
from cms.admin.forms import PageForm, PageAddForm
from cms.admin.permissionadmin import (PAGE_ADMIN_INLINES,
PagePermissionInlineAdmin, ViewRestrictionInlineAdmin)
from cms.admin.views import ... | |
from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... | |
# Copyright (c) 2016 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | |
"""The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
import unittest
import pytest
from homeassistant.components import logbook, script
from homeassistant.components.script import DOMAIN, EVENT_SCRIPT_STARTED
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
... | |
# Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | |
# Copyright (c) 2009-2014 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 functiona... | |
# 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 ... | |
"""Spectral Embedding"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Wei LI <kuantkid@gmail.com>
# License: BSD Style.
import warnings
import numpy as np
from scipy import sparse
from scipy.sparse.linalg import lobpcg
from scipy.sparse.linalg.eigen.lobpcg.lobpcg import symeig
from ..base impo... | |
"""This is the core of our couch wrapper. The CouchBatch class defined here
is what end-users can use to efficiently query and update couchdb.
"""
from couchdbkit.exceptions import ResourceConflict
from couchdbkit.exceptions import ResourceNotFound
from couchdbkit.exceptions import BulkSaveError
from functools ... | |
# 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... | |
# Copyright 2013-2015 ARM 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
"""Defines the unit tests for the :mod:`colour.plotting.common` module."""
import matplotlib.pyplot as plt
import numpy as np
import os
import shutil
import tempfile
import unittest
from functools import partial
from matplotlib.pyplot import Axes, Figure
import colour
from colour.colorimetry import SDS_ILLUMINANTS
fr... | |
"""Module used to create a shared/static library from pyJac files.
"""
from __future__ import print_function
import shutil
import re
import os
import subprocess
import sys
import multiprocessing
import platform
from .. import utils
def lib_ext(shared):
"""Returns the appropriate library extension based on the sh... | |
import itertools
import os
import random
import tempfile
from unittest import mock
import pandas as pd
import pytest
import pickle
import numpy as np
import string
import multiprocessing as mp
from copy import copy
import dask
import dask.dataframe as dd
from dask.dataframe._compat import tm, assert_categorical_equal... | |
# Copyright 2015 Cisco Systems, 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... | |
##
# Copyright (c) 2005-2015 Apple 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 l... | |
# -*- coding: utf-8 -*-
#
# 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
... | |
# -*- coding: utf-8 -*-
# pylint: disable=W0102
from datetime import datetime, date
import operator
import sys
import pytest
import numpy as np
import re
from distutils.version import LooseVersion
import itertools
from pandas import (Index, MultiIndex, DataFrame, DatetimeIndex,
Series, Categorical... | |
# -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2018 The Electrum developers
#
# 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,
# includi... | |
import numpy as np
import theano
import theano.tensor as T
from .. import init
from .. import nonlinearities
from . import base
from theano.sandbox.cuda.basic_ops import gpu_contiguous
# TODO: make sure to document the limitations and 'best practices' (i.e. minibatch size % 128 == 0)
# TODO: see if the 'dimshuffle'... | |
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import scikits.statsmodels.api as sm
import scipy.optimize as opt
import scipy.linalg as la
# Parameters
params = { 'N': 400,
'alpha_sd': 0.0,
'alpha_unif': 0.0,
'B': 0,
'beta_sd': 1.0,
'x_d... | |
"""Service calling related helpers."""
import asyncio
from functools import wraps
import logging
from typing import Callable
import voluptuous as vol
from homeassistant.auth.permissions.const import CAT_ENTITIES, POLICY_CONTROL
from homeassistant.const import (
ATTR_ENTITY_ID, ENTITY_MATCH_ALL, ATTR_AREA_ID)
impo... | |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import codecs
import re
import logging
import os
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Big Switch Networks, 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.a... | |
"""The tests for the geojson platform."""
from asynctest.mock import patch, MagicMock, call
from homeassistant.components import geo_location
from homeassistant.components.geo_location import ATTR_SOURCE
from homeassistant.components.geo_json_events.geo_location import \
SCAN_INTERVAL, ATTR_EXTERNAL_ID, SIGNAL_DEL... | |
import re
import pandas as pd
from igf_data.illumina.samplesheet import SampleSheet
from igf_data.utils.sequtils import rev_comp
from igf_data.process.metadata_reformat.reformat_metadata_file import Reformat_metadata_file
SAMPLESHEET_COLUMNS = [
'Lane',
'Sample_ID',
'Sample_Name',
'Sample_Plate',
'Sample_Wel... | |
# 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... | |
"""
Support for the Xiaomi vacuum cleaner robot.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/vacuum.xiaomi_miio/
"""
import asyncio
from functools import partial
import logging
import os
import voluptuous as vol
from homeassistant.components.vacuum imp... | |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import o... | |
"""
Low-dependency indexing utilities.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
import warnings
import numpy as np
from pandas._typing import (
Any,
AnyArrayLike,
ArrayLike,
)
from pandas.core.dtypes.common import (
is_array_like,
is_bool_dtype,
is_extension_ar... | |
# Python imports.
from __future__ import print_function
from collections import defaultdict
import random
import copy
# Check python version for queue module.
import sys
if sys.version_info[0] < 3:
import Queue as queue
else:
import queue
# Other imports.
from simple_rl.planning.PlannerClass import Planner
class ... | |
# Copyright (c) 2009-2011 by Minor Gordon, Bjoern Kolbeck, Zuse Institute Berlin
# Licensed under the BSD License, see LICENSE file for details.
from datetime import datetime
from time import sleep
import sys, os, subprocess, signal
class Server:
def __init__(self,
start_stop_retries,
... | |
#!/usr/bin/env python3
from testUtils import Utils
from testUtils import BlockLogAction
import time
from Cluster import Cluster
from WalletMgr import WalletMgr
from Node import BlockType
import os
import signal
import subprocess
from TestHelper import AppArgs
from TestHelper import TestHelper
########################... | |
import hashlib
import json
import re
from enum import Enum
from os import listdir, makedirs
from os.path import dirname, isfile, join, realpath
import jsonschema
import yaml
from jinja2 import Environment, PackageLoader
from yaml import MarkedYAMLError
from binary import FixedEntryListTypes, FixedLengthTypes, FixedLi... | |
# -*- coding: utf-8 -*-
"""Test triggers"""
import pytest
from pyrseas.testutils import DatabaseToMapTestCase
from pyrseas.testutils import InputMapToSqlTestCase, fix_indent
FUNC_SRC = "BEGIN NEW.c3 := CURRENT_DATE; RETURN NEW; END"
FUNC_INSTEAD_SRC = "BEGIN INSERT INTO t1 VALUES (NEW.c1, NEW.c2, now()); " \
"RE... | |
# -*- coding: utf-8 -*-
#
# 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 "L... | |
"""HTML reporting for Coverage."""
import os, re, shutil, sys
import coverage
from coverage.backward import pickle
from coverage.misc import CoverageException, Hasher
from coverage.phystokens import source_token_lines, source_encoding
from coverage.report import Reporter
from coverage.results import Numbers
from cove... | |
import datetime
import easydict
import logging
import middleware
import time
from errors import UnknownAchievementHandler
@middleware.unsafe()
def count_based_badge(achievement_id, config, db, params):
logging.debug("count_based_badge @ {}/{}".format(params.device_id, achievement_id))
query = get_count_query(... | |
#!/usr/bin/env python
# $Id: SourceReader.py,v 1.1 2006-09-06 09:50:09 skyostil Exp $
"""SourceReader class for Cheetah's Parser and CodeGenerator
Meta-Data
================================================================================
Author: Tavis Rudd <tavis@damnsimple.com>
License: This software is released for ... | |
from ._register import _L1_moments
import numpy as np
from scipy.ndimage import gaussian_filter
TINY = float(np.finfo(np.double).tiny)
SIGMA_FACTOR = 0.05
OVERLAP_MIN = 0.01
# A lambda function to force positive values
nonzero = lambda x: np.maximum(x, TINY)
def correlation2loglikelihood(rho2, npts, total_npts):
... | |
'''
Created on Oct 4, 2015
@author: Amol
'''
from itertools import groupby
from math import log
my_data = [['slashdot', 'USA', 'yes', 18, 'None'],
['google', 'France', 'yes', 23, 'Premium'],
['digg', 'USA', 'yes', 24, 'Basic'],
['kiwitobes', 'France', 'yes', 23, 'Basic'],
['google', 'U... | |
#!/usr/bin/env python
__author__ = 'rolandh'
import sys
import os
import re
import logging
import logging.handlers
from importlib import import_module
from saml2 import root_logger, BINDING_URI, SAMLError
from saml2 import BINDING_SOAP
from saml2 import BINDING_HTTP_REDIRECT
from saml2 import BINDING_HTTP_POST
from... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC 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.or... | |
# Copyright 2013 IBM Corp.
import sys
import eventlet
import mock
import testtools
from novaclient.tests.v1_1 import fakes as novafakes
from cinderclient.tests.v1 import fakes as cinderfakes
from novaclient.tests import utils
from powervc.common import utils as pvc_utils
from powervc.common.client.extensions import no... | |
import requests
import os
import six
session_key_header = "X_SESSION_KEY"
http_session_key_header = "HTTP_{}".format(session_key_header)
sso_cookie_name = os.environ.get(
"SSO_COOKIE_NAME") or "_dpaw_wa_gov_au_sessionid"
debug = (os.environ.get("DEBUG_SSO") or "false").lower() in [
"true", "yes", "t", "y", "on... | |
import datetime
from typing import Optional, Union
import dateutil.parser
import h5py
import numpy as np
import scipy.constants
from ... import classes2
from ...misc.errorvalue import ErrorValue
# noinspection PyMethodOverriding
class Header(classes2.Header):
_data = None
@classmethod
def new_from_file... | |
from explorer.utils import passes_blacklist, swap_params, extract_params, shared_dict_update, get_connection
from django.db import models, DatabaseError
from time import time
from django.core.urlresolvers import reverse
from django.conf import settings
import app_settings
import logging
import six
MSG_FAILED_BLACKLIST... | |
"""Test anonymization of IP addresses and related functions."""
# Copyright 2018 Intentionet
#
# 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/L... | |
import __builtin__
import os
import unittest
import shutil
import tempfile
from .buck import BuildFileProcessor, DiagnosticMessageAndLevel, add_rule
def foo_rule(name, srcs=[], visibility=[], build_env=None):
add_rule({
'buck.type': 'foo',
'name': name,
'srcs': srcs,
'visibility':... | |
""" Tools for reading/writing BIDS data files. """
from os.path import join
import warnings
import json
import numpy as np
import pandas as pd
from bids.utils import listify
from .entities import NodeIndex
from .variables import SparseRunVariable, DenseRunVariable, SimpleVariable
BASE_ENTITIES = ['subject', 'sessi... | |
#!/usr/bin/env python
# -*- coding: utf-8
# Copyright 2017-2019 The FIAAS 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
#
# Unle... | |
#
# Author: Zoltan Varga (vargaz@gmail.com)
# License: MIT/X11
#
#
# This is a mono support mode for gdb 7.0 and later
# Usage:
# - copy/symlink this file to the directory where the mono executable lives.
# - run mono under gdb, or attach to a mono process started with --debug=gdb using gdb.
#
import os
class String... | |
# Copyright 2014-2017 by Akira Yoshiyama <akirayoshiyama@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://www.apache.org/licenses... | |
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
matplotlib.style.use('ggplot') # Look Pretty
def drawLine(model, X_test, y_test, title, R2):
# This convenience method will take care of plotting your
# test observations, comparing th... | |
#========================================================================
# File: pyselfe.py
#========================================================================
"""@package docstring
pyselfe : SELFE Model Dataset IO Functions
This module enables the reading of model results generated by SELFE
Works with data f... | |
# Licensed to the StackStorm, Inc ('StackStorm') 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 th... | |
# Copyright (c) 2017 Future Gadget Laboratories.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | |
'''Helper functions for the Smart Grid Game Library and grid instance.
Created on Mar 15, 2013
@author: Carleton Moore
'''
from django.db.models.deletion import Collector
from django.db.models.fields.related import ForeignKey
from apps.widgets.smartgrid.models import Action, Activity, Commitment, Event, Filler, Colum... | |
from subprocess import Popen, PIPE
import os
import re
import time
from optparse import OptionParser
import sql
from runner import runner_registry
from tools import UsageError
from api0 import open_db
parse_check = OptionParser(usage='%prog check <tablepath> ',
add_help_option=False)
def ... | |
#!/usr/bin/env python3
# Copyright 2015 The Meson development team
# 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... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2019 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... | |
#!/usr/bin/env python3
# Created by Jonathan Komar
# 2016-09
# Description:
# Enterprise solution for automated documentation generation.
#
import threading
import queue
import time
import subprocess
import os
import shutil
import sys
import logging,logging.handlers
import re
import getpass
import configparser
import ... | |
"""Channels module for Zigbee Home Automation."""
from __future__ import annotations
import asyncio
from typing import Any, Dict, List, Optional, Tuple, Union
import zigpy.zcl.clusters.closures
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatche... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.