gt
stringclasses
1 value
context
stringlengths
2.49k
119k
import os import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from imblearn.over_sampling import SMOTE def load_data(): '''Preprocess data and return X, y, label_list''' # Data files acc_x_card = 'data/tj_02_acc_...
# Software License Agreement (BSD License) # # Copyright (c) 2010, Willow Garage, 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 2016 PerfKitBenchmarker 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import Markup from flask import current_app from flask import request from flask import url_for _bs = '<li class="previous"><a href="{0}">{1}</a></li>' _bs4 = '<li class="page-item">\ <a class="page-link" href="{0}" ar...
""" The rechunk module defines: intersect_chunks: a function for converting chunks to new dimensions rechunk: a function to convert the blocks of an existing dask array to new chunks or blockshape """ from __future__ import absolute_import, division, print_function import heapq from itertools ...
"""This module contains analysis module helpers to solve path constraints.""" from functools import lru_cache from typing import Dict, Tuple, Union from z3 import sat, unknown, FuncInterp import z3 from mythril.analysis.analysis_args import analysis_args from mythril.laser.ethereum.state.global_state import GlobalStat...
from biicode.common.exception import NotInStoreException, ForbiddenException,\ NotFoundException from biicode.server.model.payment.user_subscription import CURRENT_PLANS class PlanUpgradeNeeded(ForbiddenException): '''Exception for trying to adding a new contributor if the plan don't allow more contributi...
"""Test config entries API.""" import pytest from homeassistant.auth.providers import homeassistant as prov_ha from homeassistant.components.config import ( auth_provider_homeassistant as auth_ha) from tests.common import MockUser, register_auth_provider @pytest.fixture(autouse=True) def setup_config(hass): ...
# # Copyright 2014 Knowledge Economy Developments Ltd # # Henry Gomersall # heng@kedevelopments.co.uk # # 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 r...
from . import _get_clients, _setup import pytest import sure # noqa # pylint: disable=unused-import from botocore.exceptions import ClientError from moto import mock_batch, mock_iam, mock_ec2, mock_ecs, settings from uuid import uuid4 # Yes, yes it talks to all the things @mock_ec2 @mock_ecs @mock_iam @mock_batch de...
from pykechain.enums import NotificationEvent, NotificationChannels, NotificationStatus from pykechain.exceptions import NotFoundError, MultipleFoundError, APIError, IllegalArgumentError from pykechain.models import User, Team from pykechain.models.notification import Notification from tests.classes import TestBetamax ...
from datetime import datetime from django.utils import timezone from bulk_update.helper import bulk_update from pontoon.base.models import ( Entity, Locale, Translation, ) from pontoon.base.utils import match_attr class ChangeSet(object): """ Stores a set of changes to be made to the database a...
""" Simplex optimization. """ from __future__ import absolute_import from __future__ import division import copy import collections import logging import logging.config import numpy as np import re import sqlite3 import textwrap import calculate import compare import constants as co import datatypes import opt import...
# tempfile.py unit tests. import tempfile import os import signal import sys import re import warnings import unittest from test import support if hasattr(os, 'stat'): import stat has_stat = 1 else: has_stat = 0 has_textmode = (tempfile._text_openflags != tempfile._bin_openflags) has_spawnl = hasattr(os...
import argparse from collections import OrderedDict import os import re import sys import types if sys.version_info >= (3, 0): from io import StringIO else: from StringIO import StringIO __version__ = "0.9.3" ACTION_TYPES_THAT_DONT_NEED_A_VALUE = {argparse._StoreTrueAction, argparse._StoreFalseAction, a...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from os import path from os import SEEK_END from os import system from os import unlink from psutil import Process import click import curses import importlib import psutil import sys try: import gunicor...
#!/usr/bin/env python #=============================================================================== # Copyright (c) 2014 Geoscience Australia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: ...
# Copyright 2021 DeepMind Technologies 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 agre...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This is the main executable of HTPC Manager. It parses the command line arguments, sets globals variables and calls the start function to start the server. """ import os import sys import htpc import webbrowser import locale import logging def parse_arguments(): ...
# # Copyright 2014 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/licenses/LICENSE-2.0 # # Unless req...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import logging # Django REST Framework from rest_framework.exceptions import MethodNotAllowed, PermissionDenied from rest_framework import permissions # AWX from awx.main.access import * # noqa from awx.main.models import * # noqa from awx.main.utils...
# Copyright (c) 2016 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Create Station-model plots.""" from enum import Enum import numpy as np from .wx_symbols import (current_weather, high_clouds, low_clouds, mid_clouds, ...
""" Session related tags Note: It's better to use tag names without underscores, since those need to be escaped in MarkItUp CMS plugins. """ from anglicize import anglicize from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() ##...
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
# # 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 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 functools import os import pkgutil import sys from collections import OrderedDict, defaultdict from contextlib import suppress from importlib import import_module import django from django.apps import apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core....
# 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...
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import weakref import numpy as np from .. import gloo from .. import app from .visuals import VisualNode from ..visuals.transf...
#!/usr/bin/env python import os import re from genomicode import genefinder, timer, Matrix, matrixlib from genomicode import parselib, filelib, arrayannot # retrieve_all_dates # retrieve_diseases # Not quite a good idea. datatype_match = { 'RSEM_genes' : ( 'Merge_rnaseqv2__illuminahiseq_rnaseqv2__unc_edu...
# -*- coding: utf-8 -*- """ Check that SendInput can work the way we want it to The tips and tricks at http://www.pinvoke.net/default.aspx/user32.sendinput is useful! """ import time import ctypes __all__ = ['KeySequenceError', 'SendKeys'] try: str_class = basestring def enforce_unicode(text): retur...
# 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 ...
#!/usr/bin/python ''' VTK engine room for mrMeshPy viewer The main vtk processing is done by functions here - although some hardcore processing is handled in subroutines of other imported modules. A core concept here is the tracking (kepping in scope) or the "targetVTKWindow" - this is a vtkRenderWindowInteractor...
#!/usr/bin/env python """Command line tool for merging PRs.""" import collections import pathlib import sys import textwrap import click import plumbum import requests from plumbum import cmd IBIS_HOME = pathlib.Path(__file__).parent.parent GITHUB_API_BASE = "https://api.github.com/repos/ibis-project/ibis" git = c...
"""bot - Bot Module This module defines the Bot Component which connects to an IRC Network and reacts to IRC Events. The Bot Component consists of the TCPClient and IRC Components. """ import re from socket import gethostname from traceback import format_exc from circuits.net.events import connect from circuits.ne...
# -*- coding: utf-8 -*- import io import textwrap import string import pytest import decimal import canmatrix.formats.dbc def test_long_signal_name_imports(): long_signal_name = u'FAILURE_ZELL_UNTERTEMPERATUR_ENTLADEN_ALARM_IDX_01' assert len(long_signal_name) > 32 dbc = io.BytesIO(textwrap.dedent(u'''\ ...
# 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...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( ProjectFactory, AuthUserFactory, PrivateLinkFactory, ) from osf.utils import permissions @pytest.fixture() def admin(): return AuthUserFactory() @pytest.fixture() def base_url(): return '/{}nodes/'.fo...
try: import unittest2 as unittest except ImportError: import unittest from graphite.render.attime import parseTimeReference, parseATTime, parseTimeOffset, getUnitString from datetime import datetime, timedelta from django.utils import timezone from django.test import TestCase import pytz import mock class Mo...
import pytest from tests.utils import MockCoroutine import io import time import base64 import hashlib from http import client from unittest import mock import aiohttpretty from waterbutler.core import streams from waterbutler.core import metadata from waterbutler.core import exceptions from waterbutler.core.path i...
""" OpenOffice to HTML Converter for PubTal Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) 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 source code must reta...
#!/usr/bin/env python # Author: Will Skywalker # Air Traffic Control Simulator # License: Apache 2.0 from __future__ import division import random, math, time, json import sim_gui, sound __version__ = '0.0.1' APPROACHING_POINTS = (((220, 50), 100, 190), ((560, 50), 120, 255), ...
# 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...
from Node import error SYNTAX_NODE_SERIALIZATION_CODES = { # 0 is 'Token'. Needs to be defined manually # 1 is 'Unknown'. Needs to be defined manually 'UnknownDecl': 2, 'TypealiasDecl': 3, 'AssociatedtypeDecl': 4, 'IfConfigDecl': 5, 'PoundErrorDecl': 6, 'PoundWarningDecl': 7, 'Poun...
""" Giving models a custom manager You can use a custom ``Manager`` in a particular model by extending the base ``Manager`` class and instantiating your custom ``Manager`` in your model. There are two reasons you might want to customize a ``Manager``: to add extra ``Manager`` methods, and/or to modify the initial ``Q...
"""Tests for ETL pipelines""" from contextlib import contextmanager from importlib import reload from unittest.mock import patch from course_catalog.constants import PlatformType from course_catalog.etl import pipelines from course_catalog.etl.constants import ( ProgramLoaderConfig, CourseLoaderConfig, Lea...
# 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...
""" Author: Nathan Sprague """ import numpy as np import theano import unittest import numpy.testing import lasagne import deep_q_rl.q_network as q_network class ChainMDP(object): """Simple markov chain style MDP. Three "rooms" and one absorbing state. States are encoded for the q_network as arrays with ...
<<<<<<< HEAD <<<<<<< HEAD '''A multi-producer, multi-consumer queue.''' try: import threading except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop try: from time import monotonic as time except ImportError: from time import time __al...
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # hardirqs Summarize hard IRQ (interrupt) event time. # For Linux, uses BCC, eBPF. # # USAGE: hardirqs [-h] [-T] [-N] [-C] [-d] [-c CPU] [interval] [outputs] # # Thanks Amer Ather for help understanding irq behavior. # # Copyright (c) 2015 Bren...
from django.db import models from datetime import date from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponse from wagtail.wagtailcore.models import Page, Orderable from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailimages.edit_handlers import...
# Copyright (c) 2015 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/licenses/LICENSE-2.0 # # Unless ...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
from tornado.websocket import WebSocketHandler from pystil.context import url, MESSAGE_QUEUE, log, Hdr from pystil.db import CriterionView as Visit from tornado.options import options from tornado.ioloop import IOLoop from psycopg2.extensions import POLL_OK, POLL_READ, POLL_WRITE from sqlalchemy.sql.compiler import SQL...
# Copyright 2014, Ansible, Inc. # Luke Sneeringer <lsneeringer@ansible.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
"""Here some convenience getter methods for models.""" import re # TODO: store original_key in the 'info' field # TODO: these should work: # nicety -> niceties # orchestrate -> orchestration # stratum -> strata # man -> men // check if it is a suffix for example craftsman -> craftsmen # glass -> glasses # dig -> digg...
# -*- coding: utf-8 -*- from io import BytesIO, BufferedReader from pytest import raises from watson.auth.providers.session.decorators import auth, login, logout, forgotten, reset from watson.events import types from watson.framework import controllers, exceptions from tests.watson.auth import support class SampleCon...
# Common utilities and Python wrappers for qemu-iotests # # Copyright (C) 2012 IBM Corp. # # 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 2 of the License, or # (at your option) ...
import mock import csv import furl import pytz import pytest from datetime import datetime, timedelta from nose import tools as nt from django.test import RequestFactory from django.http import Http404 from django.core.files.uploadedfile import SimpleUploadedFile from django.core.urlresolvers import reverse from djang...
#!/usr/bin/env python # # Copyright 2015 British Broadcasting Corporation # # 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...
from uio.utils import fix_ctypes_struct, cached_getter, add_field import ctypes from ctypes import c_uint8 as u8, c_uint16 as u16, c_uint32 as u32 from .eirq import EIrq ctr_t = u16 # counter value # ePWM has a main irq and a tripzone irq. The tripzone irq uses an EIrq register # block just like eCAP and eQEP do. Th...
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (...
from __future__ import unicode_literals import base64 import hmac import time import uuid from django.conf import settings from django.contrib.auth import authenticate from django.core.exceptions import ImproperlyConfigured from django.middleware.csrf import _sanitize_token, constant_time_compare from django.utils.htt...
# -*- coding: utf-8 -*- """Linear Filters for time series analysis and testing TODO: * check common sequence in signature of filter functions (ar,ma,x) or (x,ar,ma) Created on Sat Oct 23 17:18:03 2010 Author: Josef-pktd """ # not original copied from various experimental scripts # version control history is there ...
import datetime import fileinput import neovim import os import Queue import subprocess import sys import tempfile sys.path.append(os.path.dirname(os.path.abspath(__file__))) from actions import election_actions from filters import election_filters from nominations import election_nominations from positions import ele...
from django.db.models.sql import compiler from datetime import datetime REV_ODIR = { 'ASC': 'DESC', 'DESC': 'ASC' } SQL_SERVER_8_LIMIT_QUERY = \ """SELECT * FROM ( SELECT TOP %(limit)s * FROM ( %(orig_sql)s ORDER BY %(ord)s ) AS %(table)s ORDER BY %(rev_ord)s ) AS %(table)s ORDER BY %(ord)s"""...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ IPv4 Whois data collection and analysis tool Usage: ./whois.py collect <elastic_search_url> <index_name> <doc_name> [--sleep_min=<n>] [--sleep_max=<n>] [--threads=<n>] ./whois.py stats <elastic_search_url> <index_name> ./whois.py te...
# -*- coding=utf-8 -*- """ Shared utility functions which are not specific to any particular module. """ from __future__ import absolute_import import contextlib import copy import inspect import sys from functools import wraps import packaging.version import six from .environment import MYPY_RUNNING # format: off ...
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
''' Timeline ======== The :class:`Timeline` is a widget specialized for displaying time information on a continuous, and perhaps infinite, scale. It inherits from :class:`kivy.garden.tickline.Tickline` and thus allows zooming in and out, and panning across time. Since :class:`Timeline` works very much like :class:`ki...
# # 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...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import serialize from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import L...
""" Test the sensitivity of simulation parameters This is a very small package for testing the sensitivity of simulation results on some parameters. Its main functions include .. autosummary:: :toctree: run_simuls get_results run_func """ import os import subprocess import collections from jinja2...
from __future__ import division from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp, factorial, factorial2, Function, GoldenRatio, I, Integer, Integral, Interval, Lambda, Limit, Matrix, nan, O, oo, pi, Pow, Rational, Float, Rel, S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, ...
from __future__ import division from __future__ import unicode_literals import time import numpy as np import tensorflow as tf import collections from deepchem.utils.save import log from deepchem.metrics import to_one_hot from deepchem.metrics import from_one_hot from deepchem.models.tensorgraph.tensor_graph import T...
from __future__ import division, print_function, absolute_import import warnings import numpy.testing as npt import numpy as np import nose from scipy import stats """ Test all continuous distributions. Parameters were chosen for those distributions that pass the Kolmogorov-Smirnov test. This provides safe parame...
import os import sys import textwrap import pytest from _pytest.monkeypatch import MonkeyPatch @pytest.fixture def mp(request): cwd = os.getcwd() sys_path = list(sys.path) def cleanup(): sys.path[:] = sys_path os.chdir(cwd) request.addfinalizer(cleanup) return MonkeyPatch() de...
from bisect import bisect_left, bisect_right class SortedCollection(object): """Sequence sorted by a key function. SortedCollection() is much easier to work with than using bisect() directly. It supports key functions like those use in sorted(), min(), and max(). The result of the key function call is...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ GMM estimator class ------------------- """ from __future__ import print_function, division import warnings import numpy as np import numdifftools as nd from scipy.linalg import pinv from scipy.optimize import minimize from .hac_function import hac from .results im...
#!/usr/bin/env python import ast, base64, json from secret_manager import sec_manager from Crypto.PublicKey import RSA from swiftclient import client from keystoneauth1.identity import v3 from keystoneauth1 import session from keystoneclient.v3 import client as kc from keystoneclient.v3 import tokens from config impor...
# Copyright (c) 2014 ProphetStor, 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 requi...
# -*- 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 #...
# Copyright 2014 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# -*- coding: utf-8 -*- # Unittests for fixtures. from __future__ import unicode_literals import json import os import re import warnings from django.core.serializers.base import DeserializationError from django.core import management from django.core.management.base import CommandError from django.core.management.co...
# # 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...
from __future__ import annotations from typing import Any from public import public import ibis import ibis.common.exceptions as com from .. import datatypes as dt from .core import Expr @public class ValueExpr(Expr): """ Base class for a data generating expression having a fixed and known type, eithe...
import tensorflow as tf import numpy as np ############################################################################################################ # Convolution layer Methods def __conv2d_p(name, x, w=None, num_filters=16, kernel_size=(3, 3), padding='SAME', stride=(1, 1), initializer=tf.contrib.l...
import tensorflow as tf from neupy.core.properties import ( ProperFractionProperty, ParameterProperty, TypedListProperty, NumberProperty, IntProperty, ) from neupy.utils import asfloat from neupy.exceptions import ( WeightInitializationError, LayerConnectionError, ) from .base import Identi...
# -*- coding: utf-8 -*- """ Django settings for Budger project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_lite...
import re from deltas import wikitext_split from deltas.segmenters import ParagraphsSentencesAndWhitespace from revscoring.datasources import Datasource from revscoring.datasources.meta import filters, frequencies, mappers class Revision: def __init__(self, name, revision_datasources): super().__init__...
import logging from smtplib import SMTPException from celery import shared_task from django.conf import settings from django.core import signing from django.core.mail import send_mail from django.template import Context, Template from django.template.loader import get_template from waldur_core.core import utils as co...
# tests.test_target.test_class_balance # Tests for the ClassBalance visualizer # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Thu Jul 19 10:21:49 2018 -0400 # # ID: test_class_balance.py [] benjamin@bengfort.com $ """ Tests for the ClassBalance visualizer """ #######################################...
try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen from unittest import TestResult from flask_testing import TestCase, LiveServerTestCase from flask_testing.utils import ContextVariableDoesNotExist from .flask_app import create_app class TestSetup(TestCase): def creat...
""" @package mi.dataset.parser.presf_abc @file marine-integrations/mi/dataset/parser/presf_abc.py @author Christopher Fortin, Jeff Roy, Rene Gelinas @brief Parser for the presf_abc dataset driver This file contains code for the presf_abc parsers and code to produce data particles. This parser only parses recovered d...
# -*- coding: utf-8 -*- # Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python3 # Copyright (c) 2015-2018 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 litecoind with different proxy configuration. Test plan: - Start litecoind's with different proxy...
import numpy as n import os, glob, sys import casautil import logging, logging.config # set up tb = casautil.tools.table() class casa_sol(): """ Container for CASA caltable(s). Provides tools for applying to data of shape (nints, nbl, nch, npol). Initialize class based on input file(s) and selection crite...
import nose import time import pickle import networkx import logging l = logging.getLogger("angr.tests.test_cfgemulated") import os test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests') import angr from angr import options as o def compare_cfg(standard, g, funct...