Adapts a CryptonitBalance to an AccountInfo

@param cryptonitBalance The Cryptonit balance
@param userName The user name
@return The account info
13876
public static AccountInfo adaptAccountInfo(CryptonitBalance cryptonitBalance, String userName) {

    // Adapt to XChange DTOs
    List<Balance> balances = new ArrayList<>();
    for (CryptonitBalance.Balance b : cryptonitBalance.getBalances()) {
      Balance xchangeBalance =
          new Balance(
              Currency.getInstance(b.getCurrency().toUpperCase()),
              b.getBalance(),
              b.getAvailable(),
              b.getReserved(),
              ZERO,
              ZERO,
              b.getBalance().subtract(b.getAvailable()).subtract(b.getReserved()),
              ZERO);
      balances.add(xchangeBalance);
    }
    return new AccountInfo(userName, cryptonitBalance.getFee(), new Wallet(balances));
  }
174178
public static aaauser_binding get(nitro_service service, String username) throws Exception{
		aaauser_binding obj = new aaauser_binding();
		obj.set_username(username);
		aaauser_binding response = (aaauser_binding) obj.get_resource(service);
		return response;
	}
1346371
public User getUser(String userName) {
        User result = null;
        for (User item : getUsersList()) {
            if (item.getName().equals(userName)) {
                result = item;
            }
        }
        return result;
    }
1042216
protected Account authenticate(String username, String password) {
        StandardCredentials authenticationToken = new StandardCredentials(username, password);
        Account account = securityManager.authenticate(authenticationToken);
        return account;
    }
266774
public static aaauser get(nitro_service service, String username) throws Exception{
		aaauser obj = new aaauser();
		obj.set_username(username);
		aaauser response = (aaauser) obj.get_resource(service);
		return response;
	}
553012
@SuppressWarnings("unchecked")
    @Override
	public <T extends ApiUser> T getUserByName(String username) {
	    User sfsUser = getZone().getUserByName(username);
        if(sfsUser != null && sfsUser.containsProperty(APIKey.USER))
            return (T) sfsUser.getProperty(APIKey.USER);
        return null;
	}
381810
public List<CouchDbGoogleAuthenticatorAccount> findByUsername(final String username) {
        try {
            return queryView("by_username", username);
        } catch (final DocumentNotFoundException ignored) {
            return null;
        }
    }
969629
public static AccountInfo adaptAccountInfo(
      final RippleAccountBalances account, final String username) {

    // Adapt account balances to XChange balances
    final Map<String, List<Balance>> balances = new HashMap<>();
    for (final RippleBalance balance : account.getBalances()) {
      final String walletId;
      if (balance.getCurrency().equals("XRP")) {
        walletId = null;
      } else {
        walletId = balance.getCounterparty();
      }
      if (!balances.containsKey(walletId)) {
        balances.put(walletId, new LinkedList<Balance>());
      }
      balances
          .get(walletId)
          .add(new Balance(Currency.getInstance(balance.getCurrency()), balance.getValue()));
    }

    final List<Wallet> accountInfo = new ArrayList<>(balances.size());
    for (final Map.Entry<String, List<Balance>> wallet : balances.entrySet()) {
      accountInfo.add(new Wallet(wallet.getKey(), wallet.getValue()));
    }

    return new AccountInfo(username, BigDecimal.ZERO, accountInfo);
  }
729180
public boolean userHasLock(String username) {
        Objects.requireNonNull(username, Required.USERNAME.toString());
        boolean lock = false;
        
        Config config = Application.getInstance(Config.class);
        Cache cache = Application.getInstance(CacheProvider.class).getCache(CacheName.AUTH);
        AtomicInteger counter = cache.getCounter(username);
        if (counter != null && counter.get() > config.getAuthenticationLock()) {
            lock = true;
        }
        
        return lock;
    }
300805
public Account getAccountByName(String accountName) {
    if (accountName != null) {
      for (Account account : getAccounts()) {
        if (accountName.equals(account.name)) {
          return account;
        }
      }
    }
    return null;
  }
776185
public static dbuser get(nitro_service service, String username) throws Exception{
		dbuser obj = new dbuser();
		obj.set_username(username);
		dbuser response = (dbuser) obj.get_resource(service);
		return response;
	}
775319
private String getPasswordOnRecord(final String username) throws IOException {
        try (val stream = Files.lines(fileName.getFile().toPath())) {
            return stream.map(line -> line.split(this.separator))
                .filter(lineFields -> {
                    val userOnRecord = lineFields[0];
                    return username.equals(userOnRecord);
                })
                .map(lineFields -> lineFields[1])
                .findFirst()
                .orElse(null);
        }
    }
708122
def get_account(self, username):
        
        try:
            account = self.model.objects.get(
                **self._filter_user_by(username)
            )
        except self.model.DoesNotExist:
            return None
        return account
454718
public static UsernameAttribute createUsernameAttribute(byte username[]) {
		UsernameAttribute attribute = new UsernameAttribute();

		attribute.setUsername(username);
		return attribute;
	}
505914
public UserEntity getUser(String username) {
		UserEntity userEntity = restClient.get("users/" + username, UserEntity.class, new HashMap<String, String>());
		return userEntity;
	}
73280
public Proxy setSocksUsername(String username) {
    verifyProxyTypeCompatibility(ProxyType.MANUAL);
    this.proxyType = ProxyType.MANUAL;
    this.socksUsername = username;
    return this;
  }
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);
    }