original_string: public function remove()
      {
          if($moduleEvents = $this->module->events())
          {
              $systemEvents = $this->load();
              if (isset($moduleEvents['listen']))
                  // for listen event we must check if exists merge if not add it
                  foreach ($moduleEvents['listen'] as $event => $listens)
                  {
                      if (isset($systemEvents['listen'][$event]))
                      {
                          foreach ($listens as $listen)
                          {
                              $key = array_search($listen, $systemEvents['listen'][$event]);
                              if ($key !== false)
                                  unset($listen, $systemEvents['listen'][$event][$key]);
                          }
                      }
                  }
              // for subscribe
              if (isset($moduleEvents['subscribe']))
              {
                  $key = array_search($moduleEvents['subscribe'], $systemEvents['subscribe'][$event]);
                  if($key !==false)
                      unset($systemEvents['subscribe'][$key]);
              }
              return $this->set($systemEvents);
          }
          return true;
      }
code: public function remove()
      {
          if($moduleEvents = $this->module->events())
          {
              $systemEvents = $this->load();
              if (isset($moduleEvents['listen']))
                  // for listen event we must check if exists merge if not add it
                  foreach ($moduleEvents['listen'] as $event => $listens)
                  {
                      if (isset($systemEvents['listen'][$event]))
                      {
                          foreach ($listens as $listen)
                          {
                              $key = array_search($listen, $systemEvents['listen'][$event]);
                              if ($key !== false)
                                  unset($listen, $systemEvents['listen'][$event][$key]);
                          }
                      }
                  }
              // for subscribe
              if (isset($moduleEvents['subscribe']))
              {
                  $key = array_search($moduleEvents['subscribe'], $systemEvents['subscribe'][$event]);
                  if($key !==false)
                      unset($systemEvents['subscribe'][$key]);
              }
              return $this->set($systemEvents);
          }
          return true;
      }
code_tokens: public function remove ( ) { if ( $ moduleEvents = $ this -> module -> events ( ) ) { $ systemEvents = $ this -> load ( ) ; if ( isset ( $ moduleEvents [ 'listen' ] ) ) // for listen event we must check if exists merge if not add it foreach ( $ moduleEvents [ 'listen' ] as $ event => $ listens ) { if ( isset ( $ systemEvents [ 'listen' ] [ $ event ] ) ) { foreach ( $ listens as $ listen ) { $ key = array_search ( $ listen , $ systemEvents [ 'listen' ] [ $ event ] ) ; if ( $ key !== false ) unset ( $ listen , $ systemEvents [ 'listen' ] [ $ event ] [ $ key ] ) ; } } } // for subscribe if ( isset ( $ moduleEvents [ 'subscribe' ] ) ) { $ key = array_search ( $ moduleEvents [ 'subscribe' ] , $ systemEvents [ 'subscribe' ] [ $ event ] ) ; if ( $ key !== false ) unset ( $ systemEvents [ 'subscribe' ] [ $ key ] ) ; } return $ this -> set ( $ systemEvents ) ; } return true ; }
docstring: remove events from system
docstring_tokens: remove events from system