[docs]@staticmethoddefrun(input_params:StepParams=None):assertisinstance(input_params,DataWeighterParams), \
"DataWeighter step: input_params have to be an instance of DataWeighterParams class."weighting_strategy=input_params.weighting_strategyweighting_params=input_params.weighting_paramsifweighting_strategyisNone:returninput_params.datasetdataset=input_params.dataset.clone()print(f"{datetime.datetime.now()}: Computing example weights...")example_weights=weighting_strategy.compute_weights(dataset,weighting_params)dataset.set_example_weights(example_weights)print(f"{datetime.datetime.now()}: Example weights computed.")returndataset