code: def setup_hdfs():
      """Set env vars required by pyarrow to talk to hdfs correctly.
  
      Returns hostname and port needed for the hdfs uri."""
  
      # the following file is written in `install-hdfs.sh`.
      with open("/tmp/hdfs_env", "r") as f:
          for line in f.readlines():
              line = line.rstrip("\n")
              tokens = line.split("=", maxsplit=1)
              os.environ[tokens[0]] = tokens[1]
      import sys
  
      sys.path.insert(0, os.path.join(os.environ["HADOOP_HOME"], "bin"))
      hostname = os.getenv("CONTAINER_ID")
      port = os.getenv("HDFS_PORT")
      yield hostname, port
  
file_path: ray/python/ray/air/tests/test_remote_storage_hdfs.py
imports: import os
  import pytest
  from ray import train
  from ray.train.base_trainer import TrainingFailedError
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.train.tests.test_new_persistence import TestConstants, train_fn, _assert_storage_contents, _get_local_inspect_dir, _resume_from_checkpoint
label_desc: Use image node_id 1 for calling a global function with example usage: setup_hdfs() without return types