/usr/lib/python2.7/dist-packages/pymc/decorators.py is in python-pymc 2.2+ds-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #-------------------------------------------------------------
# Decorators
#-------------------------------------------------------------
import numpy as np
from numpy import inf, random, sqrt
import string
import inspect
import types, copy
from . import distributions
from .Node import ZeroProbability
def deterministic_to_NDarray(arg):
if isinstance(arg,proposition5.Deterministic):
return arg.value
else:
return arg
def prop(func):
"""Function decorator for defining property attributes
The decorated function is expected to return a dictionary
containing one or more of the following pairs:
fget - function for getting attribute value
fset - function for setting attribute value
fdel - function for deleting attribute
This can be conveniently constructed by the locals() builtin
function; see:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/205183
"""
return property(doc=func.__doc__, **func())
|