gt stringclasses 1
value | context stringlengths 2.49k 119k |
|---|---|
# ccm node
from __future__ import with_statement
import os
import re
import shutil
import signal
import stat
import subprocess
import time
import yaml
from six import print_
from ccmlib import common
from ccmlib.node import Node, NodeError
class DseNode(Node):
"""
Provides interactions to a DSE node.
... | |
"""The built-in Socket Mode client
* https://api.slack.com/apis/connections/socket
* https://slack.dev/python-slack-sdk/socket-mode/
"""
import logging
from concurrent.futures.thread import ThreadPoolExecutor
from logging import Logger
from queue import Queue
from threading import Lock
from typing import Union, Optio... | |
# pylint: disable=g-bad-file-header
# 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/LICENS... | |
import os
import time
from datetime import datetime
import pytest
from pykechain.enums import ServiceEnvironmentVersion, ServiceExecutionStatus, ServiceType
from pykechain.exceptions import APIError, IllegalArgumentError, MultipleFoundError, NotFoundError
# new in 1.13
from pykechain.models import Service
from pykec... | |
from __future__ import print_function
import subprocess,os,shutil,sys
if not os.path.exists('_deps'):
os.mkdir('_deps')
def InstallPrereqs():
""" Get the requirements for CoolProp """
#Collect the source for Cython and put in _deps/cython-master
import urllib,zipfile
print('getting cython ... | |
"""Implementation of RootOf class and related tools. """
from __future__ import print_function, division
from sympy.core import (S, Expr, Integer, Float, I, Add, Lambda, symbols,
sympify, Rational, Dummy)
from sympy.core.cache import cacheit
from sympy.core.function import AppliedUndef
from sympy.functions.el... | |
# Copyright (c) 2012 Rackspace Hosting
# 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 req... | |
# 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 ... | |
# Copyright (c) 2018 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 -*-
from __future__ import absolute_import, print_function, unicode_literals
from unittest import TestCase
from pyup.providers.github import Provider
from pyup.requirements import RequirementsBundle
from pyup import errors
from github import GithubException, UnknownObjectException
from mock import M... | |
# -*- encoding: utf-8 -*-
'''
HubbleStack Nova module for auditing running services.
Supports both blacklisting and whitelisting services. Blacklisted services
must not be running. Whitelisted services must be running.
:maintainer: HubbleStack / basepi
:maturity: 2016.7.0
:platform: All
:requires: SaltStack
This aud... | |
from __future__ import print_function
import os, sys, inspect
import h5py
import numpy as np
import matplotlib
import random
import math
import multiprocessing
from PIL import Image
from Crypto.Random.random import randint
from functools import partial
# Load the configuration file
import config
cmd_folder = os.path.... | |
import random
from .operators import Operator
from .states import State, Goal, PartialState
from heapq import heappop, heappush
from collections import deque
from .hsp import h_add, h_max
class GoalConditions(PartialState):
def __init__(self, conditions): # Difference is that this is a list
self.conditions = con... | |
# Copyright (c) 2016 Canonical Ltd
#
# 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 ... | |
from __future__ import division, absolute_import, print_function
import sys
import re
import os
if sys.version_info[0] < 3:
from ConfigParser import RawConfigParser
else:
from configparser import RawConfigParser
__all__ = ['FormatError', 'PkgNotFound', 'LibraryInfo', 'VariableSet',
'read_config', 'pa... | |
#
# 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... | |
import logging
from typing import Union
from .Deserializer import Deserializer
from .RateLimiter import RateLimiter
from .Handlers import (
DeprecationHandler,
DeserializerAdapter,
DictionaryDeserializer,
RateLimiterAdapter,
SanitationHandler,
ThrowOnErrorHandler,
TypeCorrectorHandler,
)
... | |
import mock
import pytest
import time
from django.contrib.auth.models import Group
from django.core.exceptions import ValidationError
from addons.github.tests import factories
from addons.osfstorage.models import OsfStorageFile
from framework.auth import Auth
from django.contrib.auth.models import AnonymousUser
from d... | |
# Ensure following run before this script can work:
#
# /opt/datadog-agent/embedded/bin/pip install --upgrade pysnmp
#
# sudo -u dd-agent /opt/datadog-agent/bin/mibdump.py SNMPv2-SMI KEEPALIVED-MIB
import re
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.hlapi import SnmpEngine, ContextData, nextCmd,... | |
import logging
from collections import defaultdict
import redis
from django.utils import timezone
from django.db import models
import django_rq
import rq, rq.queue, rq.job, rq.exceptions
from stream_analysis import AnalysisTask, cleanup, get_stream_cutoff_times
from twitter_stream.models import StreamProcess, FilterT... | |
"""module for complete independent games"""
import functools
import itertools
import numpy as np
from gameanalysis import rsgame
from gameanalysis import utils
class _MatrixGame(rsgame._CompleteGame): # pylint: disable=protected-access
"""Matrix game representation
This represents a complete independent ga... | |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABC, abstractmethod
from dataclasses import FrozenInstanceError, dataclass
import pytest
from pants.util.meta import (
SingletonMetaclass,
classproperty,
deco... | |
# 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... | |
"""UniFi Controller abstraction."""
import asyncio
from datetime import timedelta
import ssl
from aiohttp import CookieJar
import aiounifi
from aiounifi.controller import (
DATA_CLIENT_REMOVED,
DATA_DPI_GROUP,
DATA_DPI_GROUP_REMOVED,
DATA_EVENT,
SIGNAL_CONNECTION_STATE,
SIGNAL_DATA,
)
from aiou... | |
# Copyright 2022 The Scenic Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import logging
import os
import unittest
import warnings
from abc import ABC, ABCMeta, abstractmethod
from collections import defaultdict
from contextlib import contextman... | |
#!/usr/bin/env python
# Copyright (C) 2015 OpenStack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | |
# coding=utf-8
import re
from datetime import datetime, timedelta
from uuid import uuid4
from multiprocessing import Queue, freeze_support
import os
from flask import Flask, render_template, request, url_for, session, g
from flask.json import jsonify
from flask_login import LoginManager, login_user, login_required, lo... | |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import textwrap
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple, cast
from pants.core.util_rules import archive
fr... | |
# 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 ... | |
# mininode.py - Ulm P2P network half-a-node
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# This python code was modified from ArtForz' public domain half-a-node, as
# found in the mini-node branch of http://github.com/j... | |
#!/usr/bin/python
import web
import os
#import gc
#gc.set_debug(gc.DEBUG_STATS)
import logging
logging.basicConfig(level=logging.INFO)
#import logging.handlers
import json
import time
import base64
import gzip
# own modules
from datalogger import DataLogger as DataLogger
from datalogger import TimeseriesStats as Times... | |
#!/usr/bin/python2.5
# Copyright (C) 2007 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 la... | |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_urllib_parse_unquote_plus,
)
from ..utils import (
clean_html,
determine_ext,
int_or_none,
sanitized_Request,
ExtractorError,
urlencode_postdata
)
... | |
#!/usr/bin/env python
################################################################################
# #
# armor.py #
# ... | |
from app import app
from flask import request, url_for
from threading import Lock
from urllib import quote
import time
from es_connection import es
from es_queries import _build_email_query
from es_query_utils import _query_emails, _count_emails, _query_email_attachments, _map_emails_to_row,_map_node
from es_series ... | |
"""Base classes for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import copy
import inspect
import warnings
import numpy as np
from scipy import sparse
from .externals import six
###############################################################################
de... | |
#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo 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 ... | |
# Copyright (c) 2011-2015 by California Institute of Technology
# 2014 by The Regents of the University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of sour... | |
# Lint as: python3
# 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 ... | |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... | |
# Natural Language Toolkit: Dependency Grammars
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Jason Narad <jason.narad@gmail.com>
#
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
import math
from nltk.grammar import parse_dependency_grammar
from dependencygraph import *
############... | |
from collections import namedtuple
import taxcalc
import dropq
import os
import requests
from requests.exceptions import Timeout, RequestException
import json
import pandas as pd
import time
#
# Prepare user params to send to DropQ/Taxcalc
#
NUM_BUDGET_YEARS = int(os.environ.get('NUM_BUDGET_YEARS', 10))
START_YEAR =... | |
#
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
"""The tests for the Rfxtrx switch platform."""
import unittest
import pytest
from homeassistant.bootstrap import setup_component
from homeassistant.components import rfxtrx as rfxtrx_core
from tests.common import get_test_home_assistant
@pytest.mark.skipif("os.environ.get('RFXTRX') != 'RUN'")
class TestSwitchRfxt... | |
import os
import json
import bisect
import datetime
import cass_connection
from collections import defaultdict
import cassandra.query as cql
M5NR_VERSION = 1
def rmqLogger(channel, stype, statement, bulk=0):
if not channel:
return
truncate = (statement[:98] + '..') if len(statement) > 100 else statem... | |
from aiohttp.web import Response, json_response
from functools import wraps
from flask import current_app
from uuid import UUID
import sentry_sdk
from zeus import auth
from zeus.exceptions import InvalidPublicKey, UnknownRevision
from zeus.utils.sentry import span
from .utils import get_vcs, save_revision
def log_... | |
#!/usr/bin/env python
#
# Copyright 2007 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... | |
import os
import re
import sys
import uuid
import prettytable
from manilaclient import exceptions
from manilaclient.openstack.common import strutils
def arg(*args, **kwargs):
"""Decorator for CLI args."""
def _decorator(func):
add_arg(func, *args, **kwargs)
return func
return _decorator
... | |
#!/usr/bin/env python2.7
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | |
# Copyright (c) 2015 Orange.
# 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 a... | |
# coding=utf-8
import re
_RE_FIND_FIRST_CAP = re.compile('(.)([A-Z][a-z]+)')
_RE_SPAN_OF_CAPS = re.compile('([a-z0-9])([A-Z])')
def camelcase_to_underscore(name):
return _RE_SPAN_OF_CAPS.sub(r'\1_\2',
_RE_FIND_FIRST_CAP.sub(r'\1_\2', name)
).lower(... | |
from . import six
import contextlib
import os
import sys
import re
from itertools import takewhile
from .exceptions import BundleError
__all__ = ('md5_constructor', 'pickle', 'set', 'StringIO',
'common_path_prefix', 'working_directory', 'is_url')
if sys.version_info >= (2, 5):
import hashlib
md5... | |
import warnings
import numpy as np
from scipy.stats import norm
from scipy.optimize import minimize
def acq_max(ac, gp, y_max, bounds, random_state, n_warmup=10000, n_iter=10):
"""
A function to find the maximum of the acquisition function
It uses a combination of random sampling (cheap) and the 'L-BFGS-... | |
from __future__ import absolute_import, print_function
import functools
import string
import struct
import operator
from wave_editor import wave_functions
WAVE_VERSION = 1
WAVE_HEADER_ID = 'wave'
wave_header = struct.Struct("BBH")
wave_sample = struct.Struct("B")
class WaveFileError(Exception):
pass
class Wa... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import If, Switch, Concat
from hwt.code_utils import rename_signal
from hwt.hdl.types.bits import Bits
from hwt.hdl.types.enum import HEnum
from hwt.interfaces.utils import propagateClkRst, addClkRst
from hwt.synthesizer.rtlLevel.rtlSignal import RtlSignal
f... | |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from collections import namedtuple
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple
import pytest
from pants.eng... | |
#!/usr/bin/env python
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import astropy.io.ascii as ascii_io
import fitsio
import bass
import bokextract
datadir = '/global/scratch2/sd/imcgreer/'
ndwfs_starfile = datadir+'ndwfs/starcat.fits'
bootes_sdss_starfile = datadir+... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a ... | |
"""Analysis engine service."""
import dacite
import pandas as pd
from math import log, pi
from CoolProp.CoolProp import PropsSI
from CoolProp.HumidAirProp import HAPropsSI
from scipy.stats import chi2
from uncertainties import ufloat
from coimbra_chamber.access.experiment.service import ExperimentAccess
from coimbr... | |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | |
#!/usr/bin/python3.4
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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... | |
import random
import math
import datetime as dt
import urllib.request
import urllib
import requests
try:
# Python 2.6-2.7
from HTMLParser import HTMLParser
except ImportError:
# Python 3
from html.parser import HTMLParser
# This module contains all the shit methods used for getting comic URLs... ugh.
... | |
# -*- coding: utf-8 -*-
"""
CRF with different types of nodes
NOTE: this is an abstract class. Do not use directly.
JL. Meunier
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 witho... | |
suite = {
"mxversion" : "5.55.0",
"name" : "sulong",
"versionConflictResolution" : "latest",
"imports" : {
"suites" : [
{
"name" : "graal-core",
"version" : "ca165d0f0de274911d1b36b0113e3fd4c6952787",
"urls" : [
{"url" : "https://github.com/graalvm/g... | |
# Copyright 2013 Red Hat, 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... | |
# -------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Stefan
#
# Created: 30.07.2017
# Copyright: (c) Stefan 2017
# Licence: <your licence>
# -------------------------------------------------------------------------------
fr... | |
# 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 ... | |
#!/usr/bin/python
# ----------------------------------------------------------------------
# Copyright (2010) Aram Davtyan and Garegin Papoian
# Papoian's Group, University of Maryland at Collage Park
# http://papoian.chem.umd.edu/
# Last Update: 03/04/2011
# ---------------------------------------------------------... | |
#
# 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 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | |
import unittest
from collections import OrderedDict
from pypika import (
Array,
Field,
JSON,
QueryException,
Table,
)
from pypika.dialects import PostgreSQLQuery
class InsertTests(unittest.TestCase):
table_abc = Table("abc")
def test_array_keyword(self):
q = PostgreSQLQuery.into(... | |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of headers messages to announce blocks.
Setup:
- Two nodes, two p2p connections to nod... | |
# -*- coding: utf-8 -*-
"""
pgshift: write a Postgres pg_dump .sql file to Redshift via S3
"""
from __future__ import division, print_function
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import gzip
import json
import math
import os
import re
try:
from urlparse impor... | |
#!/usr/bin/env python
# A part of pdfrw (pdfrw.googlecode.com)
# Copyright (C) 2006-2009 Patrick Maupin, Austin, Texas
# MIT license -- See LICENSE.txt for details
'''
The PdfWriter class writes an entire PDF file out to disk.
The writing process is not at all optimized or organized.
An instance of the PdfWriter cl... | |
# Copyright (c) 2010 Ross Kinder. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script downloads and builds the third party dependencies for Windows.
# For each dependency do roughly the following steps:
# - download and extract the ... | |
# canonical.py - functions for converting systems to canonical forms
# RMM, 10 Nov 2012
from .exception import ControlNotImplemented
from .lti import issiso
from .statesp import StateSpace
from .statefbk import ctrb, obsv
from numpy import zeros, shape, poly, iscomplex, hstack, dot, transpose
from numpy.linalg import... | |
from devp2p.protocol import BaseProtocol, SubProtocolError
from ethereum.transactions import Transaction
from ethereum.blocks import Block, BlockHeader
import rlp
import gevent
import time
from ethereum import slogging
log = slogging.get_logger('protocol.eth')
class ETHProtocolError(SubProtocolError):
pass
clas... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
import unittest
import random
import math
import copy
from sudoku.sudoku_algorithms import *
VALID_PUZZLE = [
[0,3,5,2,9,0,8,6,4],
[0,8,2,4,1,0,7,0,3],
[7,6,4,3,8,0,0,9,0],
[2,1,8,7,3... | |
# 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.
# --------------------------------------------------------------------... | |
#!/usr/bin/env python
"""Support classes for automated testing.
* `AsyncTestCase` and `AsyncHTTPTestCase`: Subclasses of unittest.TestCase
with additional support for testing asynchronous (`.IOLoop`-based) code.
* `ExpectLog` and `LogTrapTestCase`: Make test logs less spammy.
* `main()`: A simple test runner (wra... | |
#
# 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
# ... | |
# Copyright (c) 2020 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 appli... | |
import numpy as np
import random
import theano
from keras.models import Sequential
from keras.callbacks import Callback
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.regularizers import l2
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.utils import np_utils... | |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 Canonical Corp.
# 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
#
# htt... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""test_02_subcmd_filter.py
Test prodigal filtering for pdp script
This test suite is intended to be run from the repository root using:
nosetests -v
Individual test classes can be run using, e.g.:
$ nosetests -v tests/test_subcommands.py:TestConfigSubcommand
Each co... | |
from datetime import datetime
from cmd2 import Cmd as Lobotomy
from blessings import Terminal
from framework.logging.logger import Logger
t = Terminal()
class Run(Lobotomy):
def __init__(self):
Lobotomy.__init__(self)
# APK related commands
# --------------------
# loader, decompile, debugg... | |
# Copyright (c) 2015 Intel, Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | |
from __future__ import annotations
import collections
from datetime import datetime
from decimal import Decimal
from functools import wraps
import operator
import os
import re
import string
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
Counter,
Iterable,
)
import warnings
import nu... | |
# Copyright (c) 2018 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... | |
from django.core.cache import cache, InvalidCacheBackendError
from django.core.exceptions import ImproperlyConfigured
from django.test import RequestFactory, TestCase
from django.test.utils import override_settings
from django.views.generic import View
from ratelimit.decorators import ratelimit
from ratelimit.exceptio... | |
## This is a brewtroller port to Python
##All credits goes to brewtroller
## TODO need to put better diclamer
from Enum import *
from timer import *
from Test_I2C import resetHeatOutput
# unsigned long lastHop, grainInStart;
# unsigned int boilAdds, triggered;
# Used to determine if the given step is the active st... | |
from itertools import chain
import numpy as np
from cached_property import cached_property
from devito.ir.equations import ClusterizedEq
from devito.ir.support import (PARALLEL, PARALLEL_IF_PVT, IterationSpace, DataSpace,
Scope, detect_io, normalize_properties)
from devito.symbolics imp... | |
import mock
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer.functions.connection import convolution_2d
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parame... | |
from datetime import datetime
import os
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import tensorflow as tf
import generative_adversarial_networks.tensorflow.utils as utils
class ConvLayer(object):
def __init__(self, name, in_depth, out_depth, apply_batch_norm,
filter_... | |
#
# This file is part of snmpsim software.
#
# Copyright (c) 2010-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/snmpsim/license.html
#
# Managed value variation module: simulate a numeric value
#
# Valid values in module options are:
#
# 2 - Integer
# 65 - Counter32
# 66 - Gauge32
# 67 ... | |
import os
import glob
#####################################################
######Init the files##################################
#####################################################
os.remove("a0.txt")
os.remove("a1.txt")
os.remove("a2.txt")
os.remove("a3.txt")
os.remove("a4.txt")
os.remove("a5.txt")
os.remove("a6... | |
"""Style settings panel."""
from __future__ import unicode_literals
import wx
from . import gui
from . import color_setting_dialog
from . import grid_helper
from . import settings_codes as sc
from ..rgba import RGBA
from ..x11colors import name2hex
from .. import util
class StyleSettings(gui.StyleSettingsPanel, grid_... | |
# A simple DOC file parser based on pyole
import os
import struct
import logging
import datetime
from pyole import *
class FIBBase(OLEBase):
wIdent = 0
nFib = 0
unused = 0
lid = 0
pnNext = 0
Flags1 = 0
fDot = 0
fGlsy = 0
fComplex = 0
fHasPic = 0
cQuickSaves = 0
fEncry... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.