Get the role by its URI or Name.

        Args:
            name_or_uri:
                Can be either the Name or the URI.

        Returns:
            dict: Role
967907
def get(self, name_or_uri):
        
        name_or_uri = quote(name_or_uri)
        return self._client.get(name_or_uri)
933986
def get_role(self, key):
        """"""

        json_resp = self.get_roles()
        for item in json_resp:
            if key in item["name"]:
                return item["id"]
        raise CerberusClientException("Key '%s' not found" % key)
1258682
def get_resource(id_or_uri, opts = {})
      data, _status_code, _headers = get_resource_with_http_info(id_or_uri, opts)
      return data
    end
478596
def which_roles_can(self, name):
        
        targetPermissionRecords = AuthPermission.objects(creator=self.client, name=name).first()
        return [{'role': group.role} for group in targetPermissionRecords.groups]
941051
def get_user(user_or_username):
    
    user = None
    if isinstance(user_or_username, MemberData):
        user = user_or_username
    if isinstance(user_or_username, basestring):
        user = get_member_by_login_name(get_portal(), user_or_username, False)
    return user
641690
def has_role(self, role):
        '''
        
        '''
        return self.roles and any([re.search(role, our_role, re.I)
                                   for our_role in self.roles])
286767
public function getRole($name)
    {
        if (isset($this->roles[$name])) {
            return $this->roles[$name];
        }

        return null;
    }
1187616
def get_storage(self, id_or_uri):
        
        uri = self.URI + "/{}/storage".format(extract_id_from_uri(id_or_uri))
        return self._client.get(uri)
617004
public function getRole($name)
    {
        if ($this->hasRole($name)) {
            return $this->roles[$name];
        }

        throw new \InvalidArgumentException(sprintf('No role with name "%s" could be found', $name));
    }
399158
def get_role_config_group(self, name):
    
    return role_config_groups.get_role_config_group(
        self._get_resource_root(), self.name, name, self._get_cluster_name())
1351146
def find_or_create_role(self, name, **kwargs):
        
        kwargs["name"] = name
        return self.find_role(name) or self.create_role(**kwargs)
1068872
def role(organization = nil)
      # Return cached version if available
      return self.read_attribute(:role) if !organization

      # Find in arrays if organizations have been fetched
      # already. Perform remote query otherwise
      org = begin
        if self.organizations.loaded?
          self.organizations.to_a.find { |e| e.id == organization.id }
        else
          self.organizations.where(id: organization.id).first
        end
      end

      org ? org.role : nil
    end
90715
def role(self):
        
        try:
            self._role = c_char(
                self.lib.iperf_get_test_role(self._test)
            ).value.decode('utf-8')
        except TypeError:
            self._role = c_char(
                chr(self.lib.iperf_get_test_role(self._test))
            ).value.decode('utf-8')
        return self._role
183212
public function getRole($uri)
    {
        $returnValue = null;

        if(!empty($uri)){
        	$returnValue = new core_kernel_classes_Resource($uri);
        }

        return $returnValue;
    }
81067
def get(self, uri):
        '''
        '''
        if uri.startswith('cid:'):
            # Content-ID, so raise exception if not found.
            head, part = self.id_dict[uri[4:]]
            return StringIO.StringIO(part.getvalue())
        if self.loc_dict.has_key(uri):
            head, part = self.loc_dict[uri]
            return StringIO.StringIO(part.getvalue())
        return None
1053714
def _getRole(self, matchedVars):
        
        role = matchedVars.get(ROLE)
        if role is not None and role.strip() == '':
            role = NULL
        else:
            valid = Authoriser.isValidRoleName(role)
            if valid:
                role = Authoriser.getRoleFromName(role)
            else:
                self.print("Invalid role. Valid roles are: {}".
                           format(", ".join(map(lambda r: r.name, Roles))),
                           Token.Error)
                return False
        return role
536655
public String getUserRoleLink(String name)
    {
        if (_roleMap==null)
            return name;
        String link=(String)_roleMap.get(name);
        return (link==null)?name:link;
    }