def users_in_media(user_ids, media):
    """Return a list of those media where a user is in the photo"""
    if type(user_ids) is not list: user_ids = [user_ids]
    return [m for m in media if any(
                    user_id in [u.user.id for u in m.users_in_photo]
                    for user_id in user_ids)]