def METHOD_NAME(config: Any, load_site_user: bool = True):
    conf = _get_config(config)
    assert 'ckan' not in dir()  # otherwise loggers would be disabled
    # We have now loaded the config. Now we can import ckan for the
    # first time.
    from ckan.config.environment import load_environment
    load_environment(conf)
    # Set this internal test request context with the configured environment so
    # it can be used when calling url_for from the CLI.
    global _cli_test_request_context
    app = make_app(conf)
    flask_app = app.apps['flask_app']._wsgi_app
    _cli_test_request_context = flask_app.test_request_context()
    registry = Registry()
    registry.prepare()
    site_user = None
    if model.user_table.exists() and load_site_user:
        site_user = logic.get_action('get_site_user')({'ignore_auth': True}, {})
    ## give routes enough information to run url_for
    parsed = urlparse(
        cast(str, conf.get('ckan.site_url', 'http://0.0.0.0')))
    request_config = routes.request_config()
    request_config.host = parsed.netloc + parsed.path
    request_config.protocol = parsed.scheme
    return site_user