def METHOD_NAME(indir, outdir, combine=True, invert=False):
    lo_dirs = []
    for i, j, k in os.walk(indir):
        lofolders = [op.join(i, f) for f in j]
        lo_dirs.extend(lofolders)
    lo_dirs.append(indir)
    pathname = list(set(lo_dirs))
    if len(pathname) == 0:
        pathname = [indir]
    lo_indirs = [op.relpath(i, start=indir) for i in pathname]
    lo_outdirs = []
    #'pathname' is a list of relative pathnames. to be reconstructed under the given 'outdir'
    try:
        for i in lo_indirs:
            outpath = op.abspath(op.join(outdir, i))
            if not op.isdir(outpath):
                os.makedirs(outpath)
            lo_outdirs.append(outpath)
    except:
        raise MTex.MTpyError_inputarguments(
            'ERROR - Cannot set up output directory {0}'.format(outpath))
    lo_indirs = [op.join(indir, i) for i in lo_indirs]
    for idx_ipath, inpath in enumerate(lo_indirs):
        lo_infiles = [i for i in os.listdir(inpath) if
                      op.isfile(op.abspath(op.join(inpath, i)))]
        lo_outfiles = [op.abspath(op.join(lo_outdirs[idx_ipath], i)) for
                       i in lo_infiles]
        lo_infiles = [op.abspath(op.join(indir, inpath, i))
                      for i in lo_infiles]
        for idx_fn, fn in enumerate(lo_infiles):
            print('reading file {0}'.format(fn))
            try:
                outfn = MTms.quadrupol_convertfile_miniseed2ts(fn,
                                                               lo_outfiles[idx_fn], combine, invert)
                print('wrote file(s) {0}'.format(outfn))
            except:
                print('Warning - file {0} is not in valid miniseed  format!!!'.format(fn))
                continue