code: def output_dir(path_dict, tcons, fcons):
      """Get (and make if necessary) directory to write output into.
  
      Parameters
      ----------
      path_dict : dict
          containing key 'rootdir', 'run'
      tcons : sequence of str
          t contrasts
      fcons : sequence of str
          F contrasts
      """
      rootdir = path_dict["rootdir"]
      odir = pjoin(rootdir, "results_run%(run)03d" % path_dict)
      ensure_dir(odir)
      for n in tcons:
          ensure_dir(odir, n)
      for n in fcons:
          ensure_dir(odir, n)
      return odir
  
file_path: nipy/examples/ds105/ds105_util.py
imports: import os
  from os import listdir, makedirs
  from os.path import abspath, exists, isdir, splitext
  from os.path import join
  import numpy
  import pandas
  from nipy.io.api import load_image
label_desc: Use image node_id 10 for calling a global function with example usage: output_dir(path_dict, tcons, fcons) and returns: odir