def get_op_types_in_block(block: Block, skip_const_ops: bool = True, recurse: bool = False):
    """
    Return the operation types in block,
    in the same order as they are stored (topological)
    """
    op_types_in_block = []
    for op in block.operations:
        if skip_const_ops:
            if op.op_type == "const":
                continue
        op_types_in_block.append(op.op_type)

        if recurse:
            for child_block in op.blocks:
                child_ops = get_op_types_in_block(child_block, skip_const_ops, recurse)
                op_types_in_block += child_ops

    return op_types_in_block

    Return the operation types in block,
    in the same order as they are stored (topological)
    
coremltools/converters/mil/testing_utils.py