List[:class:`Role`]: A :class:`list` of roles that is allowed to use this emoji.

        If roles is empty, the emoji is unrestricted.
976331
def roles(self):
        
        guild = self.guild
        if guild is None:
            return []

        return [role for role in guild.roles if self._roles.has(role.id)]
935105
def list(self, limit=None, marker=None, end_marker=None, prefix=None):
        
        uri = "/%s" % self.uri_base
        qs = utils.dict_to_qs({"marker": marker, "limit": limit,
                "prefix": prefix, "end_marker": end_marker})
        if qs:
            uri = "%s?%s" % (uri, qs)
        resp, resp_body = self.api.method_get(uri)
        return [Container(self, res, loaded=False)
                for res in resp_body if res]
614687
def roles(self, value):
        

        if value is not None:
            assert type(value) is dict, "'{0}' attribute: '{1}' type is not 'dict'!".format("roles", value)
            for key in value:
                assert type(key) is Qt.ItemDataRole, "'{0}' attribute: '{1}' type is not 'Qt.ItemDataRole'!".format(
                    "roles", key)
        self.__roles = value
485695
function roleOrSelf (role) {
        if (!_.isNumber(role)) {
            role = roles[role.toUpperCase()];
        }

        return function validateRoleOrSelf (kontx, next) {
            var userPrivLevel = roles[kontx.user.role.toUpperCase()],
                passedInUserId = kontx.args[0],
                err = createError(strings.group('codes').forbidden, strings.group('errors').user_privileges_exceeded);

            //If user object passed in instead of a string then parse.
            if (!_.isUndefined(kontx.args[0]._id)) {
                passedInUserId = kontx.args[0]._id;
            }

            //If user has enough priviliges then keep going
            if (userPrivLevel <= parseInt(role, 10) || kontx.user._id.toString() === passedInUserId.toString()) {
                next();
                return;
            }

            next(err);
        };
    }
505548
def run_role(self, name,
                 options=None,
                 content=None):
        
        if options is None:
            options = {}
        if content is None:
            content = []
        role_fn, _ = role(name,
                          self.language,
                          self.node.line,
                          self.reporter)
        vec, _ = role_fn(name,
                         rawtext=str(content),
                         text=str(content),
                         lineno=self.node.line,
                         inliner=self.memo.inliner,
                         options=options,
                         content=content)
        assert len(vec) == 1, 'only support one list in role'
        return vec[0]
646468
def role_admin?(run_list = nil)
      return false unless run_list.is_a?(Array)
      # => This will Authorize Anyone if the RunList is Empty or the Chef Node does not exist!!!
      run_list.empty? || auth['roles'].any? { |role| run_list.any? { |r| r =~ /role\[#{role}\]/i } }
    end
633984
def accepts_manager_roles(func):
    
    if inspect.isclass(func):
        apply_function_to_members(func, accepts_manager_roles)
        return func
    else:
        @functools.wraps(func)
        def decorator(*args, **kwargs):
            return accepts_roles(*ROLES_MANAGER)(func)(*args, **kwargs)

        return decorator
604449
def accepts_admin_roles(func):
    
    if inspect.isclass(func):
        apply_function_to_members(func, accepts_admin_roles)
        return func
    else:
        @functools.wraps(func)
        def decorator(*args, **kwargs):
            return accepts_roles(*ROLES_ADMIN)(func)(*args, **kwargs)

        return decorator
200209
def emojies_in(text)
      (sad_emojies + happy_emojies).map do |emoji|
        text.scan(emoji)
      end.flatten
    end
364998
def role?(role_sym)
      role_sym = [role_sym] unless role_sym.is_a?(Array)

      roles.map { |r| r.name.underscore.to_sym }.any? { |user_role| role_sym.include?(user_role) }
    end
472777
def roles=(*role_names)
      role_names = role_names.flat_uniq
      role_names = extract_roles(role_names)
      return nil if role_names.empty?
      set_roles(select_valid_roles role_names)
    end
868496
def role_list():
    '''
    
    '''
    roles = {}

    ## read user_attr file (user:qualifier:res1:res2:attr)
    with salt.utils.files.fopen('/etc/user_attr', 'r') as user_attr:
        for role in user_attr:
            role = salt.utils.stringutils.to_unicode(role)
            role = role.split(':')

            # skip comments and non complaint lines
            if len(role) != 5:
                continue

            # parse attr
            attrs = {}
            for attr in role[4].split(';'):
                attr_key, attr_val = attr.split('=')
                if attr_key in ['auths', 'profiles', 'roles']:
                    attrs[attr_key] = attr_val.split(',')
                else:
                    attrs[attr_key] = attr_val
            role[4] = attrs

            # add role info to dict
            if 'type' in role[4] and role[4]['type'] == 'role':
                del role[4]['type']
                roles[role[0]] = role[4]

    return roles
750095
def has_role(self, role):
        
        if isinstance(role, str):
            return role in (role.name for role in self.roles)
        else:
            return role in self.roles
1162642
def sendEmoji(
        self,
        emoji=None,
        size=EmojiSize.SMALL,
        thread_id=None,
        thread_type=ThreadType.USER,
    ):
        
        return self.send(
            Message(text=emoji, emoji_size=size),
            thread_id=thread_id,
            thread_type=thread_type,
        )
799430
def role_list(request, filters=None):
    """"""
    manager = keystoneclient(request, admin=True).roles
    roles = []
    kwargs = {}
    if filters is not None:
        kwargs.update(filters)
    if 'id' in kwargs:
        try:
            roles = [manager.get(kwargs['id'])]
        except keystone_exceptions.NotFound:
            roles = []
        except Exception:
            exceptions.handle(request)
    else:
        roles = manager.list(**kwargs)
    return roles
1272666
def make_valid_role role
      raise ArgumentError, "Role to set must be a Symbol or String" if !role.kind_of_label?
      check_valid_role? role.to_s.alpha_numeric
    end
1349469
private int rolesToMask(ArrayList<String> roles) {
        int mask = 0;
        if (roles != null) {
            for (String role: roles) {
                switch (role) {
                    case "client":
                        mask |= 1;
                        break;       // Client mask
                    case "peer":
                        mask |= 2;
                        break;       // Peer mask
                    case "validator":
                        mask |= 4;
                        break;  // Validator mask
                    case "auditor":
                        mask |= 8;
                        break;    // Auditor mask
                }
            }
        }

        if (mask == 0) mask = 1;  // Client
        return mask;
    }