code: def make_mock_container(
      state: str,
      exit_code: int,
      detail_status: str,
      events: Event | None = None,
  ):
      container = Container(name="hello_world", image="test", resources="test")  # type: ignore[arg-type]
      container_prop = ContainerPropertiesInstanceView()
      container_state = ContainerState()
      container_state.state = state  # type: ignore[assignment]
      container_state.exit_code = exit_code  # type: ignore[assignment]
      container_state.detail_status = detail_status  # type: ignore[assignment]
      container_prop.current_state = container_state  # type: ignore[assignment]
      if events:
          container_prop.events = events  # type: ignore[assignment]
      container.instance_view = container_prop  # type: ignore[assignment]
  
      cg = ContainerGroup(containers=[container], os_type="Linux")
  
      return cg
  
imports: from __future__ import annotations
  from collections import namedtuple
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from azure.mgmt.containerinstance.models import Container, ContainerGroup, ContainerPropertiesInstanceView, ContainerState, Event
  from airflow.exceptions import AirflowException
  from airflow.providers.microsoft.azure.operators.container_instances import AzureContainerInstancesOperator
label_desc: Use image node_id 3 for calling a global function with example usage: make_mock_container(state, exit_code, detail_status, events) and returns: cg