gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from kivy.app import App from kivy.event import EventDispatcher from kivy.clock import Clock from kivy.properties import DictProperty from kivy.logger import Logger import netcheck import toast from jnius import autoclass, PythonJavaClass, java_method, cast from android import activity from functools import partial ...
# kcell.py # python3 import matplotlib.pyplot as plt import pandas as pd from sklearn import model_selection, svm, metrics, cluster, tree import kkeras import numpy as np import seaborn as sns def GET_clsf2_by_clst( nb_classes): def clsf2_by_clst( Xpart_cf, Xpart_ct): """ Clustering is performed and then, classi...
""" tests.test_component_group ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests the group compoments. """ # pylint: disable=protected-access,too-many-public-methods import unittest import logging import homeassistant as ha from homeassistant.const import STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN import homeassistant.component...
from __future__ import unicode_literals from calendar import timegm from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist from django.http import Http404, HttpResponse from django.template import Templat...
import json import pickle from binascii import b2a_hex from django.contrib.gis.gdal import ( CoordTransform, GDALException, OGRGeometry, OGRGeomType, SpatialReference, ) from django.template import Context from django.template.engine import Engine from django.test import SimpleTestCase from ..test_data import Tes...
from __future__ import unicode_literals import datetime from decimal import Decimal import re from django.db import connection from django.db.models import Avg, Sum, Count, Max, Min from django.test import TestCase, Approximate from django.test.utils import CaptureQueriesContext from .models import Author, Publisher...
#!/usr/bin/env python # 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 "Licen...
from flask import render_template, Blueprint, jsonify, request, abort, Response, current_app from paramiko.client import SSHClient, AutoAddPolicy import sys import random views = Blueprint("views", __name__, template_folder="templates") def _exec_command(command, switch_name=''): if not switch_name: switc...
import pytest from itertools import chain, combinations, product import networkx as nx tree_all_pairs_lca = nx.tree_all_pairs_lowest_common_ancestor all_pairs_lca = nx.all_pairs_lowest_common_ancestor def get_pair(dictionary, n1, n2): if (n1, n2) in dictionary: return dictionary[n1, n2] else: ...
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# Copyright 2010 Jacob Kaplan-Moss # Copyright 2011 OpenStack Foundation # Copyright 2012 Grid Dynamics # Copyright 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...
''' /****************************************************************** * * Copyright 2018 Samsung Electronics 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 python """ map.py State Estimation and Analysis for PYthon Utilities for dealing with basemap plotting. These routnes are simply abstractions over the existing basemap to make it quicker for generating basemap plots and figures. Examples ------- Assume you have longitude, latitu...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from hashl...
# Copyright 2015 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...
# 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...
import numpy as np import os import sys import copy import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D sys.path.append(os.path.join(os.path.dirname(__file__),"../")) from crowdsourcing.annotation_types.classification import * def combine_dicts(ds): v = {} for d in ds: for k in d: v[...
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Perform basic ELF security checks on a series of executables. Exit status will be 0 if successful, and...
""" Test the hashing module. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import time import hashlib import sys import gc import io import collections import itertools import pickle import random from decimal import Decima...
# -*- coding: utf-8 -*- ''' Module for managing windows systems. :depends: - win32net Support for reboot, shutdown, etc ''' from __future__ import absolute_import # Import python libs import logging from datetime import datetime # Import 3rd Party Libs try: import pythoncom import wmi import win32ne...
import logging from pip._vendor.packaging.utils import canonicalize_name from pip._internal.exceptions import ( DistributionNotFound, InstallationError, InstallationSubprocessError, MetadataInconsistent, UnsupportedPythonVersion, UnsupportedWheel, ) from pip._internal.models.wheel import Wheel...
#!/usr/bin/python # # Copyright (C) 2008 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 ...
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
import unittest import numpy as np from . import defHeaders from pycqed.analysis.tools import data_manipulation as dm_tools CBox = None class CBox_tests(unittest.TestCase): ''' This is a test suite for testing the QuTech_ControlBox Instrument. It is designed to provide a test function for each function as...
# encoding: utf-8 import curses import _curses import weakref from .editloop import FormDefaultEditLoop, FormNewEditLoop from .screen import ScreenArea from ..widget import button from ..widget import widget #import Menu from .. import util_viewhelp from ..globals import DISABLE_RESIZE_SYSTEM from .. import global_...
#!/usr/bin/env python # # Sybil - Python Profile Manager # Copyright (c) 2008, Patrick Kennedy # 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 re...
from typing import TYPE_CHECKING from eth_utils import to_bytes, to_canonical_address, to_checksum_address, to_hex from raiden.constants import UINT256_MAX from raiden.transfer.architecture import ( ContractSendEvent, ContractSendExpirableEvent, Event, SendMessageEvent, ) from raiden.transfer.identifi...
# # This file is part of GreatFET # from enum import IntEnum from warnings import warn from ..interface import GreatFETInterface # TODOs: # - XXX: Overhaul the GPIO(Collection) class to be more efficient # - More cleanup to use the GPIOPin model. # - Support ranges of pins from the same port (GPIOPort objects?)...
# This file includes the definition of a mix-in class that provides the low- # and high-level WCS API to the astropy.wcs.WCS object. We keep this code # isolated in this mix-in class to avoid making the main wcs.py file too # long. import warnings import numpy as np from astropy import units as u from .low_level_ap...
# # 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 # ...
import os from collections import OrderedDict from typing import Union import casadi as ca # noinspection PyPackageRequirements from lxml import etree from .model import HybridDae FILE_PATH = os.path.dirname(os.path.abspath(__file__)) SCHEMA_DIR = os.path.join(FILE_PATH, 'ModelicaXML', 'schemas') class XMLParser:...
"""Generic resource pool implementation.""" from __future__ import absolute_import, unicode_literals import os from collections import deque from . import exceptions from .five import Empty, LifoQueue as _LifoQueue from .utils.compat import register_after_fork from .utils.functional import lazy def _after_fork_cle...
#!/usr/bin/env python import numpy as np import time import json import copy from sklearn.metrics import confusion_matrix from multiclass_confidence_weighted_var_diag import MCWVarDiag from multiclass_soft_confidence_weighted_1_diag import MSCWIDiag from multiclass_soft_confidence_weighted_2_diag import MSCWIIDiag fr...
"""Functions to generate example data, e.g. example images or segmaps. Added in 0.5.0. """ from __future__ import print_function, division, absolute_import import os import json import imageio import numpy as np # filepath to the quokka image, its annotations and depth map # Added in 0.5.0. _FILE_DIR = os.path.dir...
# -*- coding: utf-8 -*- import logging import re import sys import pytest import cloudpickle import six from google.protobuf import json_format import verta from verta.environment import ( Python, ) from verta._internal_utils._pip_requirements_utils import ( SPACY_MODEL_PATTERN, get_pip_freeze, pin...
from JumpScale import j import os import time import stat from tarfile import filemode as _filemode _months_map = {1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec'} class FilesystemBase(object): def __init__(self, root, cmd...
# Copyright (c) 2004-2010 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
from sympy import AccumBounds, Symbol, floor, nan, oo, E, symbols, ceiling, pi, \ Rational, Float, I, sin, exp, log, factorial, frac from sympy.utilities.pytest import XFAIL x = Symbol('x') i = Symbol('i', imaginary=True) y = Symbol('y', real=True) k, n = symbols('k,n', integer=True) def test_floor(): a...
# This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # Licensed under the Apache License, Version 2.0 (the "License"). from django.core.exceptions import ValidationError from django.utils.six.moves import range from django.utils.translation import ugettext_lazy as _...
from __future__ import print_function import os import sys from rosdistro import get_distribution_cache from rosdistro import get_index from ros_buildfarm.common import get_binarydeb_job_name from ros_buildfarm.common import get_debian_package_name from ros_buildfarm.common import get_github_project_url from ros_bui...
# Copyright 2013 IBM Corp. # # 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...
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # 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 wi...
"""HTML5 Push Messaging notification service.""" from datetime import datetime, timedelta from functools import partial from urllib.parse import urlparse import json import logging import time import uuid from aiohttp.hdrs import AUTHORIZATION import voluptuous as vol from voluptuous.humanize import humanize_error f...
#!/usr/bin/env python # Source : Werkov, Github, PyQt4 examples # URL : https://github.com/Werkov/PyQt4/tree/master/examples/dbus/chat # This is only needed for Python v2 but is harmless for Python v3. import sip sip.setapi('QString', 2) from PyQt4 import QtCore, QtGui, QtDBus import time import tensorflow as tf im...
# Copyright 2020 Makani Technologies 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 agreed to...
#!/usr/bin/env python3 # Copyright (c) 2016-2017 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 label RPCs. RPCs tested are: - getaccountaddress - getaddressesbyaccount/getaddressesbyla...
#!/usr/bin/env python # coding: utf-8 # Copyright 2013 Abram Hindle # Copyright 2016 Boyan Peychoff # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Author: Alta Fang (altafang @caltech and alta @princeton) # Copyright (c) 2008-2015 California Institute of Technology. # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 30 09:17:36 2018 @author: barnhark """ import numpy as np import pytest from numpy.testing import assert_array_equal # , assert_array_almost_equal from landlab import RasterModelGrid from landlab.bmi import wrap_as_bmi from landlab.components impo...
import os from dvc.logger import Logger from dvc.config import Config from dvc.executor import Executor, ExecutorError from dvc.system import System class GitWrapperI(object): COMMIT_LEN = 7 def __init__(self, git_dir=None, commit=None): self._git_dir = git_dir self._commit = commit @pr...
from tkinter import * from tkinter.filedialog import askopenfilename from PIL import Image, ImageTk from endeavour import endeavour_functions import csv import os # Location of csv file to save result to. log_filename = r'results_log.csv' master = Tk() master.title("Machine Learning for Image Recognition Purposes")...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import six import os, sys import re import inspect import pkgutil import importlib import argparse import json import logging import arrow import requests import getpass from collections import OrderedDict from natsort import natsorted ...
""" Test for the various mlab source functions. These tests are higher level than the tests testing directly the MlabSource subclasses. They are meant to capture errors in the formatting of the input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2008, Enthought, Inc...
from __future__ import absolute_import, division, print_function, unicode_literals __metaclass__ = type import pickle import os import cv2 import numpy as np import atexit import copy import time import six import gc import abc from abc import abstractmethod from collections import Iterable import keras from keras.mo...
#!/usr/bin/python -Wall # ================================================================ # John Kerl # kerl.john.r@gmail.com # 2007-05-31 # ================================================================ from __future__ import division # 1/2 = 0.5, not 0. from sackmat_m import * from sackst_m import * import rando...
import itertools import json import os from urllib.parse import unquote from django.apps import apps from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect, JsonResponse from django.template import Context, Engine from django.urls import translate_url from django.utils.encoding imp...
from time import sleep from lettuce import world, step from nose.tools import assert_true, assert_equals from questionnaire.features.pages.questionnaires import QuestionnairePage from questionnaire.models import Question, QuestionOption, Theme, QuestionGroupOrder from questionnaire.tests.factories.question_group_factor...
# -*- coding: utf-8 -*- from hyper.packages.hyperframe.frame import ( Frame, DataFrame, RstStreamFrame, SettingsFrame, PushPromiseFrame, PingFrame, WindowUpdateFrame, HeadersFrame, ContinuationFrame, BlockedFrame, GoAwayFrame, ) from hyper.packages.hpack.hpack_compat import Encoder, Decoder from hyper.http2...
# # Coldcard Electrum plugin main code. # # import os, time, io import traceback from typing import TYPE_CHECKING, Optional import struct from electrum_mona import bip32 from electrum_mona.bip32 import BIP32Node, InvalidMasterKeyVersionBytes from electrum_mona.i18n import _ from electrum_mona.plugin import Device, hoo...
# MIT License # # Copyright (c) 2020-2021 CNRS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pu...
from mpi4py import MPI import mpiunittest as unittest import arrayimpl from functools import reduce prod = lambda sequence,start=1: reduce(lambda x, y: x*y, sequence, start) def skip_op(typecode, op): if typecode in 'FDG': if op in (MPI.MAX, MPI.MIN): return True return False def maxvalue...
""" The pyro wire protocol message. Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net). """ from __future__ import with_statement import hashlib import hmac import struct import logging import sys from Pyro4 import errors, constants import Pyro4.constants __all__ = ["Message"] log = lo...
# # Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U # # 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 unde...
# Copyright (c) 2011-2012 Vit Suchomel and Jan Pomikalek # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Character encoding detection library.""" import os import sys import struct ENCODE_REPLACEMENT_CHARACTER = ...
import math import numpy import statsmodels.api as sm lowess= sm.nonparametric.lowess import esutil from galpy.util import bovy_coords, bovy_plot from scipy.interpolate import interp1d,UnivariateSpline import apogee.tools.read as apread import isodist import numpy as np import matplotlib.pyplot as plt import os import ...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import distributions from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(3, 2), (1,)], 'is_variable': [True, False], })) @testing.fix_random() class TestKLD...
import unittest from test import test_support, test_genericpath import posixpath, os from posixpath import realpath, abspath, dirname, basename # An absolute path to a temporary filename for testing. We can't rely on TESTFN # being an absolute path, so we need this. ABSTFN = abspath(test_support.TESTFN) def safe_rm...
# xml.etree test. This file contains enough tests to make sure that # all included components work as they should. # Large parts are extracted from the upstream test suite. # IMPORTANT: the same doctests are run from "test_xml_etree_c" in # order to ensure consistency between the C implementation and the # Python imp...
import requests, json import urler from lxml import etree from copy import deepcopy from common import GtR, Paging, MIME_MAP NSMAP = {"gtr" : "http://gtr.rcuk.ac.uk/api"} GTR_PREFIX = "gtr" class GtRNative(GtR): def __init__(self, base_url, page_size=25, serialisation="json", username=None, password=None): ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """OpenAIRE configuration file.""" from __future__ import absolute_import, print_fun...
from __future__ import unicode_literals from itertools import product import numpy as np from matplotlib import cm from matplotlib import pyplot as plt from matplotlib.collections import LineCollection import param from ...core import OrderedDict from ...core.util import (match_spec, unique_iterator, safe_unicode, ...
# -*- coding: utf-8 -*- """ This file is part of pyCMBS. (c) 2012- Alexander Loew For COPYING and LICENSE details, please refer to the LICENSE file """ """Attempt to generate templates for module reference with Sphinx XXX - we exclude extension modules To include extension modules, first identify them as valid in t...
"""Models mixins for Social Auth""" import re import time import base64 import uuid import warnings from datetime import datetime, timedelta import six from openid.association import Association as OpenIdAssociation from .exceptions import MissingBackend from .backends.utils import get_backend NO_ASCII_REGEX = re...
# Working with TF commit 24466c2e6d32621cd85f0a78d47df6eed2c5c5a6 import math import numpy as np import tensorflow as tf import tensorflow.contrib.seq2seq as seq2seq from tensorflow.contrib.layers import safe_embedding_lookup_sparse as embedding_lookup_unique from tensorflow.contrib.rnn import LSTMCell, LSTMStateTupl...
# Copyright 2016 ASLP@NPU. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
""" Echidna's parameter module. Contains :class:`Parameter` and all classes that inherit from it. """ import numpy import abc import logging import warnings from echidna.core import scale, shift, smear class Parameter(object): """ The base class for creating parameter classes. Args: type_name (strin...
"""Support for Xiaomi Philips Lights.""" import asyncio import datetime from datetime import timedelta from functools import partial import logging from math import ceil import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_COLOR_TEMP, ATTR_ENTITY_I...
#!/usr/bin/env python # # Copyright (c) 2012 Eran Sandler (eran@sandler.co.il), http://eran.sandler.co.il, http://forecastcloudy.net # Copyright (C) 2012-2013 Dustin Kirkland <kirkland@byobu.co> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated document...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2008 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
import mock from django.test import TestCase from django.contrib.auth.models import User from django.http import HttpRequest from mediaviewer.models.usersettings import UserSettings from mediaviewer.models.request import Request from mediaviewer.views.requests import (addrequests, ...
# Copyright 2012 VMware, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
from __future__ import absolute_import from __future__ import print_function import math import re from decimal import Decimal from .adjacency_graphs import adjacency_graphs from six.moves import range # on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1. # this calculates the average over all ...
#=============================================================================== # Copyright (c) 2018, Max Zwiessele # 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 sour...
import types import weakref from .lock import allocate_lock class BaseTypeByIdentity(object): is_array_type = False is_raw_function = False def get_c_name(self, replace_with='', context='a C file'): result = self.c_name_with_marker assert result.count('&') == 1 # some logic dupli...
"""Support for Modbus switches.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_COMMAND_OFF, CONF_COMMAND_ON, CONF_NAME, CONF_SLAVE, STATE_ON) from homeassistant.helpers import config_validation as cv from homeassistant....
# -*- coding: utf-8 -*- """ flask_security.core ~~~~~~~~~~~~~~~~~~~ Flask-Security core module :copyright: (c) 2012 by Matt Wright. :copyright: (c) 2017 by CERN. :copyright: (c) 2017 by ETH Zurich, Swiss Data Science Center. :license: MIT, see LICENSE for more details. """ from datetime i...
""" Test Elasticsearch persistence. """ from datetime import timedelta from unittest.mock import patch from hamcrest import ( all_of, assert_that, calling, contains, equal_to, has_entry, has_key, has_property, is_, none, raises, ) from microcosm.api import create_object_gra...
# Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
# coding: utf-8 from __future__ import print_function #prepare for python3 import os,sys,shutil import time as clocktime import numpy as np from scipy.stats import powerlaw import matplotlib matplotlib.use('Agg') #matplotlib.use("Cairo") import matplotlib.pyplot as plt from amuse.community.rebound.interface import...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Utility to run Automated Human Readable Description (AHRD) pipeline. <https://github.com/groupschoof/AHRD> """ import os.path as op from os import symlink import sys import re import logging from jcvi.formats.base import must_open from jcvi.apps.base import OptionPa...
# -*- coding: utf-8 -*- # Copyright (C) 2014 Yahoo! Inc. All Rights Reserved. # Copyright (C) 2016 GoDaddy 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 Licen...
import unittest from mock import Mock from datetime import datetime from tests.test_basefile import BaseFileTests class CNTTests(BaseFileTests): def setUp(self): super(CNTTests, self).setUp() self.filesys.open.return_value = MockFile() from niprov.cnt import NeuroscanFile self.con...
import sys import Queue import time import threading import collections import json import requests import websocket # =========================== logging ========================================= import logging logger = logging.getLogger(__name__) # =========================== classes =============================...
# pylint:disable=missing-class-docstring,unused-argument from collections import defaultdict from typing import Optional, Any, Dict, TYPE_CHECKING import ailment from ailment import Expression, Block from ailment.statement import Statement from ..ailblock_walker import AILBlockWalker from ..sequence_walker import Seq...
# pylint: disable=too-many-lines,redefined-outer-name,redefined-builtin from asyncio import Future from typing import ( Any, Callable, Iterable, Mapping, Optional, Tuple, TypeVar, Union, overload, ) from . import abc, typing from ._version import __version__ from .internal.utils im...
'''@file train_asr.py this file will do the asr training''' import os from functools import partial import tensorflow as tf from six.moves import configparser from nabu.distributed import create_server from nabu.processing import batchdispenser, feature_reader, target_coder from nabu.neuralnetworks.classifiers.asr imp...
# -*- coding: utf-8 -*- import pytest from tests.utils import TestCaseBase import sqlparse from sqlparse.exceptions import SQLParseError class TestFormat(TestCaseBase): def test_keywordcase(self): sql = 'select * from bar; -- select foo\n' res = sqlparse.format(sql, keyword_case='upper') ...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 la...
# Copyright (c) 2011 - 2017, Intel 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 required by applicable law or agre...
#!/usr/bin/env python3 """ ingest.py: source client for Voctomix. Copyright: 2015-2020 Carl F. Karsten <carl@nextdayvideo.com>, Ryan Verner <ryan@nextdayvideo.com.au> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documenta...