def _try_get_child_op_type(
        op: Operation, child_op_type: str, index: int = 0
    ) -> Optional[Operation]:
        """
        Returns child op if type matches, otherwise returns ``None``.

                Parameters
                ----------

        param op : Current op.

        param child_op_type : Expected child op type.

        param index : Child op index.
        """
        if op is None:
            return None
        if len(op.outputs) != 1:
            return None
        child_ops = list(op.outputs[0].child_ops)
        if index >= len(child_ops):
            return None
        if child_ops[index].op_type != child_op_type:
            return None
        return child_ops[index]

        Returns child op if type matches, otherwise returns ``None``.

                Parameters
                ----------

        param op : Current op.

        param child_op_type : Expected child op type.

        param index : Child op index.
        
coremltools/converters/mil/mil/passes/defs/optimize_normalization.py