Pocket FM uses callback-heavy interfaces for episode cards and playback controls. Implement a Python model of JavaScript's Function.prototype.bind that preserves a function's receiver context and supports partial application of arguments.
Because JSON cannot represent executable functions, the function is identified by a name. The supported functions are:
format_episode: reads this_arg["title"] and returns "<title>: <prefix><episode>".progress_label: reads this_arg["duration"] and returns "<current>/<duration> <unit>".Implement custom_bind(function_name, this_arg, bound_args, call_args). It must create a bound callable internally, prepend bound_args to call_args, invoke the selected function with this_arg as its receiver, and return the result.
function_name: a string, either "format_episode" or "progress_label".this_arg: a dictionary containing the context used by the selected function.bound_args: a list of arguments captured when binding occurs.call_args: a list of arguments supplied when the bound function is later called.def custom_bind(function_name, this_arg, bound_args, call_args):