def METHOD_NAME(traces, filename_template, format='mtpy',
         additional={}, stations=None):
    '''Save traces to file(s).
    :param traces: a trace or an iterable of traces to store
    :param filename_template: filename template with placeholders for trace
            metadata. Uses normal python '%(placeholder)s' string templates. The following
            placeholders are considered: ``network``, ``station``, ``location``,
            ``channel``, ``tmin`` (time of first sample), ``tmax`` (time of last
            sample), ``tmin_ms``, ``tmax_ms``, ``tmin_us``, ``tmax_us``. The
            versions with '_ms' include milliseconds, the versions with '_us'
            include microseconds.
    :param format: ``mseed``, ``mtpy``
    :param additional: dict with custom template placeholder fillins.
    :returns: list of generated filenames
    .. note::
        Network, station, location, and channel codes may be silently truncated
        to file format specific maximum lengthes.
    '''
    if isinstance(traces, trace.Trace):
        traces = [traces]
    if format == 'from_extension':
        format = os.path.splitext(filename_template)[1][1:]
    if format == 'mseed':
        return mseed.METHOD_NAME(traces, filename_template, additional)
    elif format == 'sac':
        fns = []
        for tr in traces:
            f = sac.SacFile(from_trace=tr)
            if stations:
                s = stations[tr.network, tr.station, tr.location]
                f.stla = s.lat
                f.stlo = s.lon
                f.stel = s.elevation
                f.stdp = s.depth
                f.cmpinc = s.get_channel(tr.channel).dip + 90.
                f.cmpaz = s.get_channel(tr.channel).azimuth
            fn = tr.fill_template(filename_template, **additional)
            util.ensuredirs(fn)
            f.write(fn)
            fns.append(fn)
        return fns
    elif format == 'mtpy':
        fns = []
        for tr in traces:
            fn = tr.fill_template(filename_template, **additional)
            x, y = tr.get_xdata(), tr.get_ydata()
            num.savetxt(fn, num.transpose((x, y)))
            fns.append(fn)
    elif format == 'yaff':
        return yaff.METHOD_NAME(traces, filename_template, additional)
    else:
        raise UnsupportedFormat(format)