original_string: protected function get_service() {
          global $CFG;
  
          if (!$apikey = get_config('block_tag_youtube', 'apikey')) {
              return false;
          }
  
          // Wrapped in an if in case we call different get_videos_* multiple times.
          if (!isset($this->service)) {
              require_once($CFG->libdir . '/google/lib.php');
              $client = get_google_client();
              $client->setDeveloperKey($apikey);
              $client->setScopes(array(Google_Service_YouTube::YOUTUBE_READONLY));
              $this->service = new Google_Service_YouTube($client);
          }
  
          return $this->service;
      }
code: protected function get_service() {
          global $CFG;
  
          if (!$apikey = get_config('block_tag_youtube', 'apikey')) {
              return false;
          }
  
          // Wrapped in an if in case we call different get_videos_* multiple times.
          if (!isset($this->service)) {
              require_once($CFG->libdir . '/google/lib.php');
              $client = get_google_client();
              $client->setDeveloperKey($apikey);
              $client->setScopes(array(Google_Service_YouTube::YOUTUBE_READONLY));
              $this->service = new Google_Service_YouTube($client);
          }
  
          return $this->service;
      }
code_tokens: protected function get_service ( ) { global $ CFG ; if ( ! $ apikey = get_config ( 'block_tag_youtube' , 'apikey' ) ) { return false ; } // Wrapped in an if in case we call different get_videos_* multiple times. if ( ! isset ( $ this -> service ) ) { require_once ( $ CFG -> libdir . '/google/lib.php' ) ; $ client = get_google_client ( ) ; $ client -> setDeveloperKey ( $ apikey ) ; $ client -> setScopes ( array ( Google_Service_YouTube :: YOUTUBE_READONLY ) ) ; $ this -> service = new Google_Service_YouTube ( $ client ) ; } return $ this -> service ; }
docstring: Gets the youtube service object.
  
  @return Google_Service_YouTube
docstring_tokens: Gets the youtube service object .