code: def get_rank_aware_path(
      path: pathlib.Path, rank: int
  ) -> pathlib.Path:
      """
      Add suffix "#{rank}" to the names of tensorboard
      profiler data files; those names are the host names.
      For example, with rank = 3 "2022_05_13_15_25_41/ip-172-31-8-212.input_pipeline.pb"
      will become "2022_05_13_15_25_41/ip-172-31-8-212#3.input_pipeline.pb"
      """
  
      pytorch_profiler_extension = get_pytorch_profiler_file_extension(
          path
      )
      if pytorch_profiler_extension:
          return _get_rank_aware_path_pytorch_profiler(
              path, pytorch_profiler_extension, rank
          )
  
      for ext in profiler_file_extensions:
          if path.match(f"*{ext}"):
              num_parts = ext.count(".")
              while num_parts > 0:
                  path = path.with_suffix("")
                  num_parts -= 1
              path = path.with_name(f"{path.name}#{rank}{ext}")
              return path
      return path
  
file_path: determined/harness/determined/tensorboard/util.py
imports: import logging
  import pathlib
  import re
  from typing import List, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: get_rank_aware_path(path, rank) and returns: path, _get_rank_aware_path_pytorch_profiler, path