def _find_head_bem(subject, subjects_dir, high_res=False):
 fnames = (_high_res_head_fnames if high_res else _head_fnames)
 for fname in fnames:
  path = fname.format(subjects_dir=subjects_dir, subject=subject)
  if os.path.exists(path):
   return path

def _find_head_bem ( subject , subjects_dir , high_res = False ) : fnames = ( _high_res_head_fnames if high_res else _head_fnames ) for fname in fnames : path = fname . format ( subjects_dir = subjects_dir , subject = subject ) if os . path . exists ( path ) : return path
find a high resolution head .