original_string: public static function list_user_plans($userid) {
          global $PAGE;
          $params = self::validate_parameters(self::list_user_plans_parameters(), array(
              'userid' => $userid
          ));
  
          $context = context_user::instance($params['userid']);
          self::validate_context($context);
          $output = $PAGE->get_renderer('core');
  
          $response = array();
          $plans = api::list_user_plans($params['userid']);
          foreach ($plans as $plan) {
              $exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
              $response[] = $exporter->export($output);
          }
  
          return $response;
      }
code: public static function list_user_plans($userid) {
          global $PAGE;
          $params = self::validate_parameters(self::list_user_plans_parameters(), array(
              'userid' => $userid
          ));
  
          $context = context_user::instance($params['userid']);
          self::validate_context($context);
          $output = $PAGE->get_renderer('core');
  
          $response = array();
          $plans = api::list_user_plans($params['userid']);
          foreach ($plans as $plan) {
              $exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
              $response[] = $exporter->export($output);
          }
  
          return $response;
      }
code_tokens: public static function list_user_plans ( $ userid ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: list_user_plans_parameters ( ) , array ( 'userid' => $ userid ) ) ; $ context = context_user :: instance ( $ params [ 'userid' ] ) ; self :: validate_context ( $ context ) ; $ output = $ PAGE -> get_renderer ( 'core' ) ; $ response = array ( ) ; $ plans = api :: list_user_plans ( $ params [ 'userid' ] ) ; foreach ( $ plans as $ plan ) { $ exporter = new plan_exporter ( $ plan , array ( 'template' => $ plan -> get_template ( ) ) ) ; $ response [ ] = $ exporter -> export ( $ output ) ; } return $ response ; }
docstring: External function list_user_plans.
  
  @param int $userid The user ID.
  @return boolean
docstring_tokens: External function list_user_plans .