def _safe_getmodule(o):
from inspect import getmodule<EOL>try:<EOL><INDENT>return getmodule(o)<EOL><DEDENT>except: <EOL><INDENT>msg.err("<STR_LIT>".format(o), <NUM_LIT:2>)<EOL>pass<EOL><DEDENT>
Attempts to return the module in which `o` is defined.