Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@removals.remove(version='1.7.0', removal_version='2.0.0')
def post(self, url, **kwargs):
"""Perform an authenticate POST request.
This calls :py:meth:`.request()` with ``method`` set to ``POST`` and an
authentication token if one is available.
.. warning::
*DEPRECATED*: This function is no longer used and is deprecated as
of the 1.7.0 release and may be removed in the 2.0.0 release. It
was designed to be used by the managers and the managers now
receive an adapter so this function is no longer on the standard
request path.
"""
return self._cs_request(url, 'POST', **kwargs)
@removals.remove(
message='Configuration of notifier is available through oslo.cfg',
version='1.9.0',
removal_version='3.0.0'
)
def config(self, config_dict):
pass
@removals.remove(message="Please see dit.pid.PID_BROJA.", version='1.0.1')
def pi_decomp(d, d_opt):
u0 = dit.multivariate.coinformation(d_opt, [[2], [0]], [1])
u1 = dit.multivariate.coinformation(d_opt, [[2], [1]], [0])
mi0 = dit.shannon.mutual_information(d_opt, [0], [2])
rdn = mi0 - u0
mi = dit.shannon.mutual_information(d, [0, 1], [2])
syn = mi - mi0 - u1
return syn, u0, u1, rdn
@removals.remove(
message='keystoneclient auth plugins are deprecated. Use keystoneauth.',
version='2.1.0',
removal_version='3.0.0'
)
def get_plugin_options(name):
"""Get the oslo_config options for a specific plugin.
This will be the list of config options that is registered and loaded by
the specified plugin.
:returns: A list of oslo_config options.
"""
return base.get_plugin_class(name).get_options()
@removals.remove(
message='use get_rpc_transport or get_notification_transport'
)
def get_transport(conf, url=None, allowed_remote_exmods=None):
"""A factory method for Transport objects.
This method will construct a Transport object from transport configuration
gleaned from the user's configuration and, optionally, a transport URL.
If a transport URL is supplied as a parameter, any transport configuration
contained in it takes precedence. If no transport URL is supplied, but
there is a transport URL supplied in the user's configuration then that
URL will take the place of the URL parameter. In both cases, any
configuration not supplied in the transport URL may be taken from
individual configuration parameters in the user's configuration.
An example transport URL might be::
@removals.remove(message="Please use np.core.arrayprint.printoptions",
version='1.2.3')
@contextlib.contextmanager
def printoptions(strip_zeros=True, **kwargs):
if strip_zeros:
kwargs['trim'] = 'k'
origcall = arrayprint.FloatingFormat.__call__
def __call__(self, x):
return origcall.__call__(self, x)
arrayprint.FloatingFormat.__call__ = __call__
original = np.get_printoptions()
np.set_printoptions(**kwargs)
yield
np.set_printoptions(**original)
arrayprint.FloatingFormat.__call__ = origcall
@removals.remove(
message="The healthcheck middleware must now be configured as "
"an application, not as a filter")
@classmethod
def factory(cls, global_conf, **local_conf):
return super(Healthcheck, cls).factory(global_conf, **local_conf)
@removals.remove(message="Please see methods in dit.algorithms.distribution_optimizers.py.",
version='1.0.1')
def isolate_zeros(dist, k):
"""
Determines if there are any elements of the optimization vector that must
be zero.
If :math:`p(marginal) = 0`, then every component of the joint that
contributes to that marginal probability must be exactly zero for all
feasible solutions.
"""
assert dist.is_dense()
assert dist.get_base() == 'linear'
d = get_abstract_dist(dist)
n_variables = d.n_variables
n_elements = d.n_elements
@removals.remove(
message='Configuration of notifier is available through oslo.cfg',
version='1.9.0',
removal_version='3.0.0'
)
def config(self, config=None):
self._smtp_connect()
@removals.remove(message="Please see methods in dit.algorithms.distribution_optimizers.py.",
version='1.0.1')
def initial_point_generic(dist, rvs, A=None, b=None, isolated=None, **kwargs):
"""
Find an initial point in the interior of the feasible set.
"""
from cvxopt import matrix
from cvxopt.modeling import variable
if isolated is None:
variables = isolate_zeros_generic(dist, rvs)
else:
variables = isolated
if A is None or b is None:
A, b = marginal_constraints_generic(dist, rvs)