def reassemble_addresses(seq):
    """Takes a sequence of strings and combines any sub-sequence that looks
    like an IPv4 address into a single string.

    Example:
        ['listener', '0', '0', '0', '0_80', downstream_cx_total'] ->
        ['listener', '0.0.0.0:80', 'downstream_cx_total']
    """
    reassembled = []
    prev = ''

    for s in seq:
        if prev.isdigit():
            try:
                end, port = s.split('_')
            except ValueError:
                end, port = '', ''

            if s.isdigit():
                reassembled[-1] += '.{}'.format(s)
            elif end.isdigit() and port.isdigit():
                reassembled[-1] += '.{}:{}'.format(end, port)
            else:
                reassembled.append(s)
        else:
            reassembled.append(s)

        prev = s

    return reassembled