code: def test_get_default_device(
      mock_torch_device_count: unittest.mock.MagicMock,
      local_rank: int,
      device_count: int,
      expected_device: torch.device,
  ) -> None:
      core_context = core._dummy_init(distributed=_get_dist_context())
      core_context.distributed.local_rank = local_rank
      mock_torch_device_count.return_value = device_count
  
      default_device = experimental.get_default_device(core_context)
      assert expected_device == default_device
  
imports: import math
  import unittest.mock
  from typing import Any, Dict, List, Optional
  import pytest
  import torch
  from torch.utils import data
  from determined import core, pytorch
  from determined.pytorch import experimental
  from tests.launch import test_util
label_desc: Use image node_id 17 for calling a global function with example usage: test_get_default_device(mock_torch_device_count, local_rank, device_count, expected_device) without return types