code: def _gen_series_chunks(splits, out_shape, left_or_right, series):
      out_chunks = []
      if splits[0] is not None:
          # need no shuffle
          for out_idx in range(out_shape[0]):
              idx = splits.get_axis_idx(0, left_or_right, out_idx)
              index_min_max = splits.get_axis_split(
                  0, left_or_right, out_idx
              )
              chunk = series.cix[(idx,)]
              if _need_align_map(chunk, index_min_max, None):
                  align_op = DataFrameIndexAlign(
                      stage=OperandStage.map,
                      index_min_max=index_min_max,
                      column_min_max=None,
                      dtype=chunk.dtype,
                      sparse=series.issparse(),
                      output_types=[OutputType.series],
                  )
                  params = align_op.build_map_chunk_kw(
                      [chunk], shape=(np.nan,), index=(out_idx,)
                  )
                  out_chunk = align_op.new_chunk([chunk], **params)
              else:
                  out_chunk = chunk
              out_chunks.append(out_chunk)
      else:
          # gen map chunks
          map_chunks = []
          for chunk in series.chunks:
              map_op = DataFrameIndexAlign(
                  stage=OperandStage.map,
                  sparse=chunk.issparse(),
                  index_shuffle_size=out_shape[0],
                  output_types=[OutputType.series],
              )
              params = map_op.build_map_chunk_kw(
                  [chunk], shape=(np.nan,), index=chunk.index
              )
              map_chunks.append(map_op.new_chunk([chunk], **params))
  
          proxy_chunk = DataFrameShuffleProxy(
              output_types=[OutputType.series]
          ).new_chunk(map_chunks, shape=())
  
          # gen reduce chunks
          for out_idx in range(out_shape[0]):
              reduce_op = DataFrameIndexAlign(
                  stage=OperandStage.reduce,
                  n_reducers=out_shape[0],
                  i=out_idx,
                  sparse=proxy_chunk.issparse(),
                  output_types=[OutputType.series],
              )
              params = reduce_op.build_reduce_chunk_kw(
                  [proxy_chunk], index=(out_idx,), shape=(np.nan,)
              )
              out_chunks.append(
                  reduce_op.new_chunk([proxy_chunk], **params)
              )
  
      return out_chunks
  
imports: import itertools
  import operator
  import numpy
  import pandas
  from ..None import opcodes
  from ..core import OutputType
  from ..core.operand import OperandStage, MapReduceOperand
  from ..serialization.serializables import FieldTypes, AnyField, BoolField, Int32Field, KeyField, ListField
  from .core import SERIES_CHUNK_TYPE
  from .utils import hash_dtypes, filter_dtypes
  from .operands import DataFrameOperandMixin, DataFrameShuffleProxy
  from .utils import parse_index, split_monotonic_index_min_max, build_split_idx_to_origin_idx, filter_index_value, hash_index, is_index_value_identical, validate_axis
label_desc: Use image node_id 8 for calling a global function with example usage: _gen_series_chunks(splits, out_shape, left_or_right, series) and returns: out_chunks