def sanitize_block(
        block,
        sanitizer_vars,
        sanitizer_ops,
        main_input_types=None,
        sanitize_model_inputs_outputs_only=False,
    ):
        """
        Sanitize the vars and op names inside the block to adhere to the format [a-zA-Z_][a-zA-Z0-9_]*
        """

        if sanitize_model_inputs_outputs_only:
            NameSanitizer._sanitize_block_input_vars(
                block, sanitizer_vars, main_input_types, sanitize_main_input_only=True
            )
            NameSanitizer._sanitize_main_outputs_only(block, sanitizer_vars)
        else:
            NameSanitizer._sanitize_block_input_vars(block, sanitizer_vars, main_input_types)
            NameSanitizer._sanitize_output_vars_and_nested_blocks(
                block, sanitizer_vars, sanitizer_ops
            )
            NameSanitizer._sanitize_op_names(block, sanitizer_ops)

        Sanitize the vars and op names inside the block to adhere to the format [a-zA-Z_][a-zA-Z0-9_]*
        
coremltools/converters/mil/mil/passes/defs/preprocess.py