def METHOD_NAME(cls, ctx, op: "StatsModelsTrain"):
    endog = ctx[op.endog.key]
    exog = ctx[op.exog.key]
    # code from statsmodels.base.distributed_estimation::_helper_fit_partition
    model = op.model_class(endog, exog, **op.init_kwds)
    results = op.estimation_method(
        model,
        op.partition_id,
        op.num_partitions,
        fit_kwds=op.fit_kwds,
        **op.estimation_kwds
    )
    ctx[op.outputs[0].key] = pickle.dumps(results)