code: def configure_app_statics(app: FastAPI):
      """Configure static folder for app"""
  
      parent_path = Path(__file__).parent.absolute()
      statics_folder = Path(os.path.join(parent_path, "static"))
      if not (statics_folder.exists() and statics_folder.is_dir()):
          return
  
      def _create_statics_folder(path_from):
          """
          Application statics will be created with a parameterized baseUrl variable.
  
          This function will replace the variable by the real runtime value found in settings.base_url
  
          This allow us to deploy the argilla server under a custom base url, even when webapp does not
          support it.
  
          """
          BASE_URL_VAR_NAME = "@@baseUrl@@"
          temp_dir = tempfile.mkdtemp()
          new_folder = shutil.copytree(path_from, temp_dir + "/statics")
          base_url = helpers.remove_suffix(
              settings.base_url, suffix="/"
          )
          for extension in ["*.js", "*.html"]:
              for file in glob.glob(
                  f"{new_folder}/**/{extension}",
                  recursive=True,
              ):
                  helpers.replace_string_in_file(
                      file,
                      string=BASE_URL_VAR_NAME,
                      replace_by=base_url,
                  )
  
          return new_folder
  
      temp_statics = _create_statics_folder(statics_folder)
  
      app.mount(
          "/",
          RewriteStaticFiles(
              directory=temp_statics, html=True, check_dir=False
          ),
          name="static",
      )
  
imports: import contextlib
  import glob
  import inspect
  import logging
  import os
  import shutil
  import tempfile
  from pathlib import Path
  import backoff
  from brotli_asgi import BrotliMiddleware
  from fastapi import FastAPI
  from fastapi.exceptions import RequestValidationError
  from starlette.middleware.cors import CORSMiddleware
  from starlette.responses import RedirectResponse
  from argilla import __version__
  from argilla.logging import configure_logging
  from argilla.server import helpers
  from argilla.server.constants import DEFAULT_API_KEY, DEFAULT_PASSWORD, DEFAULT_USERNAME
  from argilla.server.contexts import accounts
  from argilla.server.daos.backend import GenericElasticEngineBackend
  from argilla.server.daos.backend.base import GenericSearchError
  from argilla.server.daos.datasets import DatasetsDAO
  from argilla.server.daos.records import DatasetRecordsDAO
  from argilla.server.database import get_async_db
  from argilla.server.errors import APIErrorHandler, BadRequestError, ClosedDatasetError, EntityAlreadyExistsError, EntityNotFoundError, ForbiddenOperationError, InvalidTextSearchError, MissingInputParamError, UnauthorizedError, WrongTaskError
  from argilla.server.models import User
  from argilla.server.pydantic_v1 import ValidationError
  from argilla.server.pydantic_v1.errors import ConfigError
  from argilla.server.routes import api_router
  from argilla.server.security import auth
  from argilla.server.settings import settings
  from argilla.server.static_rewrite import RewriteStaticFiles
label_desc: Use image node_id 5 for calling a global function with example usage: configure_app_statics(app) and returns: new_folder