original_string: public function get_plugin_by_type($subtype, $type) {
          $shortsubtype = substr($subtype, strlen('assign'));
          $name = $shortsubtype . 'plugins';
          if ($name != 'feedbackplugins' && $name != 'submissionplugins') {
              return null;
          }
          $pluginlist = $this->$name;
          foreach ($pluginlist as $plugin) {
              if ($plugin->get_type() == $type) {
                  return $plugin;
              }
          }
          return null;
      }
code: public function get_plugin_by_type($subtype, $type) {
          $shortsubtype = substr($subtype, strlen('assign'));
          $name = $shortsubtype . 'plugins';
          if ($name != 'feedbackplugins' && $name != 'submissionplugins') {
              return null;
          }
          $pluginlist = $this->$name;
          foreach ($pluginlist as $plugin) {
              if ($plugin->get_type() == $type) {
                  return $plugin;
              }
          }
          return null;
      }
code_tokens: public function get_plugin_by_type ( $ subtype , $ type ) { $ shortsubtype = substr ( $ subtype , strlen ( 'assign' ) ) ; $ name = $ shortsubtype . 'plugins' ; if ( $ name != 'feedbackplugins' && $ name != 'submissionplugins' ) { return null ; } $ pluginlist = $ this -> $ name ; foreach ( $ pluginlist as $ plugin ) { if ( $ plugin -> get_type ( ) == $ type ) { return $ plugin ; } } return null ; }
docstring: Get a specific submission plugin by its type.
  
  @param string $subtype assignsubmission | assignfeedback
  @param string $type
  @return mixed assign_plugin|null
docstring_tokens: Get a specific submission plugin by its type .