How does prepare inputs for generation work in GPT-2?

Main class - generation and Utilities for generation don’t mention prepare_inputs_for_generation() in general. Moreover, that function in GPT-2 doesn’t have comments.

Can somone explain how does it work for me? Or any documentation link helps