original_docstring: Get indices of different stages of proposals in train mode.
  
          It will calculate the average interval for each segment,
          and randomly shift them within offsets between [0, average_duration].
          If the total number of frames is smaller than num segments, it will
          return all zero indices.
  
          Args:
              valid_length (int): The length of the starting point's
                  valid interval.
              num_segments (int): Total number of segments.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          
docstring: Get indices of different stages of proposals in train mode.
  It will calculate the average interval for each segment,
  and randomly shift them within offsets between [0, average_duration].
  If the total number of frames is smaller than num segments, it will
  return all zero indices.
docstring_tokens: Get indices of different stages of proposals in train mode . It will calculate the average interval for each segment and randomly shift them within offsets between [ 0 average_duration ] . If the total number of frames is smaller than num segments it will return all zero indices .
code: def _get_train_indices(self, valid_length, num_segments):
          """Get indices of different stages of proposals in train mode.
  
          It will calculate the average interval for each segment,
          and randomly shift them within offsets between [0, average_duration].
          If the total number of frames is smaller than num segments, it will
          return all zero indices.
  
          Args:
              valid_length (int): The length of the starting point's
                  valid interval.
              num_segments (int): Total number of segments.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """
          avg_interval = (valid_length + 1) // num_segments
          if avg_interval > 0:
              base_offsets = np.arange(num_segments) * avg_interval
              offsets = base_offsets + np.random.randint(
                  avg_interval, size=num_segments)
          else:
              offsets = np.zeros((num_segments, ), dtype=np.int)
  
          return offsets
code_tokens: def _get_train_indices ( self , valid_length , num_segments ) : avg_interval = ( valid_length + 1 ) // num_segments if avg_interval > 0 : base_offsets = np . arange ( num_segments ) * avg_interval offsets = base_offsets + np . random . randint ( avg_interval , size = num_segments ) else : offsets = np . zeros ( ( num_segments , ) , dtype = np . int ) return offsets
short_docstring: Get indices of different stages of proposals in train mode.
short_docstring_tokens: Get indices of different stages of proposals in train mode .
comment: """Get indices of different stages of proposals in train mode.
  
          It will calculate the average interval for each segment,
          and randomly shift them within offsets between [0, average_duration].
          If the total number of frames is smaller than num segments, it will
          return all zero indices.
  
          Args:
              valid_length (int): The length of the starting point's
                  valid interval.
              num_segments (int): Total number of segments.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """