def pairs_from_list(lights):
    """Generate a list of pairs to enable from-each-end lighting."""
    length = len(lights)
    half = int(length / 2)
    offset = 0

    centre = None
    if length % 2 == 1:
        centre = lights[half]
        offset = 1

    left = lights[:half]

    rh_start = half + offset
    right = reversed(lights[rh_start:])

    pairs = list(map(list, zip(left, right)))

    if centre:
        pairs.append([centre])

    return pairs