ad58b661aaee955bf8dc8086d805d56485f8c53a,sounds/views.py,,sounds,#Any#,108
Before Change
latest_sounds = Sound.objects.latest_additions(num_sounds=5, period_days=2)
latest_packs = Pack.objects.select_related().filter(num_sounds__gt=0).exclude(is_deleted=True).order_by("-last_updated")[0:20]
last_week = get_n_weeks_back_datetime(n_weeks=1)
popular_sound_ids = [snd.id for snd in Sound.objects.filter(
Q(moderation_date__gte=last_week) | Q(created__gte=last_week)).order_by("-num_downloads")[0:5]]
popular_sounds = Sound.objects.ordered_ids(popular_sound_ids)
popular_packs = Pack.objects.filter(created__gte=last_week).exclude(is_deleted=True).order_by("-num_downloads")[0:5]
random_sound_id = get_sound_of_the_day_id()
if random_sound_id:
After Change
latest_sounds = Sound.objects.latest_additions(num_sounds=5, period_days=2)
latest_packs = Pack.objects.select_related().filter(num_sounds__gt=0).exclude(is_deleted=True).order_by("-last_updated")[0:20]
last_week = get_n_weeks_back_datetime(n_weeks=1)
popular_sounds = Sound.public.select_related("license", "user") \
.annotate(greatest_date=Greatest("created", "moderation_date")) \
.filter(greatest_date__gte=last_week).order_by("-num_downloads")[0:5]
popular_packs = Pack.objects.select_related("user").filter(created__gte=last_week).exclude(is_deleted=True).order_by("-num_downloads")[0:5]
random_sound_id = get_sound_of_the_day_id()
if random_sound_id:
random_sound = Sound.objects.bulk_query_id([random_sound_id])[0]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: MTG/freesound
Commit Name: ad58b661aaee955bf8dc8086d805d56485f8c53a
Time: 2019-07-24
Author: alastair.porter@upf.edu
File Name: sounds/views.py
Class Name:
Method Name: sounds
Project Name: pytorch/fairseq
Commit Name: bc936813485a3af8c3b46de470a2b46e0dc46f83
Time: 2020-04-06
Author: chenliu8@fb.com
File Name: fairseq/sequence_generator.py
Class Name: EnsembleModel
Method Name: __init__
Project Name: pytorch/fairseq
Commit Name: 1b749f4a34d0e4c70cb2f98b8cd32b71b9675fe9
Time: 2020-04-07
Author: chenliu8@fb.com
File Name: fairseq/sequence_generator.py
Class Name: EnsembleModel
Method Name: __init__