Return the current presence state of ``user_id``.
328526
def get_userid_presence(self, user_id: str) -> UserPresence:
        
        return self._userid_to_presence.get(user_id, UserPresence.UNKNOWN)
1103742
def status(self, *ids):
		
		with self.lock:
			if len(ids) > 1:
				return [self._status[i] for i in ids]
			else:
				return self._status[ids[0]]
812570
def get_current_state_m(self):
        """"""
        page_id = self.view.notebook.get_current_page()
        if page_id == -1:
            return None
        page = self.view.notebook.get_nth_page(page_id)
        state_identifier = self.get_state_identifier_for_page(page)
        return self.tabs[state_identifier]['state_m']
399450
def get_user(self, user_id=None):
        
        if user_id:
            return self.get('/users/{0}/'.format(user_id))
        return self.get('/users/me/')
337584
def get_power_state(self, userid):
        """"""
        LOG.debug('Querying power stat of %s' % userid)
        requestData = "PowerVM " + userid + " status"
        action = "query power state of '%s'" % userid
        with zvmutils.log_and_reraise_smt_request_failed(action):
            results = self._request(requestData)
        with zvmutils.expect_invalid_resp_data(results):
            status = results['response'][0].partition(': ')[2]
        return status
321562
def get_user(self, user_id):
		""""""
		content = self._fetch("/user/%s" % user_id)
		return FastlyUser(self, content)
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
71630
def status(self):
        """"""
        try:
            # -- Check client
            res = self.run(['info'])
            if res[0]['clientName'] == '*unknown*':
                return ConnectionStatus.INVALID_CLIENT
            # -- Trigger an auth error if not logged in
            self.run(['user', '-o'])
        except errors.CommandError as err:
            if 'password (P4PASSWD) invalid or unset' in str(err.args[0]):
                return ConnectionStatus.NO_AUTH
            if 'Connect to server failed' in str(err.args[0]):
                return ConnectionStatus.OFFLINE

        return ConnectionStatus.OK
1045015
def get_user_by_id(self, uid):
        """"""
        self.logger.debug('User %s has been found in database', uid)
        return dict(uid=uid, password_hash='secret_hash')
816031
def get_user_id_by_user(self, username):
        '''  '''
        response, status_code = self.__pod__.Users.get_v2_user(
            sessionToken=self.__session__,
            username=username
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
1191861
def status(id):
    
    if id:
        data_source = get_data_object(id, use_data_config=False)
        print_data([data_source] if data_source else [])
    else:
        data_sources = DataClient().get_all()
        print_data(data_sources)
1046801
def users_view_user(self, ):
        
        i = self.users_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            self.view_user(user)
1227317
def load_logged_in_user():
    """"""
    user_id = session.get("user_id")
    g.user = User.query.get(user_id) if user_id is not None else None
267854
def _current_user_manager(self, session=None):
        """"""
        if session is None:
            session = db.session()

        try:
            user = g.user
        except Exception:
            return session.query(User).get(0)

        if sa.orm.object_session(user) is not session:
            # this can happen when called from a celery task during development
            # (with CELERY_ALWAYS_EAGER=True): the task SA session is not
            # app.db.session, and we should not attach this object to
            # the other session, because it can make weird, hard-to-debug
            # errors related to session.identity_map.
            return session.query(User).get(user.id)
        else:
            return user
153905
def get_user_info(self, request):
        """"""
        if not current_user.is_authenticated:
            return {}

        user_info = {
            'id': current_user.get_id(),
        }

        if 'SENTRY_USER_ATTRS' in current_app.config:
            for attr in current_app.config['SENTRY_USER_ATTRS']:
                if hasattr(current_user, attr):
                    user_info[attr] = getattr(current_user, attr)

        return user_info
276380
def get_current_user():
    """"""
    thread_local = AutomatedLoggingMiddleware.thread_local
    if hasattr(thread_local, 'current_user'):
        user = thread_local.current_user
        if isinstance(user, AnonymousUser):
            user = None
    else:
        user = None

    return user
411043
def check_user(self, user_id):
        

        if self.hidden == 'N':
            return True

        for owner in self.owners:
            if int(owner.user_id) == int(user_id):
                if owner.view == 'Y':
                    return True
        return False