original_string: public function find_plugin($component, $reqversion=ANY_VERSION, $branch=null) {
          global $CFG;
  
          $params = array(
              'plugin' => $component,
              'format' => 'json',
          );
  
          if ($reqversion === ANY_VERSION) {
              $params['minversion'] = 0;
          } else {
              $params['minversion'] = $reqversion;
          }
  
          if ($branch === null) {
              $branch = $CFG->branch;
          }
  
          $params['branch'] = $this->convert_branch_numbering_format($branch);
  
          return $this->call_pluginfo_service($params);
      }
code: public function find_plugin($component, $reqversion=ANY_VERSION, $branch=null) {
          global $CFG;
  
          $params = array(
              'plugin' => $component,
              'format' => 'json',
          );
  
          if ($reqversion === ANY_VERSION) {
              $params['minversion'] = 0;
          } else {
              $params['minversion'] = $reqversion;
          }
  
          if ($branch === null) {
              $branch = $CFG->branch;
          }
  
          $params['branch'] = $this->convert_branch_numbering_format($branch);
  
          return $this->call_pluginfo_service($params);
      }
code_tokens: public function find_plugin ( $ component , $ reqversion = ANY_VERSION , $ branch = null ) { global $ CFG ; $ params = array ( 'plugin' => $ component , 'format' => 'json' , ) ; if ( $ reqversion === ANY_VERSION ) { $ params [ 'minversion' ] = 0 ; } else { $ params [ 'minversion' ] = $ reqversion ; } if ( $ branch === null ) { $ branch = $ CFG -> branch ; } $ params [ 'branch' ] = $ this -> convert_branch_numbering_format ( $ branch ) ; return $ this -> call_pluginfo_service ( $ params ) ; }
docstring: Locate the given plugin in the plugin directory.
  
  Uses pluginfo.php end-point to find a plugin with the given component
  name, that suits best for the given Moodle core branch. Minimal required
  plugin version can be specified. This is typically used for resolving
  dependencies.
  
  False is returned on error, or if there is no plugin with such component
  name found in the plugins directory via the API.
  
  If a plugin with the given component name is found, data about the
  plugin are returned as an object. The ->version property of the object
  contains the information about the particular plugin version that
  matches best the given critera. The ->version property is false if no
  suitable version of the plugin was found (yet the plugin itself is
  known).
  
  @param string $component frankenstyle name of the plugin
  @param string|int $reqversion minimal required version of the plugin, defaults to ANY_VERSION
  @param int $branch moodle core branch such as 29, 30, 31 etc, defaults to $CFG->branch
  @return \core\update\remote_info|bool
docstring_tokens: Locate the given plugin in the plugin directory .