<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def absolute_url(relative_url):
 """Returns an absolute URL from a URL relative to the server root. The base URL is taken from the Flask app config if present, otherwise it falls back to ``http://inspirehep.net``. """

    default_server = 'http://inspirehep.net'
    server = current_app.config.get('SERVER_NAME', default_server)
    if not re.match('^https?://', server):
        server = u'http://{}'.format(server)
    return urllib.parse.urljoin(server, relative_url)