code: def _federated_sample_host(ctx, df: DataFrame):
      regenerated_tag = ctx.guest.get(REGENERATED_TAG)
      if regenerated_tag is False:
          sample_indexer = ctx.guest.get(SAMPLE_INDEX_TAG)
          sample_df = df.loc(sample_indexer, preserve_order=True)
      else:
          regenerated_ids = ctx.guest.get(REGENERATED_IDS)
          regenerated_raw_table = _regenerated_sample_ids(
              df, regenerated_ids
          )
          sample_df = _convert_raw_table_to_df(
              df._ctx, regenerated_raw_table, df.data_manager
          )
  
          sample_indexer = ctx.guest.get(SAMPLE_INDEX_TAG)
          sample_df = sample_df.loc(sample_indexer, preserve_order=True)
  
      return sample_df
  
file_path: FATE/python/fate/arch/dataframe/utils/_sample.py
imports: import functools
  from typing import Union, Dict, Any
  from sklearn.utils import resample
  from ._id_generator import generate_sample_id, generate_sample_id_prefix
  from .._dataframe import DataFrame
label_desc: Use image node_id 4 for calling a global function with example usage: _federated_sample_host(ctx, df) and returns: sample_df