code: def download_files(sources: List[str]) -> List[str]:
      """
      Downloads a list of files from the web and returns a list of their paths where they are stored locally.
      :param sources: A list of URLs to download.
      :type sources: List[str]
      :return: A list of paths to the downloaded files.
      """
  
      fetcher = LinkContentFetcher(
          user_agents=[
              "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
          ]
      )
      streams = fetcher.run(urls=sources)
  
      all_files = []
      for stream in streams["streams"]:
          file_suffix = (
              ".html"
              if stream.meta["content_type"] == "text/html"
              else ".pdf"
          )
          f = NamedTemporaryFile(delete=False, suffix=file_suffix)
          stream.to_file(Path(f.name))
          all_files.append(f.name)
  
      return all_files
  
imports: import os
  import re
  from pathlib import Path
  from tempfile import NamedTemporaryFile
  from typing import Optional, List, Any, Dict
  from typing import Union, Type
  from haystack import Pipeline
  from haystack.components.converters import TextFileToDocument
  from haystack.components.embedders import SentenceTransformersDocumentEmbedder, OpenAIDocumentEmbedder
  from haystack.components.fetchers import LinkContentFetcher
  from haystack.components.preprocessors import DocumentCleaner, DocumentSplitter
  from haystack.components.routers import FileTypeRouter
  from haystack.components.joiners import DocumentJoiner
  from haystack.components.writers import DocumentWriter
  from haystack.document_stores.types import DocumentStore
label_desc: Use image node_id 1 for calling a global function with example usage: download_files(sources) and returns: all_files