code: def make_1d_config(
      partitions: list[int],
      devices: list[set[int]],
  ) -> ArrayConfig:
      index_map: dict[int, list[tuple[slice, ...]]] = {}
      for i in range(len(partitions) - 1):
          idx = (slice(partitions[i], partitions[i + 1]),)
          for dev in devices[i]:
              index_map.setdefault(dev, []).append(idx)
  
      shape = (partitions[-1],)
      return ArrayConfig(shape, index_map)
  
imports: import dataclasses
  import math
  import pytest
  import numpy
  import cupy
  from cupy import testing
  from cupyx.distributed.array import _linalg
  from cupyx.distributed import array
  from cupyx.distributed.array import REPLICA, SUM
label_desc: Use image node_id 1 for calling a global function with example usage: make_1d_config(partitions, devices) and returns: ArrayConfig