def search(request, media_type):

    term = request.GET.get('q')
    if not term:
        url = reverse('gallery.gallery', args=[media_type])
        return HttpResponseRedirect(url)

    filter = Q(title__icontains=term) | Q(description__icontains=term)

    if media_type == 'image':
        media_qs = Image.objects.filter(filter, locale=request.LANGUAGE_CODE)
    elif media_type == 'video':
        media_qs = Video.objects.filter(filter, locale=request.LANGUAGE_CODE)
    else:
        raise Http404

    media = paginate(request, media_qs, per_page=ITEMS_PER_PAGE)

    return render(request, 'gallery/search.html', {
        'media': media,
        'media_type': media_type,
        'q': term})
A function with some random output.
dataset/ETHPy150Open mozilla/kitsune/kitsune/gallery/views.py/search--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/testing/plugin/dtexample.py/ranfunc