(index: int, parent: ast.AST,
              nodes: Union[ast.AST, List[ast.AST]],
              holder_attribute='body')
Inserts nodes to parents body at index.
Inserts nodes to parents body at index.
Inserts nodes to parents body at index .
def insert_at(index: int, parent: ast.AST,
              nodes: Union[ast.AST, List[ast.AST]],
              holder_attribute='body') -> None:
    """Inserts nodes to parents body at index."""
    if not isinstance(nodes, list):
        nodes = [nodes]

    for child in nodes[::-1]:
        getattr(parent, holder_attribute).insert(index, child)
def insert_at ( index : int , parent : ast . AST , nodes : Union [ ast . AST , List [ ast . AST ] ] , holder_attribute = 'body' ) -> None : if not isinstance ( nodes , list ) : nodes = [ nodes ] for child in nodes [ : : - 1 ] : getattr ( parent , holder_attribute ) . insert ( index , child )