Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
proc
/
self
/
root
/
opt
/
alt
/
python35
/
lib64
/
python3.5
/
site-packages
/
sklearn
/
utils
/
File Content:
deprecation.py
import warnings __all__ = ["deprecated", ] class deprecated(object): """Decorator to mark a function or class as deprecated. Issue a warning when the function is called/the class is instantiated and adds a warning to the docstring. The optional extra argument will be appended to the deprecation message and the docstring. Note: to use this with the default value for extra, put in an empty of parentheses: >>> from sklearn.utils import deprecated >>> deprecated() # doctest: +ELLIPSIS <sklearn.utils.deprecation.deprecated object at ...> >>> @deprecated() ... def some_function(): pass """ # Adapted from http://wiki.python.org/moin/PythonDecoratorLibrary, # but with many changes. def __init__(self, extra=''): """ Parameters ---------- extra: string to be added to the deprecation messages """ self.extra = extra def __call__(self, obj): if isinstance(obj, type): return self._decorate_class(obj) else: return self._decorate_fun(obj) def _decorate_class(self, cls): msg = "Class %s is deprecated" % cls.__name__ if self.extra: msg += "; %s" % self.extra # FIXME: we should probably reset __new__ for full generality init = cls.__init__ def wrapped(*args, **kwargs): warnings.warn(msg, category=DeprecationWarning) return init(*args, **kwargs) cls.__init__ = wrapped wrapped.__name__ = '__init__' wrapped.__doc__ = self._update_doc(init.__doc__) wrapped.deprecated_original = init return cls def _decorate_fun(self, fun): """Decorate function fun""" msg = "Function %s is deprecated" % fun.__name__ if self.extra: msg += "; %s" % self.extra def wrapped(*args, **kwargs): warnings.warn(msg, category=DeprecationWarning) return fun(*args, **kwargs) wrapped.__name__ = fun.__name__ wrapped.__dict__ = fun.__dict__ wrapped.__doc__ = self._update_doc(fun.__doc__) return wrapped def _update_doc(self, olddoc): newdoc = "DEPRECATED" if self.extra: newdoc = "%s: %s" % (newdoc, self.extra) if olddoc: newdoc = "%s\n\n%s" % (newdoc, olddoc) return newdoc
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
__pycache__
---
0755
sparsetools
---
0755
tests
---
0755
__init__.py
13522 bytes
0644
_logistic_sigmoid.cpython-35m-x86_64-linux-gnu.so
33688 bytes
0755
_random.cpython-35m-x86_64-linux-gnu.so
81096 bytes
0755
_scipy_sparse_lsqr_backport.py
18021 bytes
0644
arpack.py
73115 bytes
0644
arrayfuncs.cpython-35m-x86_64-linux-gnu.so
38104 bytes
0755
bench.py
370 bytes
0644
class_weight.py
7411 bytes
0644
deprecation.py
2417 bytes
0644
estimator_checks.py
60116 bytes
0644
extmath.py
27057 bytes
0644
fast_dict.cpython-35m-x86_64-linux-gnu.so
176248 bytes
0755
fixes.py
13923 bytes
0644
graph.py
6239 bytes
0644
graph_shortest_path.cpython-35m-x86_64-linux-gnu.so
86208 bytes
0755
lgamma.cpython-35m-x86_64-linux-gnu.so
20080 bytes
0755
linear_assignment_.py
9524 bytes
0644
metaestimators.py
4309 bytes
0644
mocking.py
2190 bytes
0644
multiclass.py
14732 bytes
0644
murmurhash.cpython-35m-x86_64-linux-gnu.so
77272 bytes
0755
optimize.py
5739 bytes
0644
random.py
10523 bytes
0644
seq_dataset.cpython-35m-x86_64-linux-gnu.so
77384 bytes
0755
setup.py
2993 bytes
0644
sparsefuncs.py
13505 bytes
0644
sparsefuncs_fast.cpython-35m-x86_64-linux-gnu.so
404296 bytes
0755
stats.py
1692 bytes
0644
testing.py
28245 bytes
0644
validation.py
26027 bytes
0644
weight_vector.cpython-35m-x86_64-linux-gnu.so
38080 bytes
0755
N4ST4R_ID | Naxtarrr