def concatenate(items):
    items = list(items)
    if len(items) > 1:
        return ', '.join(items[:-1]) + ' and ' + items[-1]
    elif items:
        return items[0]
    else:
        return ''
Concatenate a list of items in a human friendly way.
dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py/concatenate