https://www.programming-helper.com/generate-function
def generate_function(name, required_params, optional_params): params = required_params for optional_param in optional_params: params.append(optional_param + ' = None') params = ', '.join(params) function = f'def {name}({params}):\n' function += f' return ""' return function