original_string: public static function can_import_skydrive_files() {
          global $DB;
  
          $skydrive = $DB->get_record('repository', ['type' => 'skydrive'], 'id', IGNORE_MISSING);
          $onedrive = $DB->get_record('repository', ['type' => 'onedrive'], 'id', IGNORE_MISSING);
  
          if (empty($skydrive) || empty($onedrive)) {
              return false;
          }
  
          $ready = true;
          try {
              $issuer = \core\oauth2\api::get_issuer(get_config('onedrive', 'issuerid'));
              if (!$issuer->get('enabled')) {
                  $ready = false;
              }
              if (!$issuer->is_configured()) {
                  $ready = false;
              }
          } catch (dml_missing_record_exception $e) {
              $ready = false;
          }
          if (!$ready) {
              return false;
          }
  
          $sql = "SELECT count('x')
                    FROM {repository_instances} i, {repository} r
                   WHERE r.type=:plugin AND r.id=i.typeid";
          $params = array('plugin' => 'skydrive');
          return $DB->count_records_sql($sql, $params) > 0;
      }
code: public static function can_import_skydrive_files() {
          global $DB;
  
          $skydrive = $DB->get_record('repository', ['type' => 'skydrive'], 'id', IGNORE_MISSING);
          $onedrive = $DB->get_record('repository', ['type' => 'onedrive'], 'id', IGNORE_MISSING);
  
          if (empty($skydrive) || empty($onedrive)) {
              return false;
          }
  
          $ready = true;
          try {
              $issuer = \core\oauth2\api::get_issuer(get_config('onedrive', 'issuerid'));
              if (!$issuer->get('enabled')) {
                  $ready = false;
              }
              if (!$issuer->is_configured()) {
                  $ready = false;
              }
          } catch (dml_missing_record_exception $e) {
              $ready = false;
          }
          if (!$ready) {
              return false;
          }
  
          $sql = "SELECT count('x')
                    FROM {repository_instances} i, {repository} r
                   WHERE r.type=:plugin AND r.id=i.typeid";
          $params = array('plugin' => 'skydrive');
          return $DB->count_records_sql($sql, $params) > 0;
      }
code_tokens: public static function can_import_skydrive_files ( ) { global $ DB ; $ skydrive = $ DB -> get_record ( 'repository' , [ 'type' => 'skydrive' ] , 'id' , IGNORE_MISSING ) ; $ onedrive = $ DB -> get_record ( 'repository' , [ 'type' => 'onedrive' ] , 'id' , IGNORE_MISSING ) ; if ( empty ( $ skydrive ) || empty ( $ onedrive ) ) { return false ; } $ ready = true ; try { $ issuer = \ core \ oauth2 \ api :: get_issuer ( get_config ( 'onedrive' , 'issuerid' ) ) ; if ( ! $ issuer -> get ( 'enabled' ) ) { $ ready = false ; } if ( ! $ issuer -> is_configured ( ) ) { $ ready = false ; } } catch ( dml_missing_record_exception $ e ) { $ ready = false ; } if ( ! $ ready ) { return false ; } $ sql = "SELECT count('x')
                    FROM {repository_instances} i, {repository} r
                   WHERE r.type=:plugin AND r.id=i.typeid" ; $ params = array ( 'plugin' => 'skydrive' ) ; return $ DB -> count_records_sql ( $ sql , $ params ) > 0 ; }
docstring: Return true if any instances of the skydrive repo exist - and we can import them.
  
  @return bool
docstring_tokens: Return true if any instances of the skydrive repo exist - and we can import them .