Take a Fully Qualified User, and get a Namespace from it.
@param user
@return
161997
public static String reverseDomain(String user) {
		StringBuilder sb = null;
		String[] split = Split.split('.',user);
		int at;
		for(int i=split.length-1;i>=0;--i) {
			if(sb == null) {
				sb = new StringBuilder();
			} else {
				sb.append('.');
			}

			if((at = split[i].indexOf('@'))>0) {
				sb.append(split[i].subSequence(at+1, split[i].length()));
			} else {
				sb.append(split[i]);
			}
		}
		
		return sb==null?"":sb.toString();
	}
1189066
public function currentUser(): User
    {
        if (BunqContext::getUserContext()->isOnlyUserCompanySet()) {
            return new User(BunqContext::getUserContext()->getUserCompany());
        }

        if (BunqContext::getUserContext()->isOnlyUserPersonSet()) {
            return new User(BunqContext::getUserContext()->getUserPerson());
        }

        throw new RuntimeException('Unexpected user type received.');
    }
467874
public T namespace(String prefix, String namespaceUri) {
        getXpathVariableExtractor().getNamespaces().put(prefix, namespaceUri);
        xmlMessageValidationContext.getNamespaces().put(prefix, namespaceUri);
        return self;
    }
501930
public static NamespaceRegistry getNamespaceRegistry(final Session session) {
        try {
            return requireNonNull(session.getWorkspace().getNamespaceRegistry(),
                    "Couldn't find namespace registry in repository!");
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
954962
public static systemuser get(nitro_service service, String username) throws Exception{
		systemuser obj = new systemuser();
		obj.set_username(username);
		systemuser response = (systemuser) obj.get_resource(service);
		return response;
	}
1232533
public String getValue(CmsUser user) {

        String value = null;
        if (isAdditionalInfo()) {
            value = (String)user.getAdditionalInfo(getAddInfoKey());
        } else {
            try {
                PropertyUtilsBean propUtils = new PropertyUtilsBean();
                value = (String)propUtils.getProperty(user, getField().name());
            } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
                LOG.error("Error reading account info field.", e);
            }
        }
        return value;
    }
1198012
def get_user(self, username="~"):
        
        url = self._build_url("users/%s/" % username, _prepend_namespace=False)
        response = self._get(url)
        check_response(response)
        return response
240283
def _generate_namespace():
        
        raw_namespace = None

        # Get the Jupyter user, if available
        try:
            raw_namespace = os.environ['JPY_USER']
        except KeyError:
            pass

        # Otherwise get the current user
        if raw_namespace is None or raw_namespace == '':
            raw_namespace = getpass.getuser()

        # Remove illegal characters and return
        return re.sub(r'[^\w.-]', '-', raw_namespace)
266723
@Restricted(NoExternalUse.class)
    public @Nullable ApiTokenStore.HashedToken getLegacyTokenOf(@Nonnull User user) {
        ApiTokenProperty apiTokenProperty = user.getProperty(ApiTokenProperty.class);
        return apiTokenProperty.getTokenStore().getLegacyToken();
    }
1237623
public AccessLevel getAccessForPrincipal(String user) {
        AccessLevel result = AccessLevel.NOTHING;
        for (Access item : getAccessList()) {
            if (item.isNegativeRule()) {
                if (!item.getPrincipal().contains(user)) {
                    result = item.getLevel();
                }
            } else {
                if (item.getPrincipal().contains(user)) {
                    result = item.getLevel();
                }
            }
        }
        return result;
    }
102149
public RosterEntities getRoster(String username) {
		return restClient.get("users/" + username + "/roster", RosterEntities.class, new HashMap<String, String>());
	}
177802
public Set<Role> findRoles(final User user)
    {
        final Set<Role> result = new HashSet<Role>();
        
        Object source;
        for(final RoleMapping mapping : this.getRoleMappings())
        {
            source = mapping.getSource();
            
            if((user != null) && user.equals(source))
            {
                result.add(mapping.getTarget());
            }
        }
        
        return result;
    }
8448
protected CmsListItem makeUserItem(CmsUser user) {

        CmsListItem item = getList().newItem(user.getId().toString());
        item.set(LIST_COLUMN_LOGIN, user.getName());
        item.set(LIST_COLUMN_NAME, user.getSimpleName());
        item.set(LIST_COLUMN_ORGUNIT, CmsOrganizationalUnit.SEPARATOR + user.getOuFqn());
        item.set(LIST_COLUMN_FULLNAME, user.getFullName());
        return item;
    }
1095601
private UserEntity ensureRolesFetched(final UserEntity user)
	{
		if (user != null)
			user.getRoles().stream().map(r -> r.getId()).collect(Collectors.toList());

		return user;
	}
531770
private User userFromResultSet(final ResultSet rs) throws SQLException {
      String niceName = Strings.nullToEmpty(rs.getString(3)).trim();
      String displayName = Strings.nullToEmpty(rs.getString(4)).trim();
      String useDisplayName = displayName.isEmpty() ? niceName : displayName;
      return new User(rs.getLong(1), rs.getString(2), useDisplayName, niceName, rs.getString(5), rs.getTimestamp(6).getTime(), rs.getString(7), ImmutableList.of());
   }
1134975
private UserInterface fromUser(User user) {
        return new UserInterface(user.getId(), user.getUsername(), user.getIpAddress(),
            user.getEmail(), user.getData());
    }
211061
public User getUser(String name){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.GetUser);

        GetUserProtocol p = new GetUserProtocol(name);

        Response resp = connection.submitRequest(header, p, null);
        return ((GetUserResponse) resp).getUser();
    }