code: def replace_directory(out_files, dest_dir):
      
      if is_sequence(out_files):
          filenames = map(os.path.basename, out_files)
          return [os.path.join(dest_dir, x) for x in filenames]
      elif is_string(out_files):
          return os.path.join(dest_dir, os.path.basename(out_files))
      else:
          raise ValueError("in_files must either be a sequence of filenames "
                           "or a string")
docs: change the output directory to dest_dir
      can take a string (single file) or a list of files