original_docstring: Get clip offsets in train mode.
  
          It will calculate the average interval for selected frames,
          and randomly shift them within offsets between [0, avg_interval].
          If the total number of frames is smaller than clips num or origin
          frames length, it will return all zero indices.
  
          Args:
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          
docstring: Get clip offsets in train mode.
  It will calculate the average interval for selected frames,
  and randomly shift them within offsets between [0, avg_interval].
  If the total number of frames is smaller than clips num or origin
  frames length, it will return all zero indices.
docstring_tokens: Get clip offsets in train mode . It will calculate the average interval for selected frames and randomly shift them within offsets between [ 0 avg_interval ] . If the total number of frames is smaller than clips num or origin frames length it will return all zero indices .
code: def _get_train_clips(self, num_frames):
          """Get clip offsets in train mode.
  
          It will calculate the average interval for selected frames,
          and randomly shift them within offsets between [0, avg_interval].
          If the total number of frames is smaller than clips num or origin
          frames length, it will return all zero indices.
  
          Args:
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """
          ori_clip_len = self.clip_len * self.frame_interval
          avg_interval = (num_frames - ori_clip_len + 1) // self.num_clips
  
          if avg_interval > 0:
              base_offsets = np.arange(self.num_clips) * avg_interval
              clip_offsets = base_offsets + np.random.randint(
                  avg_interval, size=self.num_clips)
          elif num_frames > max(self.num_clips, ori_clip_len):
              clip_offsets = np.sort(
                  np.random.randint(
                      num_frames - ori_clip_len + 1, size=self.num_clips))
          elif avg_interval == 0:
              ratio = (num_frames - ori_clip_len + 1.0) / self.num_clips
              clip_offsets = np.around(np.arange(self.num_clips) * ratio)
          else:
              clip_offsets = np.zeros((self.num_clips, ), dtype=np.int)
  
          return clip_offsets
code_tokens: def _get_train_clips ( self , num_frames ) : ori_clip_len = self . clip_len * self . frame_interval avg_interval = ( num_frames - ori_clip_len + 1 ) // self . num_clips if avg_interval > 0 : base_offsets = np . arange ( self . num_clips ) * avg_interval clip_offsets = base_offsets + np . random . randint ( avg_interval , size = self . num_clips ) elif num_frames > max ( self . num_clips , ori_clip_len ) : clip_offsets = np . sort ( np . random . randint ( num_frames - ori_clip_len + 1 , size = self . num_clips ) ) elif avg_interval == 0 : ratio = ( num_frames - ori_clip_len + 1.0 ) / self . num_clips clip_offsets = np . around ( np . arange ( self . num_clips ) * ratio ) else : clip_offsets = np . zeros ( ( self . num_clips , ) , dtype = np . int ) return clip_offsets
short_docstring: Get clip offsets in train mode.
short_docstring_tokens: Get clip offsets in train mode .
comment: """Get clip offsets in train mode.
  
          It will calculate the average interval for selected frames,
          and randomly shift them within offsets between [0, avg_interval].
          If the total number of frames is smaller than clips num or origin
          frames length, it will return all zero indices.
  
          Args:
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """