<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def custom_render_template(template_name_or_list, **context):
 """ Try to render templates in the custom folder first, if no custom templates, try the theme's default ones. """

    response_str = render_template(
        functools.reduce(lambda x, y: x + [os.path.join('custom', y), y],
                         to_list(template_name_or_list), []),
        **context
    )
    if hasattr(g, 'status_code'):
        status_code = g.status_code
    else:
        status_code = 200
    return response_str, status_code