code: def filter_inconsequential_acts(stmts_in, whitelist=None, **kwargs):
      if whitelist is None:
          whitelist = {}
      logger.info('Filtering %d statements to remove' % len(stmts_in) +
                  ' inconsequential activations...')
      states_used = whitelist
      for stmt in stmts_in:
          for agent in stmt.agent_list():
              if agent is not None:
                  if agent.activity:
                      act = agent.activity.activity_type
                      try:
                          states_used[agent.name].append(act)
                      except KeyError:
                          states_used[agent.name] = [act]
      for k, v in states_used.items():
          states_used[k] = list(set(v))
      stmts_out = []
      for stmt in stmts_in:
          skip = False
          if isinstance(stmt, RegulateActivity):
              used = states_used.get(stmt.obj.name, [])
              if stmt.obj_activity not in used:
                  skip = True
          if not skip:
              stmts_out.append(stmt)
      logger.info('%d statements after filter...' % len(stmts_out))
      dump_pkl = kwargs.get('save')
      if dump_pkl:
          dump_statements(stmts_out, dump_pkl)
      return stmts_out