tensorbay.utility.common
Common_loads method, EqMixin class.
common_loads()
is a common method for loading an object from a dict or a list of dict.
EqMixin
is a mixin class to support __eq__() method,
which compares all the instance variables.
- tensorbay.utility.common.common_loads(object_class, contents)[source]
A common method for loading an object from a dict or a list of dict.
- Parameters
object_class (Type[tensorbay.utility.common._T]) – The class of the object to be loaded.
contents (Any) – The information of the object in a dict or a list of dict.
- Returns
The loaded object.
- Return type
tensorbay.utility.common._T
- class tensorbay.utility.common.EqMixin[source]
Bases:
object
A mixin class to support __eq__() method.
The __eq__() method defined here compares all the instance variables.
- tensorbay.utility.common.locked(func)[source]
The decorator to add threading lock for methods.
- Parameters
func (tensorbay.utility.common._CallableWithoutReturnValue) – The method needs to add threading lock.
- Returns
The method with theading locked.
- Return type
tensorbay.utility.common._CallableWithoutReturnValue