def _get_a_code_object_from( thing ) :
<EOL>if isinstance( thing, types.MethodType ) :<EOL><INDENT>thing = thing.__func__<EOL><DEDENT>if hasattr( thing, '<STR_LIT>' ) :<EOL><INDENT>thing = thing.fget<EOL><DEDENT>if isinstance( thing, types.FunctionType ) :<EOL><INDENT>thing = thing.__code__<EOL><DEDENT>return thing<EOL>
Given a thing that might be a property, a class method,
a function or a code object, reduce it to code object.
If we cannot, return the thing itself.