def METHOD_NAME(path, config_path):
    """ This function is the gateway for rendering a template for a file.
    """
    # initialization
    cp = get_embedded_config(path)
    output = ''
    filename = os.path.basename(path)
    # use meta-data if not empty for rendering
    if cp.has_option(filename, 'render-function'):
        render_function_name = cp.get(filename, 'render-function')
        render_function = eval(render_function_name)
        output = render_function(path, cp)
    # read configuration file for rendering
    elif os.path.exists(config_path):
        cp.read(config_path)
        # render template
        if cp.has_option(filename, 'render-function'):
            render_function_name = cp.get(filename, 'render-function')
            render_function = eval(render_function_name)
            output = render_function(path, cp)
        else:
            output = render_default(path, cp)
    # if no configuration file is present
    # then render the default template
    else:
        output = render_default(path, cp)
    return output