<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def concat(*streams, **kwargs):
 """Concatenate audio and video streams, joining them together one after the other. The filter works on segments of synchronized video and audio streams. All segments must have the same number of streams of each type, and that will also be the number of streams at output. Args: unsafe: Activate unsafe mode: do not fail if segments have a different format. Related streams do not always have exactly the same duration, for various reasons including codec frame size or sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the last one), and if necessary pad shorter audio streams with silence. For this filter to work correctly, all segments must start at timestamp 0. All corresponding streams must have the same parameters in all segments; the filtering system will automatically select a common pixel format for video streams, and a common sample format, sample rate and channel layout for audio streams, but other settings, such as resolution, must be converted explicitly by the user. Different frame rates are acceptable but will result in variable frame rate at output; be sure to configure the output file to handle it. Official documentation: `concat <https://ffmpeg.org/ffmpeg-filters.html#concat>`__ """

    video_stream_count = kwargs.get('v', 1)
    audio_stream_count = kwargs.get('a', 0)
    stream_count = video_stream_count + audio_stream_count
    if len(streams) % stream_count != 0:
        raise ValueError(
            'Expected concat input streams to have length multiple of {} (v={}, a={}); got {}'
                .format(stream_count, video_stream_count, audio_stream_count, len(streams)))
    kwargs['n'] = int(len(streams) / stream_count)
    return FilterNode(streams, concat.__name__, kwargs=kwargs, max_inputs=None).stream()