original_string: public function is_override_calendar_event(\calendar_event $event) {
          global $DB;
  
          if (!isset($event->modulename)) {
              return false;
          }
  
          if ($event->modulename != 'assign') {
              return false;
          }
  
          if (!isset($event->instance)) {
              return false;
          }
  
          if (!isset($event->userid) && !isset($event->groupid)) {
              return false;
          }
  
          $overrideparams = [
              'assignid' => $event->instance
          ];
  
          if (isset($event->groupid)) {
              $overrideparams['groupid'] = $event->groupid;
          } else if (isset($event->userid)) {
              $overrideparams['userid'] = $event->userid;
          }
  
          if ($DB->get_record('assign_overrides', $overrideparams)) {
              return true;
          } else {
              return false;
          }
      }
code: public function is_override_calendar_event(\calendar_event $event) {
          global $DB;
  
          if (!isset($event->modulename)) {
              return false;
          }
  
          if ($event->modulename != 'assign') {
              return false;
          }
  
          if (!isset($event->instance)) {
              return false;
          }
  
          if (!isset($event->userid) && !isset($event->groupid)) {
              return false;
          }
  
          $overrideparams = [
              'assignid' => $event->instance
          ];
  
          if (isset($event->groupid)) {
              $overrideparams['groupid'] = $event->groupid;
          } else if (isset($event->userid)) {
              $overrideparams['userid'] = $event->userid;
          }
  
          if ($DB->get_record('assign_overrides', $overrideparams)) {
              return true;
          } else {
              return false;
          }
      }
code_tokens: public function is_override_calendar_event ( \ calendar_event $ event ) { global $ DB ; if ( ! isset ( $ event -> modulename ) ) { return false ; } if ( $ event -> modulename != 'assign' ) { return false ; } if ( ! isset ( $ event -> instance ) ) { return false ; } if ( ! isset ( $ event -> userid ) && ! isset ( $ event -> groupid ) ) { return false ; } $ overrideparams = [ 'assignid' => $ event -> instance ] ; if ( isset ( $ event -> groupid ) ) { $ overrideparams [ 'groupid' ] = $ event -> groupid ; } else if ( isset ( $ event -> userid ) ) { $ overrideparams [ 'userid' ] = $ event -> userid ; } if ( $ DB -> get_record ( 'assign_overrides' , $ overrideparams ) ) { return true ; } else { return false ; } }
docstring: Check if the given calendar_event is either a user or group override
  event.
  
  @return bool
docstring_tokens: Check if the given calendar_event is either a user or group override event .