a helper function to find template/input file pairs and
    instruction file/output file pairs.  the return values from this
    function can be passed straight to pyemu.Pst.from_io_files() classmethod
    constructor. Assumes the template file names are <input_file>.tpl and
    instruction file names are <output_file>.ins.

    Parameters
    ----------
    d : str
        directory to search for interface files

    Returns
    -------
    tpl_files : list
        list of template files in d
    in_files : list
        list of input files in d
    ins_files : list
        list of instruction files in d
    out_files : list
        list of output files in d

def parse_dir_for_io_files(d):
    """ a helper function to find template/input file pairs and
    instruction file/output file pairs.  the return values from this
    function can be passed straight to pyemu.Pst.from_io_files() classmethod
    constructor. Assumes the template file names are <input_file>.tpl and
    instruction file names are <output_file>.ins.

    Parameters
    ----------
    d : str
        directory to search for interface files

    Returns
    -------
    tpl_files : list
        list of template files in d
    in_files : list
        list of input files in d
    ins_files : list
        list of instruction files in d
    out_files : list
        list of output files in d

    """

    files = os.listdir(d)
    tpl_files = [f for f in files if f.endswith(".tpl")]
    in_files = [f.replace(".tpl","") for f in tpl_files]
    ins_files = [f for f in files if f.endswith(".ins")]
    out_files = [f.replace(".ins","") for f in ins_files]
    return tpl_files,in_files,ins_files,out_files