<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mv_videos(path):
 """ move videos in sub-directory of path to path. """

    count = 0
    for f in os.listdir(path):
        f = os.path.join(path, f)
        if os.path.isdir(f):
            for sf in os.listdir(f):
                sf = os.path.join(f, sf)
                if os.path.isfile(sf):
                    new_name = os.path.join(path, os.path.basename(sf))
                    try:
                        os.rename(sf, new_name)
                    except (WindowsError, OSError) as e:
                        print('mv {} happens error: {}'.format(sf, e))
                    else:
                        count += 1
                        print('mv {} to {}'.format(sf, new_name))
    return count