def METHOD_NAME(
    shape: Tuple[int, int],
    xs: np.ndarray,
    ys: np.ndarray,
    axes1: np.ndarray,
    axes2: np.ndarray,
    angles: np.ndarray,
    shift: int = 3,
) -> np.ndarray:
    """Given simulated cell variables, generate a label array.
    Args:
        shape: The size of the X and Y axes, in pixels.
        xs, ys: Center X and Y coordinates for each cell.
        axes1, axes2: Axes lengths for each cell.
        angles: Angle for each cell.
        shift: Attempt to minimize overlaps between cells by shifting overlapping
            cells by this amount (in reality, this is just a scaling factor, so
            larger values mean to shift overlapping cells by more). Set to zero
            or negative to disable.
    Returns:
        New Numpy array containing cell labels.
    """
    n = xs.size
    if n != xs.size or n != axes1.size or n != axes2.size or n != angles.size:
        raise SegmentationError(f"All input arrays must have size {n}")
    indices_to_add = deque(range(xs.size))  # +1 to get actual label to add!
    labels = np.zeros(shape, dtype=np.int32)
    i = 0
    while indices_to_add:
        if i >= n * 100:
            raise SegmentationError(
                f"Reached iteration {i}. Try reducing the number of cells or turn off shifting by setting `shift=0`."
            )
        idx = indices_to_add.popleft()
        label = idx + 1
        x, y, axis1, axis2, angle = xs[idx], ys[idx], axes1[idx], axes2[idx], angles[idx]
        prev_labels = labels.copy()
        cv2.ellipse(labels, (x, y), (axis1, axis2), angle, 0, 360, label, -1)
        if shift > 1:
            # Find & remove overlapping labels.
            overlapping = np.unique(prev_labels[(labels == label) & (prev_labels > 0)])
            labels[np.isin(labels, overlapping)] = 0
            # Compute shifted locations for each of the overlapping labels.
            for ov_label in overlapping:
                ov_idx = ov_label - 1
                if ov_idx not in indices_to_add:
                    indices_to_add.append(int(ov_idx))
                ov_x, ov_y = xs[ov_idx], ys[ov_idx]
                diff_x = ov_x - x
                diff_y = ov_y - y
                distance = np.sqrt(diff_x**2 + diff_y**2) + 1e-5
                # Shift
                xs[ov_idx] = min(max(0, round(ov_x + ((diff_x + 1e-5) / distance * shift))), shape[0])
                ys[ov_idx] = min(max(0, round(ov_y + (diff_y + 1e-5) / distance * shift)), shape[1])
        i += 1
    return labels