In my Python application, I have the following lines:
for index, codec in enumerate(codecs):
for audio in filter(lambda x: x['hls']['codec_name'] == codec, job['audio']):
audio['hls']['group_id'].append(index)
How can I only trigger the append statement if the index hasn't been already appended previously?