<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def render_error(category, error_message, error_codes, exception=None):
 """ Render an error page. Arguments: category -- The category of the request error_message -- The message to provide to the error template error_codes -- The applicable HTTP error code(s). Will usually be an integer or a list of integers; the HTTP error response will always be the first error code in the list, and the others are alternates for looking up the error template to use. exception -- Any exception that led to this error page """


    if isinstance(error_codes, int):
        error_codes = [error_codes]

    error_code = error_codes[0]
    template_list = [str(code) for code in error_codes]
    template_list.append(str(int(error_code / 100) * 100))
    template_list.append('error')

    template = map_template(category, template_list)
    if template:
        return render_publ_template(
            template,
            _url_root=request.url_root,
            category=Category(category),
            error={'code': error_code, 'message': error_message},
            exception=exception)[0], error_code

    # no template found, so fall back to default Flask handler
    return flask.abort(error_code)