nodes: 0, module; 1, function_definition; 2, function_name:get_utt_regions; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""
          Return the regions of all utterances, assuming all utterances are concatenated.
          It is assumed that the utterances are sorted in ascending order for concatenation.
  
          A region is defined by offset (in chunks), length (num-chunks) and
          a list of references to the utterance datasets in the containers.
  
          Returns:
              list: List of with a tuple for every utterances containing the region info.
          """; 12, assignment; 13, assignment; 14, identifier:utt_idx; 15, call; 16, block; 17, identifier:regions; 18, identifier:regions; 19, list; 20, identifier:current_offset; 21, integer:0; 22, identifier:sorted; 23, argument_list; 24, expression_statement; 25, expression_statement; 26, expression_statement; 27, for_statement; 28, if_statement; 29, expression_statement; 30, expression_statement; 31, expression_statement; 32, comment:# Sets the offset for the next utterances; 33, expression_statement; 34, attribute; 35, assignment; 36, assignment; 37, assignment; 38, identifier:cnt; 39, attribute; 40, block; 41, comparison_operator:len(set(num_frames)) != 1; 42, block; 43, assignment; 44, assignment; 45, call; 46, augmented_assignment; 47, identifier:self; 48, identifier:utt_ids; 49, identifier:offset; 50, identifier:current_offset; 51, identifier:num_frames; 52, list; 53, identifier:refs; 54, list; 55, identifier:self; 56, identifier:containers; 57, expression_statement; 58, expression_statement; 59, call; 60, integer:1; 61, raise_statement; 62, identifier:num_chunks; 63, call; 64, identifier:region; 65, tuple; 66, attribute; 67, argument_list; 68, identifier:current_offset; 69, identifier:num_chunks; 70, call; 71, call; 72, identifier:len; 73, argument_list; 74, call; 75, attribute; 76, argument_list; 77, identifier:offset; 78, identifier:num_chunks; 79, identifier:refs; 80, identifier:regions; 81, identifier:append; 82, identifier:region; 83, attribute; 84, argument_list; 85, attribute; 86, argument_list; 87, call; 88, identifier:ValueError; 89, argument_list; 90, identifier:math; 91, identifier:ceil; 92, binary_operator:num_frames[0] / float(self.frames_per_chunk); 93, identifier:num_frames; 94, identifier:append; 95, subscript; 96, identifier:refs; 97, identifier:append; 98, call; 99, identifier:set; 100, argument_list; 101, call; 102, subscript; 103, call; 104, attribute; 105, integer:0; 106, attribute; 107, argument_list; 108, identifier:num_frames; 109, attribute; 110, argument_list; 111, identifier:num_frames; 112, integer:0; 113, identifier:float; 114, argument_list; 115, call; 116, identifier:shape; 117, identifier:cnt; 118, identifier:get; 119, identifier:utt_idx; 120, keyword_argument; 121, string; 122, identifier:format; 123, identifier:utt_idx; 124, attribute; 125, attribute; 126, argument_list; 127, identifier:mem_map; 128, True; 129, string_content:Utterance {} has not the same number of frames in all containers!; 130, identifier:self; 131, identifier:frames_per_chunk; 132, identifier:cnt; 133, identifier:get; 134, identifier:utt_idx
code: def get_utt_regions(self):
          """
          Return the regions of all utterances, assuming all utterances are concatenated.
          It is assumed that the utterances are sorted in ascending order for concatenation.
  
          A region is defined by offset (in chunks), length (num-chunks) and
          a list of references to the utterance datasets in the containers.
  
          Returns:
              list: List of with a tuple for every utterances containing the region info.
          """
  
          regions = []
          current_offset = 0
  
          for utt_idx in sorted(self.utt_ids):
              offset = current_offset
  
              num_frames = []
              refs = []
  
              for cnt in self.containers:
                  num_frames.append(cnt.get(utt_idx).shape[0])
                  refs.append(cnt.get(utt_idx, mem_map=True))
  
              if len(set(num_frames)) != 1:
                  raise ValueError('Utterance {} has not the same number of frames in all containers!'.format(utt_idx))
  
              num_chunks = math.ceil(num_frames[0] / float(self.frames_per_chunk))
  
              region = (offset, num_chunks, refs)
              regions.append(region)
  
              # Sets the offset for the next utterances
              current_offset += num_chunks
  
          return regions