code: def fetch_file(filename: str = ""):
      from starlette.responses import FileResponse
  
      if not os.path.isfile(filename):
          raise HTTPException(status_code=404, detail="File not found")
  
      if not any(
          Path(x).absolute() in Path(filename).absolute().parents
          for x in allowed_dirs
      ):
          raise ValueError(
              f"File cannot be fetched: {filename}. Must be in one of directories registered by extra pages."
          )
  
      ext = os.path.splitext(filename)[1].lower()[1:]
      if ext not in allowed_preview_extensions():
          raise ValueError(
              f"File cannot be fetched: {filename}. Extensions allowed: {allowed_preview_extensions()}."
          )
  
      # would profit from returning 304
      return FileResponse(filename, headers={"Accept-Ranges": "bytes"})
  
imports: import functools
  import os.path
  import urllib.parse
  from pathlib import Path
  from modules import shared, ui_extra_networks_user_metadata, errors, extra_networks
  from modules.images import read_info_from_image, save_image_with_geninfo
  import gradio
  import json
  import html
  from fastapi.exceptions import HTTPException
  from modules.generation_parameters_copypaste import image_from_url_text
  from modules.ui_components import ToolButton
label_desc: Use image node_id 4 for calling a global function with example usage: fetch_file(filename) and returns: FileResponse