original_string: private function get_time_duration_from_form_data(\stdClass $data) {
          if ($data->duration == 1) {
              return $data->timedurationuntil - $data->timestart;
          } else if ($data->duration == 2) {
              return $data->timedurationminutes * MINSECS;
          } else {
              return 0;
          }
      }
code: private function get_time_duration_from_form_data(\stdClass $data) {
          if ($data->duration == 1) {
              return $data->timedurationuntil - $data->timestart;
          } else if ($data->duration == 2) {
              return $data->timedurationminutes * MINSECS;
          } else {
              return 0;
          }
      }
code_tokens: private function get_time_duration_from_form_data ( \ stdClass $ data ) { if ( $ data -> duration == 1 ) { return $ data -> timedurationuntil - $ data -> timestart ; } else if ( $ data -> duration == 2 ) { return $ data -> timedurationminutes * MINSECS ; } else { return 0 ; } }
docstring: A helper function to calculate the time duration for an event based on
  the event_form data.
  
  @param \stdClass $data event_form data
  @return int
docstring_tokens: A helper function to calculate the time duration for an event based on the event_form data .