gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
from __future__ import division, absolute_import
from matplotlib import rc,rcParams
rc('text', usetex=True)
rc('axes', linewidth=2)
rc('font', weight='bold')
# rcParams['text.latex.preamble'] = [r'\usepackage{sfmath} \boldmath']
import astropy.stats
import cPickle as pickle
import glob
import math
import matplotlib.p... | |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing M2M table for field required_skills on 'Feat'
db.delete_table('dnd_feat_required_skills')
... | |
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# opensnoop Trace open() syscalls.
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: opensnoop [-h] [-T] [-x] [-p PID] [-d DURATION] [-t TID] [-n NAME]
#
# Copyright (c) 2015 Brendan Gregg.
# Licensed under the Apache License, Version 2.0 (the... | |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from azure.cosmos.cosmos_client import CosmosClient
from ..azure_common import BaseTest, arm_template, cassette_name
from c7n_azure.resources.cosmos_db import (CosmosDBChildResource, CosmosDBFirewallRulesFilter,
... | |
# Copyright (c) 2015 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 ... | |
import ConfigParser
from datetime import datetime, timedelta
from boto.ec2.image import Image
from boto.ec2.instance import Instance
from boto.ec2.keypair import KeyPair
from .clcinterface import ClcInterface
# This class provides an implmentation of the clcinterface that caches responses
# from the underlying clcin... | |
import numpy as np
import scipy.stats as ss
import scipy.special as sp
from .family import Family
from .flat import Flat
from .normal import Normal
from .gas_recursions import gas_recursion_cauchy_orderone, gas_recursion_cauchy_ordertwo
from .gas_recursions import gasx_recursion_cauchy_orderone, gasx_recursion_cauch... | |
# 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 ... | |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | |
# Copyright (c) 2015 Huawei Technologies Co., Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
#!/usr/bin/env python
"""
"**Pycco**" is a Python port of [Docco](http://jashkenas.github.com/docco/):
the original quick-and-dirty, hundred-line-long, literate-programming-style
documentation generator. It produces HTML that displays your comments
alongside your code. Comments are passed through
[Markdown](http://dar... | |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | |
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
import gym_morph # customized environment for cart-pole
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import time
star... | |
#!/usr/bin/env python
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Reads lines from files or stdin and identifies C++ tests.
Outputs a filter that can be used with --gtest_filter or a filter file... | |
import numpy as np
import pytest
from pandas._libs.tslibs.period import IncompatibleFrequency
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
DatetimeIndex,
Index,
NaT,
Period,
PeriodIndex,
Series,
date_range,
offsets,
period_range,... | |
#!/bin/sh
"exec" "`dirname $0`/opt/miniconda2/bin/python" "$0" "$@"
import argparse
import os
import sys
import subprocess
import logging
import shutil
import time
import signal
import itertools
import glob
import tempfile
import re
import pysam
from liftover_restricted_vcf_map import lift_vcfs, lift_maps
from generat... | |
"""The tests for the Rfxtrx light platform."""
import unittest
from homeassistant.bootstrap import _setup_component
from homeassistant.components import rfxtrx as rfxtrx_core
from tests.common import get_test_home_assistant
class TestLightRfxtrx(unittest.TestCase):
"""Test the Rfxtrx light platform."""
def... | |
"""Probabilistic potentials"""
__author__ = 'thor'
import pandas as pd
from numpy import *
from matplotlib.pyplot import *
import numpy as np
from collections import Counter
# from numpy.random import rand
# from numpy.random import permutation
import ut.pcoll.order_conserving as colloc
# import ut as ut
from ut.daf... | |
import time
from BCBio import GFF
from django.db import connection
from edge.models import Fragment, Fragment_Chunk_Location
def circular_mod(number, seq_length):
return ((number - 1) % seq_length) + 1
class GFFImporter(object):
def __init__(self, genome, gff_fasta_fn):
self.__genome = genome
... | |
"""The tests for the manual Alarm Control Panel component."""
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.setup import setup_component
from homeassistant.const import (
STATE_ALARM_DISARMED, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_AWAY,
STATE_ALARM_PENDIN... | |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | |
# 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... | |
# 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 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
# Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | |
import os
from subprocess import check_output, check_call
from fabric.api import env, task, cd, settings, put
from fabric.contrib.files import exists
from .. import util, system
from .. contextmanagers import project # , log_call, virtualenv
__all__ = [
'create', 'install', 'remove', 'remove_templates',
'git_... | |
# 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 the Li... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import logging
import numpy
import pandas
import pyorganism
import pyorganism.regulation as pyreg
from itertools import izip
from fuzzywuzzy import fuzz
from pyorganism.io.microarray import read_microarray
LOGGER = logging.getLogger()
LOGGER.ad... | |
from __future__ import print_function, division
from .str import StrPrinter
from sympy.utilities import default_sort_key
class LambdaPrinter(StrPrinter):
"""
This printer converts expressions into strings that can be used by
lambdify.
"""
def _print_MatrixBase(self, expr):
return "%s(%s)... | |
#!/usr/bin/env python
#
# Copyright 2015 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 o... | |
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | |
# 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 ... | |
# -*- coding: utf-8 -*-
"""
sockjs.tornado.router
~~~~~~~~~~~~~~~~~~~~~
SockJS protocol router implementation.
"""
from tornado import ioloop, version_info
from sockjs.tornado import transports, session, sessioncontainer, static, stats, proto
DEFAULT_SETTINGS = {
# Sessions check interval in second... | |
"""
Support to interface with Alexa Devices.
For more details about this platform, please refer to the documentation at
https://community.home-assistant.io/t/echo-devices-alexa-as-media-player-testers-needed/58639
VERSION 0.9.5
"""
import logging
from datetime import timedelta
import requests
import voluptuous as vo... | |
import unittest
from ndio.remote.neurodata import neurodata as nd
import numpy
import json
import test_settings
class TestResourcesApi(unittest.TestCase):
def setUp(self):
self.token_user = test_settings.NEURODATA
hostname = test_settings.HOSTNAME
self.nd = nd(user_token=self.token_user, h... | |
# coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import random
import time
from collections import Counter, defaultdict
from functools import reduce
from pyqrllib.pyqrllib import bin2hstr, sha2_256
from twisted.inte... | |
import os.path
import os
import keras_code.rnns.sequence.models as models
import matplotlib.pyplot as plt
import numpy as np
import random
import time
import datetime
import argparse
import utilities.paths as paths
DRIVE = paths.get_drive()
def train(model_id, model_path, data_paths_path, feature_path, nb_epoch, b... | |
# Copyright 2014 - 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
#
# Unless required by applicable law or agreed to in ... | |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# 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 re... | |
from dbt.utils import filter_null_values, deep_merge, classproperty
from dbt.node_types import NodeType
import dbt.exceptions
from collections.abc import Mapping, Hashable
from dataclasses import dataclass, fields
from typing import (
Optional, TypeVar, Generic, Any, Type, Dict, Union, Iterator, Tuple,
Set
)
... | |
# 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 appl... | |
# Copyright (c) 2014 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
import sys
import warnings
from math import log
from numbers import Number
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base import clone
from sklearn.base import is_regressor
from joblib import Parallel, delayed
from sklearn.multioutput import MultiOutputRegressor
from sklearn.utils impor... | |
from pyaccessories.TimeLog import Timer
import os
from RedmineAPI.RedmineAPI import RedmineInterface
from pyaccessories.SaveLoad import SaveLoad
from main import AutoSNVPhyl
import base64
import requests
# TODO documentation
class Run(object):
def main(self):
if self.first_run == 'yes':
choice... | |
import copy
import json
import multiprocessing
import os
import random
import shutil
import string
import tempfile
from contextlib import contextmanager
from os import chdir, getcwd, mkdir
from os.path import exists
import pkgpanda.build.constants
import pkgpanda.build.src_fetchers
from pkgpanda import expand_require ... | |
# ------------------------------------------------------------------------------
# binstruct unit testing
#
# Thomas Bonim (thomas.bonim@googlemail.com)
# This code is in the public domain
# ------------------------------------------------------------------------------
import unittest
import binstruct
class TestMo... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | |
# 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... | |
# --------------------------------------------------------
# Scene Graph Generation by Iterative Message Passing
# Licensed under The MIT License [see LICENSE for details]
# Written by Danfei Xu
# --------------------------------------------------------
"""
Train a scene graph generation network
"""
import tensorflow... | |
# encoding: utf-8
import datetime
import json
import os
import difflib
import logging
import itertools
import tagging
import voting
from actstream import action
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
from acq4.util import Qt
from acq4.analysis.AnalysisModule import AnalysisModule
from collections import OrderedDict
import acq4.pyqtgraph as pg
from acq4.util.metaarray import MetaArray
import numpy as np
class ImageAnalysis(AnalysisModule):
def __init... | |
"""Tests for the Google Assistant integration."""
from asynctest.mock import MagicMock
from homeassistant.components.google_assistant import helpers
def mock_google_config_store(agent_user_ids=None):
"""Fake a storage for google assistant."""
store = MagicMock(spec=helpers.GoogleConfigStore)
if agent_use... | |
import asyncio
import json
import os
from os import listdir
from os.path import isfile, join
from discord.ext import commands
from bot import restricted_cmd
# noinspection PyTypeChecker
class Admin:
def __init__(self, bot):
self.bot = bot
def init_cogs(self):
cogs_list = self.list_cogs()
... | |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... | |
import datetime
import os
import StringIO
import base64
import matplotlib.pyplot as pyplot
import matplotlib.backends.backend_agg as pltagg
import numpy as np
import sys
import plotly.plotly as py
from plotly.graph_objs import Scatter, Data, Layout, XAxis, YAxis, ZAxis
from plotly.graph_objs import Figure, Line, Bar, S... | |
import re
import math
import glob
import pickle
import sys
from Peptide import *
from XLink import *
from Match import *
from MZXMLReader import *
from FastaReader import *
from random import shuffle
def logisticEval(b, x):
tmp = x
x = [1]
x.extend(tmp)
# b = [1].extend(b)
val = 0
# print '%d\t%d\n' % (len(b), le... | |
# -----------------------------------------------------------------------------
# QP/Python Library
#
# Port of Miro Samek's Quantum Framework to Python. The implementation takes
# the liberty to depart from Miro Samek's code where the specifics of desktop
# systems (compared to embedded systems) seem to warrant a diff... | |
import time
import os
import traceback
import datetime
import codecs
from opsbro.library import libstore
from opsbro.module import HandlerModule
from opsbro.parameters import BoolParameter, StringParameter, StringListParameter
class MailHandlerModule(HandlerModule):
implement = 'mail'
parameters = {
... | |
from copy import deepcopy
from tmd.pwscf.build import nscf_ks, wannier_num_bands
import tmd.pwscf.cell as cell
def Header(nbnd, num_wann, soc):
lines = ["num_bands = {}".format(str(nbnd))]
lines.append("num_wann = {}".format(str(num_wann)))
lines.append("num_iter = 0")
# TODO - why is this conditi... | |
# -*- coding: utf-8 -*-
from requests.auth import AuthBase
import requests
import json
import hashlib
import sys
import os
import getpass
from clint.textui import colored
from common import output
import netrc
STASH_HOST = 'http://getstash.herokuapp.com'
if 'STASH_HOST' in os.environ:
STASH_HOST = os.environ['ST... | |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 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.... | |
import textwrap
from io import StringIO
from itertools import chain
from typing import List, TextIO, Union
import isort.literal
from isort.settings import DEFAULT_CONFIG, Config
from . import output, parse
from .exceptions import FileSkipComment
from .format import format_natural, remove_whitespace
from .settings imp... | |
"""Tests for gree component."""
from datetime import timedelta
from greeclimate.device import HorizontalSwing, VerticalSwing
from greeclimate.exceptions import DeviceNotBoundError, DeviceTimeoutError
import pytest
from homeassistant.components.climate.const import (
ATTR_FAN_MODE,
ATTR_HVAC_MODE,
ATTR_PRE... | |
import datetime
import os
import re
import time
import math
import django.utils.copycompat as copy
try:
import decimal
except ImportError:
from django.utils import _decimal as decimal # for Python 2.3
from django.db import connection
from django.db.models import signals
from django.db.models.query_utils i... | |
# Copyright 2011 Eldar Nugaev
# 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 ... | |
import dateutil.parser as dateutil_parser
import hashlib
import json
import logging
import re
import requests
from datetime import date
from datetime import datetime
from datetime import timedelta
from dateutil import tz
from .util import LogProducer
class RefusePickup(LogProducer):
"""Parses a refuse pickup resp... | |
# 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 u... | |
print "importing stuff..."
import numpy as np
import pdb
# import matplotlib
# matplotlib.use('Agg')
import matplotlib.pylab as plt
from scipy import special
from .context import aep
from .datautils import step, spiral
def run_regression_1D():
np.random.seed(42)
print "create dataset ..."
N = 200
X ... | |
from __future__ import (absolute_import, division, print_function)
import numpy as np
from qtpy.QtWidgets import QMainWindow
from addie.utilities import load_ui
from addie.processing.mantid.master_table.table_row_handler import \
TableRowHandler
from addie.utilities import math_tools
from addie.processing.manti... | |
### GRAPH ############################################################################################
# The NodeBox Graph library includes algorithms from NetworkX for
# betweenness centrality and eigenvector centrality, Connelly Barnes' implementation of
# Dijksta shortest paths (here) and the spring layout for Java... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
import numpy as np
import pandas
def getPOCs():
return [p['cvcname'] for p in POC_dicts]
def getPOCInfo(critcol, critval, valcol):
values = list(filter(lambda poc: poc[critcol] == critval, POC_dicts))
if len(values) > 1:
raise ValueError('`getPOCInfo` found multiple records')
else:
r... | |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2013 NTT MCL Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | |
# -*- coding: utf-8 -*-
"""
pygments.lexers.rebol
~~~~~~~~~~~~~~~~~~~~~
Lexers for the REBOL and related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups
from pygmen... | |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2012,2013,2014,2015,2016,2017 Contributor
#
# 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... | |
# 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 ... | |
# 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... | |
#!/usr/bin/env python3
"""Test the general MG solver with a variable coeffcient Helmholtz
problem. This ensures we didn't screw up the base functionality here.
Here we solve::
alpha phi + div . ( beta grad phi ) = f
with::
alpha = 1.0
beta = 2.0 + cos(2.0*pi*x)*cos(2.0*pi*y)
f = (-16.0*pi**2*cos(2*pi... | |
import collections
import re
from datetime import datetime, timedelta, timezone
from numbers import Number, Real, Integral
from math import isnan, floor
from pickle import PickleError
import numpy as np
from Orange.data import _variable
from Orange.util import Registry, color_to_hex, hex_to_color, Reprable
__all__ ... | |
# 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... | |
"""
********************************************************************************
* Name: gen_commands.py
* Author: Nathan Swain
* Created On: 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
"""
import os
fro... | |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores
from moto.ec2.utils import filters_from_querystring
class VPCs(BaseResponse):
def create_vpc(self):
cidr_block = self._get_param('CidrBlock')
instance_tenancy ... | |
# 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
#
# Unless required by applicable law or agr... | |
import wx
import numpy as np #For the argmax() functionality
import math
import copy #This is needed because sometimes the temp lists modify their parent lists. So, deep copies are made.
class LogicCalculator:
"""
This is the main class for the calculator function.
First, it determines what functions to use. It d... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2021) Hewlett Packard Enterprise Development LP
#
# 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... | |
__author__ = 'tdp'
from Decode.utils import isZeroBit
from Execute.utils import *
import operator as op
CPSR_Mask = 0b11111000111111110000001111011111
APSR_Mask = 0b11111000000111100000000000000000
class StandardInstructions:
def __init__(self, registers, process_mode, memory):
self.registers = registers... | |
from __future__ import unicode_literals
import datetime
from decimal import Decimal
import unittest
import warnings
from django import test
from django import forms
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import connection, transaction, models, IntegrityErr... | |
""" Analize test results for finding bottlenecks """
import re
import sys
import csv
import time
import bisect
import os.path
import argparse
import collections
import yaml
import texttable
try:
import pygraphviz as pgv
except ImportError:
pgv = None
sys.path.append("/mnt/other/work/disk_perf_test_tool")
f... | |
# orm/interfaces.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Contains various base classes used throughout the ORM.
Defines some key base... | |
# Copyright 2013 dotCloud 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 t... | |
##########################################################################
#
# Copyright 2011 Jose Fonseca
# 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 res... | |
import unittest
import string
import sys
import os
import tempfile
import zipfile
import shutil
import copy
from pynhost import ruleparser
from pynhost import matching
class TestRuleMatching(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
def test_overflow1(self):
rule = rulepa... | |
# Scramble Solver v0.1
# ====================
import solver
import os
import time
import csv
from sys import argv
LOG_STATS = True
class StatGetter:
def __init__(self):
self.sourcedir = os.getcwd()
self.datadir = self.sourcedir + "/solutiondata/"
os.chdir(self.datadir)
self.statfile = open('stats.csv', 'a')... | |
# NEEDS FIXING
# -*- coding: utf-8 -*-
'''
fantastic Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later versio... | |
# -*- coding: utf-8 -*-
from page_objects import PageObject, PageElement, MultiPageElement
class Homepage(PageObject):
stylesheets = MultiPageElement(tag_name='link')
scripts = MultiPageElement(tag_name='script')
start_button = PageElement(name='new_game')
bank_cash ... | |
# =========================================================================================
# Implementation of "Show, Attend and Tell: Neural Caption Generator With Visual Attention".
# There are some notations.
# N is batch size.
# L is spacial size of feature vector (196).
# D is dimension of image feature vector (5... | |
"""
Module for testing the ``serpentTools`` package
"""
from functools import wraps
from unittest import TestCase, SkipTest
from logging import NOTSET
from numpy import stack
from numpy.testing import assert_allclose
from serpentTools.messages import (
DictHandler, __logger__, removeHandler, addHandler,
)
from ser... | |
"""Support for HomematicIP Cloud climate devices."""
import logging
from typing import Any, Dict, List, Optional, Union
from homematicip.aio.device import AsyncHeatingThermostat, AsyncHeatingThermostatCompact
from homematicip.aio.group import AsyncHeatingGroup
from homematicip.base.enums import AbsenceType
from homema... | |
# Copyright 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.