gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import division, absolute_import, print_function import platform import pytest import numpy as np from numpy import uint16, float16, float32, float64 from numpy.testing import assert_, assert_equal def assert_raises_fpe(strmatch, callable, *args, **kwargs): try: callable(*args, **kwargs)...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------...
import argparse import logging import os from shutil import copytree, rmtree from subprocess import Popen, PIPE try: from venv import create as create_venv VENV_CREATE_KWARGS = {'symlinks': True} except ImportError: from virtualenv import create_environment as create_venv VENV_CREATE_KWARGS = {'symlink...
import GAN_10 import tensorflow as tf import numpy as np import os import cv2 from ops import * from utils import * import time from tensorflow.examples.tutorials.mnist import input_data # from MNIST_Classification import Classification_Model from MNIST_Classification_with_embedding import Classification_Model from ten...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016 MIT Probabilistic Computing Project # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unles...
""" Tests for Factor terms. """ from functools import partial from itertools import product from nose_parameterized import parameterized from unittest import TestCase from toolz import compose from numpy import ( apply_along_axis, arange, array, datetime64, empty, eye, log1p, nan, o...
# Copyright 2016 gRPC 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 writing...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013, Big Switch Networks, 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...
# 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...
# Copyright (c) 2016 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 applic...
""" Support for a generic MQTT vacuum. For more details about this platform, please refer to the documentation https://home-assistant.io/components/vacuum.mqtt/ """ import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant.components.vacuum import ( DOMAIN, SUPPORT_BATT...
#!/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...
from dimagi.utils.couch.database import safe_delete from dimagi.utils.parsing import json_format_datetime from corehq.util.test_utils import unit_testing_only def get_latest_case_export_schema(domain, case_type): from .models import CaseExportDataSchema key = [domain, 'CaseExportDataSchema', case_type] ...
#!/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 ...
#!/usr/bin/env python # This script aims to help developers locate forms and view code that needs to # use the new CSRF protection in Django 1.2. It tries to find all the code that # may need the steps described in the CSRF documentation. It does not modify # any code directly, it merely attempts to locate it. Deve...
#!/usr/bin/python from console.plugins import * class WLC_Plugin(ConsolePlugin): def plugin_description(self): return 'WLC testing related functionality' def plugin_load(self): try: # ensure capwap_internal is imported from scapy.contrib.capwap import CAPWAP_PKTS except: ...
# Copyright 2014 Mirantis, 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 ...
# # Copyright 2015 Quantopian, 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 wr...
import ptypes from ptypes import * from . import Ntddk, rtltypes from .datatypes import * class DISPATCHER_HEADER(pstruct.type): _fields_ = [ (LONG, 'Lock'), (LONG, 'SignalState'), (LIST_ENTRY, 'WaitListHead'), ] class KEVENT(pstruct.type): _fields_ = [ (DISPATCHER_HEADER,...
from .. import Availability, Class, Constant, Define, Method, Parameter, Type gx_class = Class('USERMETA', doc=""" The :class:`USERMETA` class handles user style metadata tied to real data. """) gx_defines = [ Define('USERMETA_FORMAT', ...
from django.shortcuts import render_to_response from django import forms from django import VERSION as DJANGO_VERSION from django.template import RequestContext from django.db.models import signals as signalmodule from django.http import HttpResponse import exceptions # Try to be compatible with Django 1.5+. try: i...
# Copyright (C) 2013 Nippon Telegraph and Telephone 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 appli...
# # Copyright 2014 Quantopian, 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 wr...
from benchmark.fortune_html_parser import FortuneHTMLParser from setup.linux import setup_util from benchmark.test_types import * import importlib import os import subprocess import time import re from pprint import pprint import sys import traceback import json import logging import csv import shlex import math from ...
from pylearn2.models.s3c import S3C from pylearn2.models.s3c import E_Step_Scan from pylearn2.models.s3c import Grad_M_Step from pylearn2.models.s3c import E_Step from theano import function import numpy as np import theano.tensor as T from theano import config #from pylearn2.utils import serial import warnings def b...
# 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 ...
"""Base class for sparse matrix formats using compressed storage.""" __all__ = [] from warnings import warn import operator import numpy as np from scipy._lib._util import _prune_array from .base import spmatrix, isspmatrix, SparseEfficiencyWarning from .data import _data_matrix, _minmax_mixin from .dia import dia_m...
import pytest import pgdb @pytest.fixture def pgdbConn(dbhost, db, frontenduser): return pgdb.connect(dbhost + ':' + db + ':' + frontenduser) def generic_rider_insert(conn, args): cursor=conn.cursor() cursor.execute(""" SELECT * from carpoolvote.submit_new_rider ( %(IPAddress)s,...
""" Support for Pioneer Network Receivers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.pioneer/ """ import logging import telnetlib import voluptuous as vol from homeassistant.components.media_player import ( SUPPORT_PAUSE, SUPPORT_...
""" Support to interact with a Music Player Daemon. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.mpd/ """ import logging import socket from homeassistant.components.media_player import ( MEDIA_TYPE_MUSIC, SUPPORT_NEXT_TRACK, SUPPORT_P...
# Copyright 2018 Google LLC. 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 agreed to...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ import json from collections import namedtuple, Counter import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as pltc import matplotlib.patches as pltp plt.rc('text', usetex=True) plt.rc('font', family='serif') from kbpo.defs import CANON...
# Copyright 2012 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 requ...
# -*- coding: utf-8 -*- from functools import update_wrapper import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.translation import ugettext_lazy as _ from django.utils.six.moves.urllib.parse import urljoin from cms import constants __all__ = ['get_cm...
# ----------------- # own structure # ----------------- # do separate scopes def scope_basic(): from import_tree import mod1 #? int() mod1.a #? [] import_tree.a #? [] import_tree.mod1 import import_tree #? str() import_tree.a def scope_pkg(): import import_tree.mod1 ...
# encoding: utf-8 """ Class for reading/writing analog signals in a text file. Each columns represents a AnalogSignal. All AnalogSignal have the same sampling rate. Covers many case when part of a file can be viewed as a CSV format. Supported : Read/Write Author: sgarcia """ from .baseio import BaseIO from ..core i...
# -*- coding: utf-8 -*- """ Adapted from Yelp Fusion API code sample. Please refer to http://www.yelp.com/developers/v3/documentation for the API documentation. """ from __future__ import print_function from __future__ import absolute_import import argparse import json import pprint import requests import sys import...
#! -*- coding:utf-8 -*- """ tests.test_utils ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :author: tell-k <ffk2005@gmail.com> :copyright: tell-k. All Rights Reserved. """ from __future__ import division, print_function, absolute_import, unicode_literals # NOQA from django.test import TestCase impor...
# -*- coding: utf-8 -*- import logging import unittest import sys if sys.version_info[0] >= 3: from tempfile import * else: from tempfile import * from backports import tempfile TemporaryDirectory = tempfile.TemporaryDirectory from gos.algo.executable_containers.base_round import Round from gos.algo.ex...
import flask_sqlalchemy from sqlalchemy.dialects import postgresql as pg # pylint: disable=no-member db = flask_sqlalchemy.SQLAlchemy() RarityEnum = pg.ENUM('Common', 'Rare', 'Not For Sale', name='rarity', metadata=db.metadata) BodyAreasEnum = pg.ENUM('Head', 'Neck', 'Upper Chest', 'Abdomen', 'Groin', 'Upper Back',...
# -*- coding: utf-8 -*- import mock import unittest from nose.tools import * # noqa from github3 import GitHubError from github3.repos import Repository from tests.base import OsfTestCase, get_default_metaschema from tests.factories import UserFactory, ProjectFactory from framework.auth import Auth from website.a...
from django.test import TestCase from django.contrib.auth.models import Group from hs_access_control.models import PrivilegeCodes from hs_core import hydroshare from hs_core.models import GenericResource from hs_core.testing import MockIRODSTestCaseMixin from hs_access_control.tests.utilities import global_reset, is...
#!/usr/bin/env python2 # -*- coding: utf-8-*- import os import wave import json import tempfile import logging import urllib import urlparse import re import subprocess from abc import ABCMeta, abstractmethod import requests import yaml import jasperpath import diagnose import vocabcompiler class AbstractSTTEngine(ob...
#!/usr/bin/env python3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import idlnode import idlparser import logging.config import sys import unittest ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path from datetime import date, datetime import time from sqlite3 import dbapi2 as sqlite import simplejson as json import xbmcgui import common import connection import database_common as db_common from bs4 import BeautifulSoup def create(): c = _database...
#!/usr/bin/env python """Performance test to compare the performance of buck between two revisions. The general algorithm is: Checkout <revisions_to_go_back - 1> Warm up the cache: Set .buckversion to old revision, build all targets Set .buckversion to new revision, build all targets For each revision to test: ...
# coding: utf-8 import os import sys import requests import multiprocessing import click import time import difflib from os import path, makedirs from subprocess import PIPE, Popen from itertools import chain from multiprocessing import Pool from concurrent.futures import ThreadPoolExecutor from concurrent.futures im...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright (C) 2013,2014 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013,2014 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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 # ...
import scipy as SP import numpy as NP import scipy.linalg as LA import scipy.optimize as OPT import scipy.stats as st import pdb # log of 2pi L2pi = 1.8378770664093453 def nLLeval(ldelta,UY,UX,S,MLparams=False): """evaluate the negative LL of a LMM with kernel USU.T""" delta=SP.exp(ldelta); n,d=UX.shape; ...
import math import time from hashlib import md5 from itertools import cycle import random import numpy as np from spring.states import STATES, NUM_STATES from fastdocgen import build_achievements class Iterator(object): def __init__(self): self.prefix = None def __iter__(self): return sel...
import copy import itertools from typing import ( Any, Callable, Dict, Iterable, Iterator, List, MutableSequence, Optional, Tuple, Type, Union, ) from ._utils import ( ValueKind, _is_missing_literal, _is_none, _resolve_optional, format_and_raise, get_...
#!/usr/bin/env python3 # Copyright (c) 2015-2021 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 processing of unrequested blocks. Setup: two nodes, node0 + node1, not connected to each other. N...
import unittest import functools import math import numpy from operator import mul import six import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition from chaine...
#!/usr/bin/python """ Communication module for interfacing with Polly, a deterministic Bitcoin hardware wallet adhering to BIP32. Requires the HID API for USB communications. The MIT License (MIT) Copyright (c) 2014 by Nathaniel Burke Permission is hereby granted, free of charge, to any person obtaining a copy o...
# Copyright (c) 2015 Mirantis, 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...
# pyOCD debugger # Copyright (c) 2006-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
# # Cassandra Cluster Management lib # import os, common, shutil, re, cluster, socket, stat USER_HOME = os.path.expanduser('~') CASSANDRA_BIN_DIR= "bin" CASSANDRA_CONF_DIR= "conf" CASSANDRA_CONF = "cassandra.yaml" LOG4J_CONF = "log4j-server.properties" LOG4J_TOOL_CONF = "log4j-tools.properties" LOGBACK_CONF = "logb...
#!/usr/bin/env python # # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opensource.org/licenses/MIT. # # @author Da...
# -*- coding: utf-8 -*- # # scikit-learn documentation build configuration file, created by # sphinx-quickstart on Fri Jan 8 09:13:42 2010. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
from decimal import Decimal from datetime import date from go.vumitools.tests.helpers import djangotest_imports with djangotest_imports(globals()): from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper from go.billing.models import ( Account, TagPool, MessageCost, Transaction, Transa...
""" terminal reporting of the full testing process. This is a good source for looking at the various reporting hooks. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import itertools import platform import sys import time import attr im...
# -*- coding: utf-8 -*- import cgi, web from datetime import datetime from django.utils import simplejson from geohash import Geohash from google.appengine.api import urlfetch from models import Place from urllib import quote, urlencode from web.contrib.template import render_mako from web import form, seeother __al...
# 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 ...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/env python # Copyright (c) 2012 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 list ...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
""" Configuration schemas can be used to group configuration values together. These schemas can be instantiated at import time, and values can be retrieved from them by accessing the attributes of the schema object. Each field on the schema turns into an accessor for a configuration value. These accessors will cache t...
# Copyright 2018 MLBenchmark Group. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
# -*- coding: utf-8 -*- """ flask_jwt ~~~~~~~~~ Flask-JWT module """ from collections import OrderedDict from datetime import datetime, timedelta from functools import wraps import jwt from flask import current_app, request, jsonify, _request_ctx_stack from flask.views import MethodView from werkzeug.lo...
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
""" define solvers that record cumulative times needed for every loop """ from dolfin import * from nanopores.tools.pdesystem import newtonsolve from nanopores import * def QmolEff(U, geo): phi, phidual = U phys = geo.physics dim = phys.dim coeff = Constant(1.) if dim==3 else Expression("2*pi*x[0]") ...
try: from lxml.etree import ElementTree from lxml.etree.ElementTree import Element except ImportError: from xml.etree import ElementTree from xml.etree.ElementTree import Element from client import V1Server, V1Error from base_asset import BaseAsset from cache_decorator import memoized from special_clas...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
''' Created on 2016/2/19 :author: hubo ''' from vlcp.config import defaultconfig from vlcp.server.module import Module, api, depend, call_api, ModuleNotification from vlcp.event.runnable import RoutineContainer from vlcp.service.connection import openflowserver from vlcp.protocol.openflow import OpenflowConnectionSta...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Particularities of XDS - keywords # - Only the last keyword declatation count # -- except if the keyword accept multiple declatation # [case of: SPOT_RANGE= # EXCLUDE_RESOLUTION_RANGE= # PROFILE_RANGE=] # - ...
import logging import httplib2 import json import os import hashlib # This module performs authentication based on the tokens # issued by Globus Online's Nexus service, see this URL for # details: # http://globusonline.github.com/nexus-docs/api.html # # Import the Globus Online client libraries, originally # sourced f...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ A Django web app and unit tests in a single file. Based on Nsukami's blog post (no longer on line). To get it running, copy it into a directory named udjango: $ pip install django $ python udjango_test.py Change the DJANGO_COMMAND to runserver to switch back to web s...
#!/usr/bin/env python # # BaseRecognizer.py # # Class recognizing modified base residues. # # http://iimcb.genesilico.pl/moderna/ # __author__ = "Magdalena Rother, Tomasz Puton, Kristian Rother" __copyright__ = "Copyright 2008, The Moderna Project" __credits__ = ["Janusz Bujnicki"] __license__ = "GPL" __maintainer__ = ...
""" Import utilities Exported classes: ImportManager Manage the import process Importer Base class for replacing standard import functions BuiltinImporter Emulate the import mechanism for builtin and frozen modules DynLoadSuffixImporter """ from warnings import warnpy3k warnpy3k("the imputil...
""" Various sweeps for scanning experiment parameters """ from atom.api import Atom, Str, Float, Int, Bool, Dict, List, Enum, \ Coerced, Property, Typed, observe, cached_property, Int import enaml from enaml.qt.qt_application import QtApplication from instruments.MicrowaveSources import MicrowaveSource from instr...
# Copyright 2013 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 l...
# -*- coding: UTF-8 -*- from django.core.management.base import BaseCommand from optparse import make_option import unicodedata import shout import daemon import daemon.pidfile from signal import SIGTSTP, SIGABRT import sys import os from jukebox.jukebox_core import api class Command(BaseCommand): skipCurrentSong...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/python from dolfin import * import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc Print = PETSc.Sys.Print # from MatrixOperations import * import numpy as np import matplotlib.pylab as plt import scipy.sparse as sps import scipy.sparse.linalg as slinalg import os import scipy.io #...
from __future__ import division import numba as nb import numpy as np from .utils import get_func, isstr, aggregate_common_doc, funcs_no_separate_nan from .utils_numpy import aliasing, input_validation, check_dtype, check_fill_value class AggregateOp(object): """ Every subclass of AggregateOp handles a diffe...
import os import random import logging from collections import OrderedDict from databasic import mongo, get_base_dir from databasic.forms import WordCounterPaste, WordCounterUpload, WordCounterSample, WordCounterLink from databasic.logic import wordhandler, filehandler from flask import Blueprint, render_template, requ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
#!/usr/bin/env python from JumpScale import j import sys import time try: import ujson as json except: import json import psutil import JumpScale.baselib.taskletengine from JumpScale.baselib import cmdutils # Preload libraries j.system.platform.psutil=psutil # import JumpScale.baselib.graphite import JumpScale...
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. """This module provides fixtures that are shared among all repository flavours (Open/EE)""" import json import os import pyroute2 import pytest from jwt.utils import base64url_decode, base64url_encode import generic_test_code.common from mocker.dns i...
#!/usr/bin/env python # # Copyright 2009, 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 list...
#! /usr/bin/env python from __future__ import print_function from argparse import ArgumentParser import logging import os import re import sys import yaml LOGGER = logging.getLogger('upgrade_dbt_schema') LOGFILE = 'upgrade_dbt_schema_tests_v1_to_v2.txt' COLUMN_NAME_PAT = re.compile(r'\A[a-zA-Z0-9_]+\Z') # compatibil...
#!/usr/bin/python # write out the data in a form useful to pass to the sba (demo) program # it appears camera poses are basically given as [ R | t ] where R is # the same R we use throughout and t is the 'tvec' # todo, run sba and automatically parse output ... import sys sys.path.insert(0, "/usr/local/lib/python2....
# Copyright 2011 Piston Cloud Computing, 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 # # Unle...
""" Classification and decoding related tools """ import numpy as np from functools import reduce from sklearn.feature_selection import SelectKBest import re from six import string_types def feature_selection(feat_select, X, y): """" Implements various kinds of feature selection """ # K-best if re.match(...
from __future__ import absolute_import import django import six from six import string_types from sentry.utils.compat import implements_to_string def cmp(a, b): return (a > b) - (a < b) class Bit(object): """ Represents a single Bit. """ def __init__(self, number, is_set=True): self.n...
""" Encode Parrot Bebop commands (possible usage also as parsing command log files) usage: ./commands.py <cmd log file> """ import time import struct from threading import Thread,Event,Lock from collections import defaultdict def takeoffCmd(): # ARCOMMANDS_ID_PROJECT_ARDRONE3 = 1, # ARCOMMANDS_ID_A...
# Copyright 2014-2016 OpenMarket 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 agreed to in w...