Returns a simple username without any domain prefixes.

@param username
@return a simple username
480561
private String getSimpleUsername(String username) {
        String simpleUsername = username;
        if (defaultDomain != null) {
            // sanitize username
            if (username.startsWith(defaultDomain + "\\")) {
                // strip default domain from domain\ username
                simpleUsername = username.substring(defaultDomain.length() + 1);
            } else if (username.endsWith("@" + defaultDomain)) {
                // strip default domain from username@domain
                simpleUsername = username.substring(0, username.lastIndexOf('@'));
            }
        }
        return simpleUsername;
    }
631610
@Override
    public String getName () {
        boolean d = this.domain != null && this.domain.length() > 0;
        return d ? this.domain + "\\" + this.username : this.username;
    }
46130
@Override
    public String getName() {
        final Object attributeValue = this.getAttributeValue(this.userNameAttribute);
        if (attributeValue == null) {
            return null;
        }

        return attributeValue.toString();
    }
1271176
@SuppressWarnings("unchecked")
    public LdapUser getLdapUser(final String username) {
        final Query query = pm.newQuery(LdapUser.class, "username == :username");
        final List<LdapUser> result = (List<LdapUser>) query.execute(username);
        return Collections.isEmpty(result) ? null : result.get(0);
    }
608524
protected List<GrantedAuthority> getAuthorities(String username) {
        final List<GrantedAuthority> grantedAuths = new ArrayList<>();
        grantedAuths.add(new SimpleGrantedAuthority("DATA_SCIENTIST"));
        return grantedAuths;
    }
997191
public function getStuPppoeByUsername(string $username) {
        try {
            $response = $this->http()->get('check_stu_pppoe_log_utf8.php', [
                'query' => [
                    'username' => $username
                ]
            ]);
            return $this->parseResponse($response);
        } catch(RequestException $e) {
            if ($e->hasResponse()) {
                $response = $e->getResponse();
                return $response->getStatusCode() . ' ' . $response->getReasonPhrase();
            }
            return 'Exception: ' . $e->getCode();
        }
    }
1072021
public static SimpleConnectionAuthenticator getAuthenticationRequest(String userName, String password)
    {
        SimpleConnectionAuthenticator authenticator = null;
        if (userName != null || password != null)
        {
            authenticator = new SimpleConnectionAuthenticator(userName, password);
        }
        return authenticator;
    }
787907
def get_keypair_name():
  """"""

  username = get_username()
  assert '-' not in username, "username must not contain -, change $USER"
  validate_aws_name(username)
  assert len(username) < 30  # to avoid exceeding AWS 127 char limit
  return get_prefix() + '-' + username
591537
public String determineUsername() {
		if (CollectionUtils.isEmpty(this.parsedAddresses)) {
			return this.username;
		}
		Address address = this.parsedAddresses.get(0);
		return (address.username != null) ? address.username : this.username;
	}
686782
def get_username(self):
        
        username = self.get_as_nullable_string("username")
        username = username if username != None else self.get_as_nullable_string("user")
        return username
1145726
public com.google.protobuf.ByteString
      getAuthDomainBytes() {
    java.lang.Object ref = authDomain_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      authDomain_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
20101
private String toDN(String username)
	{
		String userDN = new StringBuilder(userDnPrefix).append(username).append(this.userDnSuffix).toString();
		return userDN;
	}
585622
public Response unlockUser(String username) {
		return restClient.delete("lockouts/" + username, new HashMap<String, String>());
	}
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();
    }
796156
public static String simpleName(TypeName clazzName) {
		String clazz = clazzName.toString();
		int index = clazz.lastIndexOf(".");
		if (index > 0) {
			clazz=clazz.substring(index + 1);
		}
		return clazz;
	}
333984
public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
95649
@SuppressWarnings({ "squid:S1166" })
    private static UserDetails loadUserByUsername(final String username) {
        final UserDetailsService userDetailsService = SpringContextHelper.getBean(UserDetailsService.class);
        try {
            return userDetailsService.loadUserByUsername(username);
        } catch (final UsernameNotFoundException e) {
            return new User(username, "", Collections.emptyList());
        }
    }