original_string: public static function get_models_with_insights(\context $context) {
  
          self::check_can_list_insights($context);
  
          $models = self::get_all_models(true, true, $context);
          foreach ($models as $key => $model) {
              // Check that it not only have predictions but also generates insights from them.
              if (!$model->uses_insights()) {
                  unset($models[$key]);
              }
          }
          return $models;
      }
code: public static function get_models_with_insights(\context $context) {
  
          self::check_can_list_insights($context);
  
          $models = self::get_all_models(true, true, $context);
          foreach ($models as $key => $model) {
              // Check that it not only have predictions but also generates insights from them.
              if (!$model->uses_insights()) {
                  unset($models[$key]);
              }
          }
          return $models;
      }
code_tokens: public static function get_models_with_insights ( \ context $ context ) { self :: check_can_list_insights ( $ context ) ; $ models = self :: get_all_models ( true , true , $ context ) ; foreach ( $ models as $ key => $ model ) { // Check that it not only have predictions but also generates insights from them. if ( ! $ model -> uses_insights ( ) ) { unset ( $ models [ $ key ] ) ; } } return $ models ; }
docstring: Returns the models with insights at the provided context.
  
  @param \context $context
  @return \core_analytics\model[]
docstring_tokens: Returns the models with insights at the provided context .