def METHOD_NAME(self, beg_or_end):
    if beg_or_end == "beg":
        idx = np.array(self.dict[self.beg_str])
    elif beg_or_end == "end":
        idx = np.array(self.dict[self.end_str])
    else:
        assert False, "Unsupport type %s in get_beg_end_flag_idx" \
                      % beg_or_end
    return idx