def _find_fiducials_files(subject, subjects_dir):
 fid = []
 if os.path.exists(fid_fname.format(subjects_dir=subjects_dir, subject=subject)):
  fid.append(fid_fname)
 pattern = pformat(fid_fname_general, subjects_dir=subjects_dir, subject=subject, head='*')
 regex = pformat(fid_fname_general, subjects_dir=subjects_dir, subject=subject, head='(.+)')
 for path in iglob(pattern):
  match = re.match(regex, path)
  head = match.group(1).replace(subject, '{subject}')
  fid.append(pformat(fid_fname_general, head=head))
 return fid

def _find_fiducials_files ( subject , subjects_dir ) : fid = [ ] if os . path . exists ( fid_fname . format ( subjects_dir = subjects_dir , subject = subject ) ) : fid . append ( fid_fname ) pattern = pformat ( fid_fname_general , subjects_dir = subjects_dir , subject = subject , head = '*' ) regex = pformat ( fid_fname_general , subjects_dir = subjects_dir , subject = subject , head = '(.+)' ) for path in iglob ( pattern ) : match = re . match ( regex , path ) head = match . group ( 1 ) . replace ( subject , '{subject}' ) fid . append ( pformat ( fid_fname_general , head = head ) ) return fid
find fiducial files .