Returns the current user set by current context
192368
def user(self):
        
        return self.users.get(self.contexts[self.current_context].get("user", ""), {})
540726
def users(self):
        
        return sa.orm.relationship(
            "User",
            secondary="users_resources_permissions",
            passive_deletes=True,
            passive_updates=True,
        )
888553
def _get_current_userprofile():
    
    if current_user.is_anonymous:
        return AnonymousUserProfile()

    profile = g.get(
        'userprofile',
        UserProfile.get_by_userid(current_user.get_id()))

    if profile is None:
        profile = UserProfile(user_id=int(current_user.get_id()))
        g.userprofile = profile
    return profile
1001636
def get_user_tenants(user, group):
    """"""
    if user.is_active and user.is_authenticated():
        if user.is_superuser or is_group_manager(user, group.pk):
            return Tenant.objects.filter(group=group)
        else:
            return Tenant.objects.filter(group=group, tenantrole__user=user).distinct()
    else:
        return Tenant.objects.none()
618184
def current_access(self):
        
        return self.access_for(actor=current_auth.actor, anchors=current_auth.anchors)
1328014
def get_users(self, **kwargs):
        
        return GetUsers(settings=self.settings, **kwargs).call(**kwargs)
544468
def users(self):
        
        # We do here some lazy loading.
        if not self._users:
            self._users = UserManager(self)
        return self._users
835413
def __get_user(self):
        
        storage = object.__getattribute__(self, '_LazyUser__storage')
        user = getattr(self.__auth, 'get_user')()
        setattr(storage, self.__user_name, user)
        return user
686887
public User getCurrentUser() throws GitLabApiException {
        Response response = get(Response.Status.OK, null, "user");
        return (response.readEntity(User.class));
    }
17433
public void setCurrentUser( BackendlessUser user )
  {
    if( currentUser == null )
      currentUser = user;
    else
      currentUser.setProperties( user.getProperties() );
  }
1226065
def get_current_usersettings():
    
    USERSETTINGS_MODEL = get_usersettings_model()
    try:
        current_usersettings = USERSETTINGS_MODEL.objects.get_current()
    except USERSETTINGS_MODEL.DoesNotExist:
        current_usersettings = USERSETTINGS_MODEL.get_default()
    return current_usersettings
497809
def get_current_context():
    
    local_context = _local.get_local_context()

    if local_context.registry:
        return local_context.registry[-1]

    raise errors.NotInContextError('Not in a Context.')
936341
def get_specific_user():
    '''
    
    '''
    user = get_user()
    if salt.utils.platform.is_windows():
        if _win_current_user_is_admin():
            return 'sudo_{0}'.format(user)
    else:
        env_vars = ('SUDO_USER',)
        if user == 'root':
            for evar in env_vars:
                if evar in os.environ:
                    return 'sudo_{0}'.format(os.environ[evar])
    return user
67097
static function currentUser()
    {
        $user = self::instance();
        if ( $user->isAnonymous() || $user->isEnabled() )
        {
            return $user;
        }
        self::logoutCurrent();
        return self::instance();
    }
433162
public function user()
	{
		if ($this->loggedOut)
		{
			return null;
		}

		if (!is_null($this->user))
		{
			return $this->user;
		}

		return $this->user = wp_get_current_user();
	}
689445
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;
    }
1194029
def current_user
      if (user_id = session[:user_id])
        @current_user ||= User.find_by(id: user_id)
      elsif (user_id = cookies.signed[:user_id])
        user = User.find_by(id: user_id)
        if user && user.authenticated?(cookies[:remember_token])
          log_in user
          @current_user = user
        end
      end
    end