code: def test_associated_file(tmpdir):
      fssrc = FreeSurferSource(
          subjects_dir=fs.Info.subjectsdir(),
          subject_id="fsaverage",
          hemi="lh",
      )
      fssrc.base_dir = tmpdir.strpath
      fssrc.resource_monitor = False
  
      fsavginfo = fssrc.run().outputs.get()
  
      # Pairs of white/pial files in the same directories
      for white, pial in [
          ("lh.white", "lh.pial"),
          ("./lh.white", "./lh.pial"),
          (fsavginfo["white"], fsavginfo["pial"]),
      ]:
          # Unspecified paths, possibly with missing hemisphere information,
          # are equivalent to using the same directory and hemisphere
          for name in ("pial", "lh.pial", pial):
              assert (
                  FSSurfaceCommand._associated_file(white, name) == pial
              )
  
          # With path information, no changes are made
          for name in ("./pial", "./lh.pial", fsavginfo["pial"]):
              assert (
                  FSSurfaceCommand._associated_file(white, name) == name
              )
  
imports: import pytest
  from ..base import FSSurfaceCommand
  from ...None import freesurfer
  from ...io import FreeSurferSource
label_desc: Use image node_id 2 for calling a global function with example usage: test_associated_file(tmpdir) without return types