code: def cp_files(in_path, globs, out_path):
      try:
          os.makedirs(out_path)
      except OSError:
          pass
      out_fnames = []
      for in_glob in globs:
          in_glob_path = pjoin(in_path, in_glob)
          for in_fname in glob.glob(in_glob_path):
              out_fname = in_fname.replace(in_path, out_path)
              pth, _ = os.path.split(out_fname)
              if not os.path.isdir(pth):
                  os.makedirs(pth)
              shutil.copyfile(in_fname, out_fname)
              out_fnames.append(out_fname)
      return out_fnames
  
file_path: nipy/tools/gitwash_dumper.py
imports: import fnmatch
  import glob
  import os
  import re
  import shutil
  import sys
  import tempfile
  from optparse import OptionParser
  from os.path import join
  from subprocess import call
label_desc: Use image node_id 2 for calling a global function with example usage: cp_files(in_path, globs, out_path) and returns: out_fnames