code: def _redirect(
      datasette,
      request,
      path,
      forward_querystring=True,
      remove_args=None,
  ):
      if (
          request.query_string
          and "?" not in path
          and forward_querystring
      ):
          path = f"{path}?{request.query_string}"
      if remove_args:
          path = path_with_removed_args(request, remove_args, path=path)
      r = Response.redirect(path)
      r.headers["Link"] = f"<{path}>; rel=preload"
      if datasette.cors:
          add_cors_headers(r.headers)
      return r
  
imports: import asyncio
  import itertools
  import json
  import urllib
  from asyncinject import Registry
  import markupsafe
  from datasette.plugins import pm
  from datasette.database import QueryInterrupted
  from datasette import tracer
  from datasette.utils import add_cors_headers, await_me_maybe, call_with_supported_arguments, CustomRow, append_querystring, compound_keys_after_sql, format_bytes, tilde_encode, escape_sqlite, filters_should_redirect, is_url, path_from_row_pks, path_with_added_args, path_with_format, path_with_removed_args, path_with_replaced_args, to_css_class, truncate_url, urlsafe_components, value_as_boolean, InvalidSql, sqlite3
  from datasette.utils.asgi import BadRequest, Forbidden, NotFound, Response
  from datasette.filters import Filters
  import sqlite_utils
  from .base import BaseView, DatasetteError, ureg, _error, stream_csv
  from .database import QueryView
label_desc: Use image node_id 1 for calling a global function with example usage: _redirect(datasette, request, path, forward_querystring, remove_args) and returns: r