code: def check_1d_device_mesh():
      # check for 1D device mesh
      process_group = dist.GroupMember.WORLD
      device_mesh = DeviceMesh.from_process_group(process_group)
  
      # checks
      assert device_mesh.shape == [4]
      assert (
          len(device_mesh.get_process_group_for_all_axes().keys()) == 1
      ), "Expected 1 axis for the process group dict"
      assert (
          device_mesh.get_process_group(axis=0) == process_group
      ), "Expected world process group"
      assert device_mesh.is_initialized
      assert device_mesh.num_devices == 4
      assert device_mesh.is_initialized
      assert device_mesh.logical_mesh_id is None
      assert device_mesh._is_init_from_process_group
  
file_path: ColossalAI/tests/test_device/test_device_mesh.py
imports: import pytest
  import torch
  import torch.distributed
  import colossalai
  from colossalai.device.device_mesh import DeviceMesh
  from colossalai.testing import rerun_if_address_is_in_use, spawn
label_desc: Use image node_id 2 for calling a global function with example usage: check_1d_device_mesh() without return types