code: def _flatten_partition(kvs, block_num=0):
      for block_id, blocks in kvs:
          flat_blocks = [
              Block.transform_block_to_list(block) for block in blocks
          ]
          lines = len(flat_blocks[0])
          for i in range(lines):
              yield flat_blocks[0][i], [
                  flat_blocks[j][i] for j in range(1, block_num)
              ]
  
imports: import copy
  import functools
  from typing import List, Union
  import torch
  from sklearn.utils import resample
  from .._dataframe import DataFrame
  from ..manager.data_manager import DataManager
  from ..manager.block_manager import Block
  from ._compress_block import compress_blocks
  from ._indexer import get_partition_order_by_raw_table, get_partition_order_mappings_by_block_table
  from ._promote_types import promote_partial_block_types
  from ._set_item import set_item
  from fate.arch.tensor import DTensor
label_desc: Use image node_id 7 for calling a global function with example usage: _flatten_partition(kvs, block_num) without return types