def _get_media_info(media_id, media_type):
    media_format = None
    if media_type == 'image':
        media = get_object_or_404(Image, pk=media_id)
        try:
            media_format = imghdr.what(media.file.path)
        except UnicodeEncodeError:
            pass
    elif media_type == 'video':
        media = get_object_or_404(Video, pk=media_id)
    else:
        raise Http404
    return (media, media_format)
Provide a default controller.
dataset/ETHPy150Open mozilla/kitsune/kitsune/gallery/views.py/_get_media_info--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/wizard/wizard.py/Wizard._controller_default