def _stmt_is_at_end_of_parent_list(self, stmt):
    """Determine if `stmt` is at the end of a list of statements (i.e. can be an implicit `return`).

    If there are any statements following `stmt` at the same level of nesting, this method returns
    False, such as the following (if `stmt` is the Expr for `yield 'good'`):

    if 2 + 2 == 5:
      yield 'good'
      a = 3

    Note that this returns False even if the statement following `stmt` is a `return`.

    However, if `stmt` is at the end of a list of statements, it can be made more clear that `stmt`
    is intended to represent a `return`. Another way to view this method is as a dead code
    elimination check, for a `stmt` which is intended to represent control flow moving out of the
    current @rule. For example, this method would return True for both of the yield Expr statements
    in the below snippet.

    if True:
      yield 3
    else:
      a = 3
      yield a

    This checking is performed by getting the parent of `stmt` with a pre-generated table passed
    into the constructor.

    See https://docs.python.org/2/library/ast.html#abstract-grammar for the grammar specification.
    'body', 'orelse', and 'finalbody' are the only attributes on any AST nodes which can contain
    lists of stmts.  'body' is also an attribute in the Exec statement for some reason, but as a
    single expr, so we simply check if it is iterable in `_maybe_end_of_stmt_list()`.
    """
    parent_stmt = self._parents_table[stmt]
    last_body_stmt = self._maybe_end_of_stmt_list(getattr(parent_stmt, 'body', None))
    if stmt == last_body_stmt:
      return True
    last_orelse_stmt = self._maybe_end_of_stmt_list(getattr(parent_stmt, 'orelse', None))
    if stmt == last_orelse_stmt:
      return True
    last_finally_stmt = self._maybe_end_of_stmt_list(getattr(parent_stmt, 'finalbody', None))
    if stmt == last_finally_stmt:
      return True
    return False
Determine if `stmt` is at the end of a list of statements (i.e. can be an implicit `return`).

    If there are any statements following `stmt` at the same level of nesting, this method returns
    False, such as the following (if `stmt` is the Expr for `yield 'good'`):

    if 2 + 2 == 5:
      yield 'good'
      a = 3

    Note that this returns False even if the statement following `stmt` is a `return`.

    However, if `stmt` is at the end of a list of statements, it can be made more clear that `stmt`
    is intended to represent a `return`. Another way to view this method is as a dead code
    elimination check, for a `stmt` which is intended to represent control flow moving out of the
    current @rule. For example, this method would return True for both of the yield Expr statements
    in the below snippet.

    if True:
      yield 3
    else:
      a = 3
      yield a

    This checking is performed by getting the parent of `stmt` with a pre-generated table passed
    into the constructor.

    See https://docs.python.org/2/library/ast.html#abstract-grammar for the grammar specification.
    'body', 'orelse', and 'finalbody' are the only attributes on any AST nodes which can contain
    lists of stmts.  'body' is also an attribute in the Exec statement for some reason, but as a
    single expr, so we simply check if it is iterable in `_maybe_end_of_stmt_list()`.