Is the specified user the current user?
        :param some_user: RemoteUser user we want to check against the current user
        :return: boolean: True if the current user is the passed in user
545475
def _is_current_user(self, some_user):
        
        current_user = self.remote_store.get_current_user()
        return current_user.id == some_user.id
368975
def is_user(value, min=None, max=None):
    

    if type(value) == str:
        try:
            entry = pwd.getpwnam(value)
            value = entry.pw_uid
        except KeyError:
            err_message = ('{0}: No such user.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    elif type(value) == int:
        try:
            pwd.getpwuid(value)
        except KeyError:
            err_message = ('{0}: No such user.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    else:
        err_message = ('Please, use str or int to "user" parameter.')
        raise validate.VdtTypeError(err_message)
839188
def is_auth(self):
        
        if self.user_id is None:
            self.user_id = self.session.get('user_id')
        return bool(self.user_id)
601932
def get(self, user_name: str) -> User:
        
        user = current_user()
        if user.is_admin or user.name == user_name:
            return self._get_or_abort(user_name)
        else:
            abort(403)
831898
private static boolean hasSomeUser() {
        for (User u : User.getAll())
            if(u.getProperty(Details.class)!=null)
                return true;
        return false;
    }
824533
def is_following(self, user, instance, flag=''):
        
        if not user or user.is_anonymous:
            return False
        queryset = self.for_object(instance)

        if flag:
            queryset = queryset.filter(flag=flag)
        return queryset.filter(user=user).exists()
1310008
def handle_authenticated_user(self, response):
        
        current_user = get_user(self.request)

        ulogin, registered = ULoginUser.objects.get_or_create(
            uid=response['uid'],
            network=response['network'],
            defaults={'identity': response['identity'],
                      'user': current_user})

        if not registered:
            ulogin_user = ulogin.user
            logger.debug('uLogin user already exists')

            if current_user != ulogin_user:
                logger.debug(
                    "Mismatch: %s is not a %s. Take over it!" % (current_user,
                                                                 ulogin_user)
                )
                ulogin.user = current_user
                ulogin.save()

        return get_user(self.request), ulogin, registered
622025
def get_user(user=None):
    
    if user is None:
        # Return the current authenticated user
        user = getSecurityManager().getUser()
    elif isinstance(user, MemberData):
        # MemberData wrapped user -> get the user object
        user = user.getUser()
    elif isinstance(user, basestring):
        # User ID -> get the user
        user = get_member_by_login_name(get_portal(), user, False)
        if user:
            user = user.getUser()
    return user
1028012
def get_user(self, request):
        
        try:
            return User.objects.get(username=request.data.get('username'),
                                    is_active=True)
        except User.DoesNotExist:
            return None
801257
def user(self, username=None):
        """"""
        if username is None:
            username = self.__getUsername()
        parsedUsername = urlparse.quote(username)
        url = self.root + "/%s" % parsedUsername
        return User(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port,
                    initialize=False)
701350
def is_admin(self, user):
        
        return True if self.organization_users.filter(
            user=user, is_admin=True
        ) else False
539800
def confirm_user(self, user):
        
        if user.confirmed_at is not None:
            return False
        user.confirmed_at = self.security.datetime_factory()
        user.active = True
        self.user_manager.save(user)

        user_confirmed.send(app._get_current_object(), user=user)
        return True
664930
def get_user(self, username):
        
        for user in self.users:
            if user.id.name == username:
                return user
        return None
472018
def check_my_users(user):
    
    user_data = my_users.get(user['username'])
    if not user_data:
        return False  # <--- invalid credentials
    elif user_data.get('password') == user['password']:
        return True  # <--- user is logged in!

    return False
905623
def user_is_superadmin(self, username=None):
        
        if username is None:
            username = self.session_username()

        return username in self._superadmins
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
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