class_docstr: FileTypeRouter takes a list of data sources (file paths or byte streams) and groups them by their corresponding
  MIME types. For file paths, MIME types are inferred from their extensions, while for byte streams, MIME types
  are determined from the provided metadata.
  
  The set of MIME types to consider is specified during the initialization of the component.
  
  This component is invaluable when categorizing a large collection of files or data streams by their MIME
  types and routing them to different components for further processing.
class_docstr_tok: ["FileTypeRouter","takes","a","list","of","data","sources","(","file","paths","or","byte","streams",")","and","groups","them","by","their","corresponding","MIME","types",".","For","file","paths",",","MIME","types","are","inferred","from","their","extensions",",","while","for","byte","streams",",","MIME","types","are","determined","from","the","provided","metadata",".","The","set","of","MIME","types","to","consider","is","specified","during","the","initialization","of","the","component",".","This","component","is","invaluable","when","categorizing","a","large","collection","of","files","or","data","streams","by","their","MIME","types","and","routing","them","to","different","components","for","further","processing","."]
docstr: Get the MIME type of the provided file path.
  
  :param path: The file path to get the MIME type for.
  :return: The MIME type of the provided file path, or None if the MIME type cannot be determined.
docstr_tok: ["Get","the","MIME","type","of","the","provided","file","path",".",":","param","path",":","The","file","path","to","get","the","MIME","type","for",".",":","return",":","The","MIME","type","of","the","provided","file","path",",","or","None","if","the","MIME","type","can","not","be","determined","."]
code: def get_mime_type(self, path: Path) -> Optional[str]:
      """
      Get the MIME type of the provided file path.
  
      :param path: The file path to get the MIME type for.
      :return: The MIME type of the provided file path, or None if the MIME type cannot be determined.
      """
      extension = path.suffix.lower()
      mime_type = mimetypes.guess_type(path.as_posix())[0]
      # lookup custom mappings if the mime type is not found
      return self.get_custom_mime_mappings().get(extension, mime_type)
  
file_path: haystack/haystack/components/routers/file_type_router.py
imports: import logging
  import mimetypes
  from collections import defaultdict
  from pathlib import Path
  from typing import List, Union, Optional, Dict
  from haystack import component
  from haystack.dataclasses import ByteStream
label_desc: Use image node_id 3 for calling the FileTypeRouter obj's underlying member method code with example usage: obj.get_mime_type(path) and returns: self