def func_code(flike):
    """
    Given a function like object (function, static method, etc.), return its
    functional code object. Attempts to bridge the gap between different versions'
    introspective namings.
    """

    if hasattr(flike, 'func_code'):    # Python 2.6 or 2.7, most functions
        return flike.func_code
    elif hasattr(flike, '__code__'):   # Python 3
        return flike.__code__
    else:
        raise ValueError("don't know where to find function's code")