Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
foxdict = defaultdict(lambda: 0)
for cluster_id in sorted(clusters):
face_ids = clusters[cluster_id]
show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
for face_id_obj in show_name:
show = face_id_obj["frame__video__show__canonical_show__name"]
if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
cnndict[show] += 1
elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
msnbcdict[show] += 1
else:
foxdict[show] += 1
raw_bar_chart['CNN']=cnndict
raw_bar_chart['MSNBC']=msnbcdict
raw_bar_chart['FOXNEWS']=foxdict
plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')
for cluster_id in sorted(clusters):
face_ids = clusters[cluster_id]
show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
for face_id_obj in show_name:
show = face_id_obj["frame__video__show__canonical_show__name"]
if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
cnndict[show] += 1
elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
msnbcdict[show] += 1
else:
foxdict[show] += 1
raw_bar_chart['CNN']=cnndict
raw_bar_chart['MSNBC']=msnbcdict
raw_bar_chart['FOXNEWS']=foxdict
plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')
face_ids = clusters[cluster_id]
show_name = Face.objects.filter(id__in=face_ids).values("id", "frame__video__show__canonical_show__name")
for face_id_obj in show_name:
show = face_id_obj["frame__video__show__canonical_show__name"]
if face_id_to_info[face_id_obj["id"]]['channel'] == 'CNN':
cnndict[show] += 1
elif face_id_to_info[face_id_obj["id"]]['channel'] == 'MSNBC':
msnbcdict[show] += 1
else:
foxdict[show] += 1
raw_bar_chart['CNN']=cnndict
raw_bar_chart['MSNBC']=msnbcdict
raw_bar_chart['FOXNEWS']=foxdict
plot_stacked_bar_chart(raw_bar_chart['CNN'], 'CNN')
plot_stacked_bar_chart(raw_bar_chart['MSNBC'], 'MSNBC')
plot_stacked_bar_chart(raw_bar_chart['FOXNEWS'], 'FOXNEWS')