<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chain_getattr(obj, attr, value=None):
 """Get chain attribute for an object. """

    try:
        return _resolve_value(safe_chain_getattr(obj, attr))
    except AttributeError:
        return value