<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _safe_hasattr(o, attr):
 """Returns True if `o` has the specified attribute. Takes edge cases into account where packages didn't intend to be used like acorn uses them. """

    try:
        has = hasattr(o, attr)
    except: # pragma: no cover
        has = False
        msg.err("_safe_hasattr: {}.{}".format(o, attr), 2)
        pass
    return has