code: def _translate_path(path: str, directories: Sequence[Path]) -> str:
      """Translates a relative path to a file in the local datasource.
  
      Tries to resolve the relative path to a file in the first directory
      and serves it if it exists. Otherwise, it tries to resolve the relative
      path to a file in the second directory and serves it if it exists, etc.
  
      Args:
          path:
              Relative path to a file in the local datasource.
          directories:
              List of directories to search for the file.
  
  
      Returns:
          Absolute path to the file in the local datasource or an empty string
          if the file doesn't exist.
  
      """
      stripped_path = path.lstrip("/")
      for directory in directories:
          if (directory / stripped_path).exists():
              return str(directory / stripped_path)
      return ""
  
imports: from http.server import HTTPServer, SimpleHTTPRequestHandler
  from pathlib import Path
  from typing import Sequence
label_desc: Use image node_id 2 for calling a global function with example usage: _translate_path(path, directories) and returns: str, str