def sampling()

in data/video_sampler.py [0:0]


    def sampling(self, range_max, v_id, copy_id):
        assert range_max > 0, \
            ValueError("range_max = {}".format(range_max))
        num = self.num
        num_times = self.num_times
        interval = self.interval
        frame_range = (num - 1) * interval + 1
        # sampling clips
        if frame_range > range_max:
            return (list(range(0, range_max))*self.num)[0:self.num]
            # return [self.rng.choice(range(0, range_max))] * self.num
        if range_max-frame_range*num_times == 0:
            clips = [x*frame_range for x in range(0,num_times)]
        elif range_max-frame_range*num_times > 0:
            step_size = (range_max-frame_range*num_times)/float(num_times+1)+frame_range
            clips = [math.ceil(x*step_size-frame_range) for x in range(1, num_times+1)]
        else:
            step_size = (range_max-frame_range*num_times)/float(num_times-1)+frame_range
            clips = [int(x*step_size) for x in range(0, num_times)] 
        # pickup a clip
        cursor = copy_id % len(clips)
        # sampling within clip
        # logging.info("v_id: {}, cursor: {}, start: {}".format(v_id, cursor, clips[cursor]))
        idxs = range(clips[cursor], clips[cursor]+frame_range, interval)
        return idxs