original_docstring: filter/prune states and y features 
          
             Args:
                 activated_states: dictionary containing possible active states/y features
                                  it has the form {patt_len:{patt_1, patt_2, ...}}
                 accum_active_states: dictionary of only possible active states by position
                                      it has the form {pos_1:{state_1, state_2, ...}}
                 boundary: tuple (u,v) representing the current boundary in the sequence
          
docstring: filter/prune states and y features
docstring_tokens: filter / prune states and y features
code: def filter_activated_states(self, activated_states, accum_active_states, boundary):
          """filter/prune states and y features 
          
             Args:
                 activated_states: dictionary containing possible active states/y features
                                  it has the form {patt_len:{patt_1, patt_2, ...}}
                 accum_active_states: dictionary of only possible active states by position
                                      it has the form {pos_1:{state_1, state_2, ...}}
                 boundary: tuple (u,v) representing the current boundary in the sequence
          """
  
          Z_elems = self.Z_elems
          filtered_activestates = {}
          __, pos = boundary
  
          for z_len in activated_states:
              if z_len == 1:
                  continue
              start_pos = pos - z_len + 1
              if (start_pos, start_pos) in accum_active_states:
                  filtered_activestates[z_len] = set()
                  for z_patt in activated_states[z_len]:
                      check = True
                      zelems = Z_elems[z_patt]
                      for i in range(z_len):
                          pos_bound = (start_pos + i, start_pos + i)
                          if pos_bound not in accum_active_states:
                              check = False
                              break
                          if zelems[i] not in accum_active_states[pos_bound]:
                              check = False
                              break
                      if check:
                          filtered_activestates[z_len].add(z_patt)
          return filtered_activestates
code_tokens: def filter_activated_states ( self , activated_states , accum_active_states , boundary ) : Z_elems = self . Z_elems filtered_activestates = { } __ , pos = boundary for z_len in activated_states : if z_len == 1 : continue start_pos = pos - z_len + 1 if ( start_pos , start_pos ) in accum_active_states : filtered_activestates [ z_len ] = set ( ) for z_patt in activated_states [ z_len ] : check = True zelems = Z_elems [ z_patt ] for i in range ( z_len ) : pos_bound = ( start_pos + i , start_pos + i ) if pos_bound not in accum_active_states : check = False break if zelems [ i ] not in accum_active_states [ pos_bound ] : check = False break if check : filtered_activestates [ z_len ] . add ( z_patt ) return filtered_activestates
short_docstring: filter/prune states and y features
short_docstring_tokens: filter / prune states and y features
comment: """filter/prune states and y features 
          
             Args:
                 activated_states: dictionary containing possible active states/y features
                                  it has the form {patt_len:{patt_1, patt_2, ...}}
                 accum_active_states: dictionary of only possible active states by position
                                      it has the form {pos_1:{state_1, state_2, ...}}
                 boundary: tuple (u,v) representing the current boundary in the sequence
          """