code: def ensure_local(file_path: str) -> str:
      """Ensures that the given file path is made available locally."""
      if not any(
          [file_path.startswith(prefix) for prefix in _REMOTE_FS_PREFIX]
      ):
          return file_path
  
      temp_dir = tempfile.mkdtemp()
      local_path = os.path.join(temp_dir, os.path.basename(file_path))
      copy_file(file_path, local_path, True)
      return local_path
  
imports: import os
  import re
  import tempfile
  from typing import List, TypeVar, Iterable
  from tfx.dsl.io import fileio
  from google.protobuf import json_format
  from google.protobuf import text_format
  from google.protobuf.message import Message
label_desc: Use image node_id 1 for calling a global function with example usage: ensure_local(file_path) and returns: local_path, file_path