parameters: (node, ctx, default_to_null_return=True)
return_statement: return node
docstring: Ensure a function has only a single return, at the end.
docstring_summary: Ensure a function has only a single return, at the end.
docstring_tokens: Ensure a function has only a single return at the end .
function: def transform(node, ctx, default_to_null_return=True):
    """Ensure a function has only a single return, at the end."""
    node = qual_names.resolve(node)
    node = activity.resolve(node, ctx, None)
  
    # Note: Technically, these two could be merged into a single walk, but
    # keeping them separate helps with readability.
    node = ConditionalReturnRewriter(ctx).visit(node)
  
    node = qual_names.resolve(node)
    node = activity.resolve(node, ctx, None)
    transformer = ReturnStatementsTransformer(
        ctx, allow_missing_return=default_to_null_return)
    node = transformer.visit(node)
    return node
function_tokens: def transform ( node , ctx , default_to_null_return = True ) : node = qual_names . resolve ( node ) node = activity . resolve ( node , ctx , None ) # Note: Technically, these two could be merged into a single walk, but # keeping them separate helps with readability. node = ConditionalReturnRewriter ( ctx ) . visit ( node ) node = qual_names . resolve ( node ) node = activity . resolve ( node , ctx , None ) transformer = ReturnStatementsTransformer ( ctx , allow_missing_return = default_to_null_return ) node = transformer . visit ( node ) return node