Translates user into user id

@param user user
@return user id
174265
protected UUID translateUserId(User user) {
    if (user == null) {
      return null;
    }
    
    return userController.getUserKeycloakId(user);
  }
17988
public String getGlobusID(String userID) {
        if (userID == null) {
            throw new IllegalArgumentException(i18n.getMessage("userIdNull"));
        }

        if (this.map == null) {
            return null;
        }

        Iterator iter = this.map.entrySet().iterator();
        Map.Entry mapEntry;
        GridMapEntry entry;
        while(iter.hasNext()) {
            mapEntry = (Map.Entry)iter.next();
            entry = (GridMapEntry)mapEntry.getValue();
            if (entry.containsUserID(userID)) {
                return entry.getGlobusID();
            }
        }
        return null;
    }
292705
private static String correctUser(String user) {
    if (user != null && user.trim().length() > 0
        && (false || user.indexOf('%') == -1)) {
      String escaped = escapeSpecialAsciiAndNonAscii(user);
      StringBuilder totalEscaped = new StringBuilder();
      for (int i = 0; i < escaped.length(); i++) {
        char ch = escaped.charAt(i);
        if (ch == '@' || ch == '/' || ch == ':') {
          totalEscaped.append('%')
              .append(Integer.toHexString(ch).toUpperCase());
        } else {
          totalEscaped.append(ch);
        }
      }
      user = totalEscaped.toString();
    }
    return user;
  }
545152
public static PrincipalUserDto transformToDto(PrincipalUser user) {
        if (user == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        PrincipalUserDto result = createDtoObject(PrincipalUserDto.class, user);

        for (Dashboard dashboard : user.getOwnedDashboards()) {
            result.addOwnedDashboardId(dashboard.getId());
        }
        return result;
    }
830248
public void setUserParam(String user) {
		try {
			getSipURI().setUserParam(user);
			super.parameters.put(USER, user);
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
		}
	}
889958
protected function getUserId($user)
    {
        if (is_null($user))
        {
            $user = auth()->user();
        }

        if ($user instanceof Model)
        {
            $user = $user->getKey();
        }

        return $user;
    }
372306
public String translateUser(String name) {

        if (m_importUserTranslations == null) {
            return name;
        }
        String match = m_importUserTranslations.get(name);
        if (match != null) {
            return match;
        } else {
            return name;
        }
    }
1361931
public void setUser(final String user) {
        final String old = this.user;

        this.user = user;
        this.connectionConfig = System.currentTimeMillis();
        this.connectionValidated = false;

        this.pcs.firePropertyChange("user", old, this.user);
    }
505914
public UserEntity getUser(String username) {
		UserEntity userEntity = restClient.get("users/" + username, UserEntity.class, new HashMap<String, String>());
		return userEntity;
	}
146308
public T allowedUsers(User... users) {
        List<User> usersList = Arrays.asList(users);
        this.userPredicate = (user) -> usersList.stream()
                .anyMatch((allowedUser) -> allowedUser.getId() == user.getId());
        return instance();
    }
304802
public OvhUser identity_user_user_GET(String user) throws IOException {
		String qPath = "/me/identity/user/{user}";
		StringBuilder sb = path(qPath, user);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhUser.class);
	}
796231
public Optional<User> show(long userId)
    {
        return HTTP.GET(String.format("/v2/users/%d.json", userId), USER);
    }
1202548
private static Set<String> extractUserRoles(final UsersType.User user) {
        Set<String> roles = new TreeSet<>();
        if (user == null) {
            return roles;
        }

        if (user.getRoles() != null && !user.getRoles().trim().isEmpty()) {
            String [] rolelist = user.getRoles().trim().split(",");
            for (String role: rolelist) {
                if( role == null || role.trim().isEmpty()) {
                    continue;
                }
                roles.add(role.trim().toLowerCase());
            }
        }

        return roles;
    }
814429
public UUID getUserKeycloakId(User user) {
    AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE);
    if (authSource == null) {
      logger.error("Could not find Keycloak auth source");
    }
    
    List<UserIdentification> userIdentifications = userIdentificationDAO.listByUserAndAuthSource(user, authSource);
    if (userIdentifications.size() == 1) {
      return UUID.fromString(userIdentifications.get(0).getExternalId());
    }
    
    if (userIdentifications.size() > 1) {
      logger.warn("User {} has more than one identity", user.getId());
    }
    
    return new UUID(0L, 0L);
  }
330823
public String[] getAllGlobusID(String userID) {
        if (userID == null) {
            throw new IllegalArgumentException(i18n.getMessage("userIdNull"));
        }

        if (this.map == null) {
            return null;
        }

        Vector v = new Vector();

        Iterator iter = this.map.entrySet().iterator();
        Map.Entry mapEntry;
        GridMapEntry entry;
        while(iter.hasNext()) {
            mapEntry = (Map.Entry)iter.next();
            entry = (GridMapEntry)mapEntry.getValue();
            if (entry.containsUserID(userID)) {
                v.add(entry.getGlobusID());
           }
        }

        // create array of strings and add values back in
        if(v.size() == 0) {
            return null;
        }

        String idS[] = new String[v.size()];
        for(int ctr = 0; ctr < v.size(); ctr++) {
            idS[ctr] = (String) v.elementAt(ctr);
        }

        return idS;
    }
180957
def create_user(self, user):
        
        self.run("useradd -m %s" % user)
        usr =  getpwnam(user)
        return usr
615400
public String setUser(String uid, Map<String, Object> properties)
      throws ExecutionException, InterruptedException, IOException {
    return setUser(uid, properties, new DateTime());
  }