(cls, userID, domain=None)
return couch_user
if domain is given, checks to make sure the user is a member of that domain
        returns None if there's no user found or if the domain check fails
if domain is given, checks to make sure the user is a member of that domain
        returns None if there's no user found or if the domain check fails
if domain is given checks to make sure the user is a member of that domain returns None if there s no user found or if the domain check fails
def get_by_user_id(cls, userID, domain=None):
        """
        if domain is given, checks to make sure the user is a member of that domain
        returns None if there's no user found or if the domain check fails
        """
        try:
            couch_user = cls.wrap_correctly(cls.get_db().get(userID))
        except ResourceNotFound:
            return None
        if couch_user.doc_type != cls.__name__ and cls.__name__ != "CouchUser":
            raise CouchUser.AccountTypeError()
        if domain:
            if not couch_user.is_member_of(domain):
                return None
        cls.get_by_username.set_cached_value(couch_user.__class__, couch_user.username).to(couch_user)
        return couch_user
def get_by_user_id ( cls , userID , domain = None ) : try : couch_user = cls . wrap_correctly ( cls . get_db ( ) . get ( userID ) ) except ResourceNotFound : return None if couch_user . doc_type != cls . __name__ and cls . __name__ != "CouchUser" : raise CouchUser . AccountTypeError ( ) if domain : if not couch_user . is_member_of ( domain ) : return None cls . get_by_username . set_cached_value ( couch_user . __class__ , couch_user . username ) . to ( couch_user ) return couch_user