def _zero_pad_gaps(tr, gaps, fill_gaps=True):
start_in, end_in = (tr.stats.starttime, tr.stats.endtime)<EOL>for gap in gaps:<EOL><INDENT>stream = Stream()<EOL>if gap['<STR_LIT>'] > tr.stats.starttime:<EOL><INDENT>stream += tr.slice(tr.stats.starttime, gap['<STR_LIT>']).copy()<EOL><DEDENT>if gap['<STR_LIT>'] < tr.stats.endtime:<EOL><INDENT>stream += tr.slice(gap['<STR_LIT>'], tr.stats.endtime).copy()<EOL><DEDENT>tr = stream.merge()[<NUM_LIT:0>]<EOL><DEDENT>if fill_gaps:<EOL><INDENT>tr = tr.split()<EOL>tr = tr.detrend()<EOL>tr = tr.merge(fill_value=<NUM_LIT:0>)[<NUM_LIT:0>]<EOL>if tr.stats.starttime != start_in:<EOL><INDENT>tr.data = np.concatenate(<EOL>[np.zeros(int(tr.stats.starttime - start_in)), tr.data])<EOL>tr.stats.starttime = start_in<EOL><DEDENT>if tr.stats.endtime != end_in:<EOL><INDENT>tr.data = np.concatenate(<EOL>[tr.data, np.zeros(int(end_in - tr.stats.endtime))])<EOL><DEDENT><DEDENT>return tr<EOL>
Replace padded parts of trace with zeros.

Will cut around gaps, detrend, then pad the gaps with zeros.

:type tr: :class:`osbpy.core.stream.Trace`
:param tr: A trace that has had the gaps padded
:param gaps: List of dict of start-time and end-time as UTCDateTime objects
:type gaps: list

:return: :class:`obspy.core.stream.Trace`