original_string: public function get_users_in_context(\context $context) : \core_privacy\local\request\userlist_collection {
          $progress = static::get_log_tracer();
  
          $components = $this->get_component_list();
          $a = (object) [
              'total' => count($components),
              'progress' => 0,
              'component' => '',
              'datetime' => userdate(time()),
          ];
          $collection = new \core_privacy\local\request\userlist_collection($context);
  
          $progress->output(get_string('trace:fetchcomponents', 'core_privacy', $a), 1);
          foreach ($components as $component) {
              $a->component = $component;
              $a->progress++;
              $a->datetime = userdate(time());
              $progress->output(get_string('trace:preprocessingcomponent', 'core_privacy', $a), 2);
              $userlist = new local\request\userlist($context, $component);
  
              $this->handled_component_class_callback($component, core_userlist_provider::class, 'get_users_in_context', [$userlist]);
  
              // Add contexts that the component may not know about.
              \core_privacy\local\request\helper::add_shared_users_to_userlist($userlist);
  
              if (count($userlist)) {
                  $collection->add_userlist($userlist);
              }
          }
          $progress->output(get_string('trace:done', 'core_privacy'), 1);
  
          return $collection;
      }
code: public function get_users_in_context(\context $context) : \core_privacy\local\request\userlist_collection {
          $progress = static::get_log_tracer();
  
          $components = $this->get_component_list();
          $a = (object) [
              'total' => count($components),
              'progress' => 0,
              'component' => '',
              'datetime' => userdate(time()),
          ];
          $collection = new \core_privacy\local\request\userlist_collection($context);
  
          $progress->output(get_string('trace:fetchcomponents', 'core_privacy', $a), 1);
          foreach ($components as $component) {
              $a->component = $component;
              $a->progress++;
              $a->datetime = userdate(time());
              $progress->output(get_string('trace:preprocessingcomponent', 'core_privacy', $a), 2);
              $userlist = new local\request\userlist($context, $component);
  
              $this->handled_component_class_callback($component, core_userlist_provider::class, 'get_users_in_context', [$userlist]);
  
              // Add contexts that the component may not know about.
              \core_privacy\local\request\helper::add_shared_users_to_userlist($userlist);
  
              if (count($userlist)) {
                  $collection->add_userlist($userlist);
              }
          }
          $progress->output(get_string('trace:done', 'core_privacy'), 1);
  
          return $collection;
      }
code_tokens: public function get_users_in_context ( \ context $ context ) : \ core_privacy \ local \ request \ userlist_collection { $ progress = static :: get_log_tracer ( ) ; $ components = $ this -> get_component_list ( ) ; $ a = ( object ) [ 'total' => count ( $ components ) , 'progress' => 0 , 'component' => '' , 'datetime' => userdate ( time ( ) ) , ] ; $ collection = new \ core_privacy \ local \ request \ userlist_collection ( $ context ) ; $ progress -> output ( get_string ( 'trace:fetchcomponents' , 'core_privacy' , $ a ) , 1 ) ; foreach ( $ components as $ component ) { $ a -> component = $ component ; $ a -> progress ++ ; $ a -> datetime = userdate ( time ( ) ) ; $ progress -> output ( get_string ( 'trace:preprocessingcomponent' , 'core_privacy' , $ a ) , 2 ) ; $ userlist = new local \ request \ userlist ( $ context , $ component ) ; $ this -> handled_component_class_callback ( $ component , core_userlist_provider :: class , 'get_users_in_context' , [ $ userlist ] ) ; // Add contexts that the component may not know about. \ core_privacy \ local \ request \ helper :: add_shared_users_to_userlist ( $ userlist ) ; if ( count ( $ userlist ) ) { $ collection -> add_userlist ( $ userlist ) ; } } $ progress -> output ( get_string ( 'trace:done' , 'core_privacy' ) , 1 ) ; return $ collection ; }
docstring: Gets a collection of users for all components in the specified context.
  
  @param   \context    $context The context to search
  @return  userlist_collection the collection of userlist items for the respective components.
docstring_tokens: Gets a collection of users for all components in the specified context .