def add_video_from_post(form):
    try:
        name     = form.get('name', '').strip()
        url      = form.get('url', '').strip()
        duration = form.get('duration', '').strip()

        if len(name) < 1 or len(url) < 10 or len(duration) < 1 or \
                int(duration) <= 0:
            raise ValueError('Input validation failed')

        v = Video(name, url, duration)
        with video_lock:
            video_list.append(v)
    except __HOLE__:
        abort(400)
dataset/ETHPy150Open cn28h/mobilecloud-14-flask/week2/video/app.py/add_video_from_post