code: def federated_sample(
      ctx,
      df: DataFrame,
      n: int = None,
      frac: Union[float, Dict[Any, float]] = None,
      replace: bool = True,
      random_state=None,
      role: str = "guest",
  ):
      if role == "guest":
          return _sample_guest(
              ctx, df, n, frac, replace, random_state, sync=True
          )
      else:
          return _federated_sample_host(ctx, 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 2 for calling a global function with example usage: federated_sample(ctx, df, n, frac, replace, random_state, role) and returns: _sample_guest, _federated_sample_host