gt
stringclasses
1 value
context
stringlengths
2.49k
119k
from __future__ import print_function from builtins import map from builtins import object import re import socket import time import _thread import queue from ssl import wrap_socket, CERT_NONE, CERT_REQUIRED, SSLError DEFAULT_NAME = 'skybot' DEFAULT_REALNAME = 'Python bot - http://github.com/rmmh/skybot' DEFAULT_NI...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ from __future__ import unicode_literals import datetime import re import sys import warnings try: import MySQLdb as Database except ImportError as e: from django.core.exceptions import ImproperlyConfigur...
#! /usr/bin/env python3 # -*- 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 requi...
# -*- coding: utf-8 -*- """ formsubplottool.py backend.qt4 (PyQt4|PySide) independent form of the subplot tool. """ from matplotlib.backends.qt_compat import QtCore, QtGui, QtWidgets __author__ = 'rudolf.hoefler@gmail.com' class UiSubplotTool(QtWidgets.QDialog): def __init__(self, *args, **kwargs): su...
# Copyright 2018 The Forseti Security 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 ap...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com from os.path import abspath, join, dirname from preggy import expect...
# Copyright 2019 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 itertools import random from raiden.constants import MAXIMUM_PENDING_TRANSFERS from raiden.transfer import channel, secret_registry from raiden.transfer.architecture import Event, StateChange, TransitionResult from raiden.transfer.events import SendProcessed from raiden.transfer.mediated_transfer.events import ...
from plotters import plot_bax_oligo, plot_dist_rate, plot_compiled_dist_rate, plot_agg_initiation, plot_oligo_rate_histo, plot_cytc, plot_scatter, plot_oligo_double_axis import analysis_tools as tools from scipy.spatial import distance import matplotlib.pyplot as plt import numpy as np import data import math from iter...
import ntpath import difflib from django.db import models, transaction from django.conf import settings from fields import PositiveBigIntegerField from gensim.corpora import Dictionary as GensimDictionary import gensim.similarities import editdistance from pyanalysis.apps.corpus.models import Dataset, Script, Line f...
#!/usr/bin/env python """ Analyze docstrings to detect errors. If no argument is provided, it does a quick check of docstrings and returns a csv with all API functions and results of basic checks. If a function or method is provided in the form "pandas.function", "pandas.module.class.method", etc. a list of all error...
users_interests = [ ["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"], ["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"], ["Python", "scikit-learn", "scipy", "numpy", "statsmodels", "pandas"], ["R", "Python", "statistics", "regression", "probability"], ["machine learning", ...
"""Test Hue bridge.""" import asyncio from unittest.mock import AsyncMock, Mock, patch import pytest from homeassistant import config_entries from homeassistant.components import hue from homeassistant.components.hue import bridge, errors from homeassistant.components.hue.const import ( CONF_ALLOW_HUE_GROUPS, ...
''' Created on Jan 19, 2014 @author: Chris ''' import sys import wx from gooey.gui import image_repository, events from gooey.gui.lang.i18n import _ from gooey.gui.pubsub import pub from gooey.gui.util import wx_util from gooey.gui.windows import footer, header, layouts from gooey.gui.windows.runtime_display_panel i...
""" HB events """ from pox.openflow.libopenflow_01 import * import json from hb_utils import * from hb_json_event import JsonEvent from hb_json_event import AttributeCombiningMetaclass class HbEvent(JsonEvent): __metaclass__ = AttributeCombiningMetaclass _attr_combining_metaclass_args = ["_to_json_attrs"] ...
# -*- coding: utf-8 -*- import httplib as http import contextlib import mock from nose.tools import * # flake8: noqa from tests.base import ApiTestCase, DbTestCase from tests import factories from tests.utils import make_drf_request from api.base.settings.defaults import API_BASE from api.base.serializers import JS...
import hashlib import os import pickle from urllib.request import urlretrieve import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelBinarizer from sklearn.utils import resample from tqdm import tqdm from zipfile import ZipFile print('All m...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
#!/usr/bin/env python3 # testNLHTree3.py """ Test more NLHTree functionality. """ import time import unittest from rnglib import SimpleRNG from nlhtree import NLHTree as NT from xlattice import (HashTypes, check_hashtype, SHA1_HEX_LEN, SHA2_HEX_LEN) class TestNLHTree3(unittest.TestCase): ...
""" ============================ ``ctypes`` Utility Functions ============================ See Also -------- load_library : Load a C library. ndpointer : Array restype/argtype with verification. as_ctypes : Create a ctypes array from an ndarray. as_array : Create an ndarray from a ctypes array. References ---------- ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import logg...
""" Python functions to facilitate interacting with the dataset from Koumura and Okanoya 2016 [1]. The original code was released under the GNU license: https://github.com/cycentum/birdsong-recognition/blob/master/ birdsong-recognition/src/computation/ViterbiSequencer.java Note that the Python implementations are not...
# Copyright 2015 Dell 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 agree...
import pytest import networkx as nx from networkx.testing import almost_equal def validate_grid_path(r, c, s, t, p): assert isinstance(p, list) assert p[0] == s assert p[-1] == t s = ((s - 1) // c, (s - 1) % c) t = ((t - 1) // c, (t - 1) % c) assert len(p) == abs(t[0] - s[0]) + abs(t[1] - s[1...
from openerp.osv import fields, osv import openerp.addons.decimal_precision as dp from lxml import etree as ET class project_indicators_task(osv.osv): _inherit = 'project.task' def add_value(self, cr, uid, fields=None, context=None): action = self.pool.get('ir.actions.act_window').for_xml_id( ...
# Copyright (c) 2013 Rackspace Hosting # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# Copyright 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...
""" This paver file is intented to help with the release process as much as possible. It relies on virtualenv to generate 'bootstrap' environments as independent from the user system as possible (e.g. to make sure the sphinx doc is built against the built numpy, not an installed one). Building a fancy dmg from scratch...
""" HDMI CEC component. For more details about this component, please refer to the documentation at https://home-assistant.io/components/hdmi_cec/ """ import logging import multiprocessing import os from collections import defaultdict from functools import reduce import voluptuous as vol import homeassistant.helpers...
# Copyright 2014 TWO SIGMA OPEN SOURCE, 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 agree...
## A script for finding every cox coefficient and pvalue for every mRNA in KIRC Tier 3 data downloaded Feb. 2015 from rpy2 import robjects as ro import numpy as np import os ro.r('library(survival)') ##This call will only work if you are running python from the command line. ##If you are not running from the command ...
from __future__ import absolute_import import functools import itertools from sentry.models import ( GroupSubscription, GroupSubscriptionReason, UserOption, UserOptionValue ) from sentry.testutils import TestCase class SubscribeTest(TestCase): def test_simple(self): group = self.create_group() ...
''' Kaveree Backup Program : Anjali Version Command Line Input Creator : M.Kumaran Email : atv.kumar@gmail.com ALL RIGHTS RESERVED 2013 ''' import os import platform import filecmp import shutil import hashlib import logging , logging.handlers #import sys import datetime import sqlite3 import zipfile import argpars...
# Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me). # 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...
class Cosmology(object): """ A class that nicely deals with cosmological parameters. Most cosmological parameters are merely input and are made available as attributes in the class. However, more complicated relations such as the interrelation of omegab, omegac, omegam, omegav for example are ...
# -*- coding: utf-8 -*- import marshmallow as ma from marshmallow.exceptions import ValidationError from marshmallow.compat import iteritems, PY2 from .fields import BaseRelationship, Meta, _META_LOAD_FROM from .exceptions import IncorrectTypeError from .utils import resolve_params TYPE = 'type' ID = 'id' def plain...
from __future__ import print_function import json import os import socket import time class Chillog: """ Python library for building logging data structure based on GELF More info check http://docs.graylog.org/en/2.1/pages/gelf.html """ LOG_MESSAGE_VERSION = 1 LOG_ALERT = 1 LOG_CRITICAL =...
import unittest from conans.test.utils.tools import TestClient, TestBufferConanOutput import os import zipfile from conans.test.utils.test_files import temp_folder from conans.util.files import load, save_files, save from conans.client.remote_registry import RemoteRegistry, Remote from mock import patch from conans.cl...
# # 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 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: Josh Joseph joshmd@bu.edu # 4/29/16 # This is the main server file for PCR hero.... from bottle import route, run, template, get, post, request, response, redirect, static_file import m3 import os pcrDB = m3.get_db("...
#!/usr/bin/env python # # Tree balls in a spinning bowl, with gravity and a ground # OpenCascade contactors # # specification of center of mass & moments of inertia # from siconos.mechanics.collision.tools import Contactor from siconos.io.mechanics_io import Hdf5 from siconos import numerics # for osi specificatio...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
# Copyright (c) 2014 Baidu.com, 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 ...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# -- coding: utf-8 -- from __future__ import absolute_import from unittest import main, TestCase from tempfile import mkdtemp from os.path import join, dirname, abspath from shutil import rmtree, copytree from re import sub import random import sys from chime.repo_functions import ChimeRepo from slugify import slugif...
# -*- 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...
# 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 agree...
''' Hypergraph representation. @author: Daniel Bauer (dbauer) @author: Nathan Schneider (nschneid) @since: 2012-06-18 ''' from collections import defaultdict import unittest import re import sys import copy from operator import itemgetter from common.cfg import NonterminalLabel from common.exceptions import Derivati...
import datetime import logging import os import re import socket import subprocess import threading import weakref import six import pkg_resources import requests from chef.auth import sign_request from chef.exceptions import ChefServerError from chef.rsa import Key from chef.utils import json from chef.utils.file i...
import os import pytest import requests import subprocess import signal from os.path import ( abspath, basename, dirname, exists, join, relpath, split, splitext, ) from tests.plugins.upload_to_s3 import S3_URL from tests.plugins.utils import ( info, ok, red, warn, w...
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
# +--------------------------------------------------------------------------+ # | Licensed Materials - Property of IBM | # | | # | (C) Copyright IBM Corporation 2008. | # +-...
#! /usr/bin/env python # # See README for usage instructions. from distutils import util import fnmatch import glob import os import pkg_resources import re import subprocess import sys import sysconfig import platform # We must use setuptools, not distutils, because we need to use the # namespace_packages option for ...
# -*- coding: utf-8 -*- """ Created on Thu Jun 17 2017 at 12:07UTC @author: Mathias Aschwanden (mathias.aschwanden@gmail.com) """ import copy import time as time_module import numpy as np import dill as pickle import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as mtick from attrdict import ...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
#!/usr/bin/env python # Copyright 2008 Google Inc. All Rights Reserved. """Tests for ActiveResource objects.""" __author__ = 'Mark Roach (mrroach@google.com)' import unittest import pickle import urllib from pyactiveresource import activeresource from pyactiveresource import connection from pyactiveresource import u...
""" Models for representing top-level plot objects. """ from __future__ import absolute_import from six import string_types import warnings from ..core.query import find from ..core import validation from ..core.validation.warnings import (MISSING_RENDERERS, NO_DATA_RENDERERS, EMPTY_LAYOUT, MALFORMED_CATEGORY_LA...
#!/usr/bin/env python ''' Python DB API 2.0 driver compliance unit test suite. This software is Public Domain and may be used without restrictions. "Now we have booze and barflies entering the discussion, plus rumours of DBAs on drugs... and I won't tell you what flashes through my mind each time I read the ...
import unittest from playhouse.test_utils import test_database from peewee import * from datetime import datetime, timedelta from mqttsqlite.orm.models import Log, Topic from tests.utils import msg from mqttsqlite.core.logs_controller import LogController import mqttsqlite.settings.private_settings as Settings import ...
import base64 import binascii import functools import hashlib import importlib import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from django.utils.crypto import ( constant_tim...
# Copyright 2019 The Magenta 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 ...
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers // Copyright (c) 2014 Dyffy, Inc. # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re i...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TopShops' db.create_table(u'catalog_topshops', ( (u'id', self.gf('django.db.mode...
""" Restore Vertica from Swift backups - see README.md Copyright 2014 Hewlett-Packard Development Company, L.P. 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...
""" Table of Contents Extension for Python-Markdown * * * (c) 2008 [Jack Miller](http://codezen.org) Dependencies: * [Markdown 2.1+](http://packages.python.org/Markdown/) Pull request to include the below code in Python-Markdown: https://github.com/waylan/Python-Markdown/pull/191 Until it's released, we have a copy...
""" Finite Discrete Random Variables - Prebuilt variable types Contains ======== FiniteRV DiscreteUniform Die Bernoulli Coin Binomial Hypergeometric """ from sympy.stats.frv import SingleFinitePSpace from sympy import S, sympify, Rational, binomial __all__ = ['FiniteRV', 'DiscreteUniform', 'Die', 'Bernoulli', 'Coin'...
from copy import copy from django.conf import settings from django.contrib.contenttypes.generic import GenericRelation from django.core.exceptions import ImproperlyConfigured from django.db.models import get_model, IntegerField, CharField, FloatField from django.db.models.signals import post_save, post_delete class...
# -*- coding: utf-8 -*- from cms.apphook_pool import apphook_pool from cms.exceptions import NoHomeFound from cms.utils.moderator import get_page_queryset from django.conf import settings from django.conf.urls.defaults import patterns from django.contrib.sites.models import Site from django.core.exceptions import Impr...
"""Spectral Embedding.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Wei LI <kuantkid@gmail.com> # License: BSD 3 clause import warnings import numpy as np from scipy import sparse from scipy.linalg import eigh from scipy.sparse.linalg import eigsh from scipy.sparse.csgraph import connected_...
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license import collections import dns.exception import dns.name import dns.rdataclass import dns.rdataset import dns.rdatatype import dns.rrset import dns.serial import dns.ttl class TransactionManager: def reader(self): """Begin a read...
# 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...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Agenda.category_id' db.add_column(u'agendas_agenda', 'cat...
class FieldDStarNode: ''' This class is intended to assist for the DStar search mode. This takes longer but is much more flexible, as it allows for more than the 8 cardinal directions. ''' def __init__(self, coordinates, cost=float('inf'), rhs=float('inf')): self.coordinates = coordinat...
# # -*- coding: utf-8 -*- """Development related tasks to be run with 'invoke'""" import os import pathlib import shutil import invoke TASK_ROOT = pathlib.Path(__file__).resolve().parent TASK_ROOT_STR = str(TASK_ROOT) # shared function def rmrf(items, verbose=True): """Silently remove a list of directories or ...
from __future__ import print_function, division, absolute_import import numpy as np import operator from collections import namedtuple from numba import types, utils from numba.typing.templates import (AttributeTemplate, AbstractTemplate, infer, infer_global, infer_getattr, signatu...
import logging import os import ibmsecurity from ibmsecurity.utilities import tools logger = logging.getLogger(__name__) uri = "/wga/apiac/resource/instance" requires_modules = ["wga"] requires_version = "9.0.7" def get_all(isamAppliance, instance_name, check_mode=False, force=False): """ Retrieving the li...
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net> # 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 # # ...
""" Module for exporting and importing flopy model attributes """ import numpy as np from ..utils import Util2d, Util3d, Transient2d, MfList def write_gridlines_shapefile(filename, sr): """ Write a polyline shapefile of the grid lines - a lightweight alternative to polygons. Parameters ----------...
# Disable while we have Python 2.x compatability # pylint: disable=useless-object-inheritance, too-many-arguments """Data structures for music service items The basis for this implementation is this page in the Sonos API documentation: http://musicpartners.sonos.com/node/83 A note about naming. The Sonos API uses ca...
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # 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 # # ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
""" Robust location and covariance estimators. Here are implemented estimators that are resistant to outliers. """ # Author: Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause import warnings import numbers import numpy as np from scipy import linalg from scipy.stats import chi2 from . import empir...
from __future__ import unicode_literals import warnings from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db.models import Prefetch, QuerySet from django.db.models.query import get_prefetcher from django.test i...
import time import numpy as np from numpy import sin, cos, pi, exp, sqrt, abs from scipy.optimize import rosen class SimpleQuadratic: def fun(self, x): return np.dot(x, x) def der(self, x): return 2. * x def hess(self, x): return 2. * np.eye(x.size) class AsymmetricQuadratic:...
# Copyright 2011 Denali Systems, 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 requ...
# Copyright 2016, IBM US, 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 writing...
import logging import re import random import hashlib from datetime import datetime, timedelta, tzinfo from time import time, gmtime, strftime import os.path from os.path import dirname from urlparse import urljoin from django.conf import settings from django.db import models from django.db.models import signals, ...
import re from binascii import unhexlify from collections import namedtuple from itertools import starmap from streamlink.compat import urljoin, urlparse __all__ = ["load", "M3U8Parser"] # EXT-X-BYTERANGE ByteRange = namedtuple("ByteRange", "range offset") # EXT-X-KEY Key = namedtuple("Key", "method uri iv key_fo...
#!/usr/bin/env trial import copy import difflib import gflags import logging import mock import os import sys from ct.client import log_client from ct.client.db import sqlite_connection as sqlitecon from ct.client.db import sqlite_log_db from ct.client import state from ct.client import monitor from ct.crypto import e...
# ---------------------------------------------------------------------------- # Copyright (c) 2016-2017, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function; """ Converts a set of Objective-C headers commented using TomDoc to headers documented using Doxygen or Appledoc """ __author__ = 'Whirliwig' __license__ = 'MIT' __version__ = '0.5' __email__ = 'ant@dervishsoftware.com' DEBUG = False ve...
#!/usr/bin/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 # "Lice...
import os.path from UserDict import DictMixin try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.db.models.fields.files import ImageField, ImageFieldFile from django.core.files.base import ContentFile from django.utils.safestring import mark_safe from django.utils...
import glob import numpy as np from string import digits from scipy.interpolate import pchip, Akima1DInterpolator from openmdao.main.api import Component, Assembly from openmdao.lib.datatypes.api import VarTree, Float, Array, Bool, Str, List, Int from fusedwind.turbine.geometry_vt import BladeSurfaceVT, BladePlanfor...