<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _group_process(template_group, parallel, debug, cores, stream, daylong, ignore_length, overlap):
 """ Process data into chunks based on template processing length. Templates in template_group must all have the same processing parameters. :type template_group: list :param template_group: List of Templates. :type parallel: bool :param parallel: Whether to use parallel processing or not :type debug: int :param debug: Debug level from 0-5 :type cores: int :param cores: Number of cores to use, can be False to use all available. :type stream: :class:`obspy.core.stream.Stream` :param stream: Stream to process, will be left intact. :type daylong: bool :param daylong: Whether to enforce day-length files or not. :type ignore_length: bool :param ignore_length: If using daylong=True, then dayproc will try check that the data are there for at least 80% of the day, if you don't want this check (which will raise an error if too much data are missing) then set ignore_length=True. This is not recommended! :type overlap: float :param overlap: Number of seconds to overlap chunks by. :return: list of processed streams. """

    master = template_group[0]
    processed_streams = []
    kwargs = {
        'filt_order': master.filt_order,
        'highcut': master.highcut, 'lowcut': master.lowcut,
        'samp_rate': master.samp_rate, 'debug': debug,
        'parallel': parallel, 'num_cores': cores}
    # Processing always needs to be run to account for gaps - pre-process will
    # check whether filtering and resampling needs to be done.
    if daylong:
        if not master.process_length == 86400:
            warnings.warn(
                'Processing day-long data, but template was cut from %i s long'
                ' data, will reduce correlations' % master.process_length)
        func = dayproc
        kwargs.update({'ignore_length': ignore_length})
        # Check that data all start on the same day, otherwise strange
        # things will happen...
        starttimes = [tr.stats.starttime.date for tr in stream]
        if not len(list(set(starttimes))) == 1:
            warnings.warn('Data start on different days, setting to last day')
            starttime = UTCDateTime(
                stream.sort(['starttime'])[-1].stats.starttime.date)
        else:
            starttime = stream.sort(['starttime'])[0].stats.starttime
    else:
        # We want to use shortproc to allow overlaps
        func = shortproc
        starttime = stream.sort(['starttime'])[0].stats.starttime
    endtime = stream.sort(['endtime'])[-1].stats.endtime
    data_len_samps = round((endtime - starttime) * master.samp_rate) + 1
    chunk_len_samps = (master.process_length - overlap) * master.samp_rate
    n_chunks = int(data_len_samps / chunk_len_samps)
    if n_chunks == 0:
        print('Data must be process_length or longer, not computing')
    for i in range(n_chunks):
        kwargs.update(
            {'starttime': starttime + (i * (master.process_length - overlap))})
        if not daylong:
            kwargs.update(
                {'endtime': kwargs['starttime'] + master.process_length})
            chunk_stream = stream.slice(starttime=kwargs['starttime'],
                                        endtime=kwargs['endtime']).copy()
        else:
            chunk_stream = stream.copy()
        for tr in chunk_stream:
            tr.data = tr.data[0:int(
                master.process_length * tr.stats.sampling_rate)]
        processed_streams.append(func(st=chunk_stream, **kwargs))
    return processed_streams