import random


def random_frames(video, target_num_frames):
    """
    From an input video clip it randomly selects and returns a specified number of frames in sorted order
    
    Parameters
    ----------
    video : array, required
        Array of multiple elements (frames)
    target_num_frames : int, required
        How many elements (frames) to randomly select and return
    
    Returns
    -------
    array
        Subsample of input array containing randomly selected elements (frames)
    """
    num_frames = video.shape[0]
    frames_idxs = random.sample(range(0, num_frames), target_num_frames)
    frames_idxs.sort()
    return video[frames_idxs]