def traceback(frame, parent=False):
<EOL>if parent is True:<EOL><INDENT>outers = inspect.getouterframes(frame)<EOL>traceback = (len(outers) == <NUM_LIT:1>) and None or inspect.getframeinfo(outers[<NUM_LIT:1>][<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>traceback = inspect.getframeinfo(frame)<EOL><DEDENT>return traceback<EOL>
Pick frame info from current caller's `frame`.

    Args:
        * frame: :type:`frame` instance, use :func:`inspect.currentframe`.
        * parent: whether to get outer frame (caller) traceback info, :data:`False` by default.

    Returns:
        :class:`inspect.Trackback` instance from :data:`frame` or its parent frame.