def find(identifier)
      identifier = identifier.downcase

      if identifier =~ /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ # uuid
        return get_by_id(identifier)
      end

      begin
        address = Address.new(identifier).to_bytes
        raise AssertError unless address.size == 20
        return self[address]
      rescue
        # do nothing
      end

      index = identifier.to_i
      raise ValueError, 'Index must be 1 or greater' if index <= 0
      raise KeyError if index > @accounts.size
      @accounts[index-1]
    end
def find(identifier)
      identifier = identifier.downcase

      if identifier =~ /\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/ # uuid
        return get_by_id(identifier)
      end

      begin
        address = Address.new(identifier).to_bytes
        raise AssertError unless address.size == 20
        return self[address]
      rescue
        # do nothing
      end

      index = identifier.to_i
      raise ValueError, 'Index must be 1 or greater' if index <= 0
      raise KeyError if index > @accounts.size
      @accounts[index-1]
    end
Find an account by either its address, its id, or its index as string.

 Example identifiers:

 - '9c0e0240776cfbe6fa1eb37e57721e1a88a563d1' (address)
 - '0x9c0e0240776cfbe6fa1eb37e57721e1a88a563d1' (address with 0x prefix)
 - '01dd527b-f4a5-4b3c-9abb-6a8e7cd6722f' (UUID)
 - '3' (index)

 @param identifier [String] the accounts hex encoded, case insensitive
   address (with optional 0x prefix), its UUID or its index (as string,
   >= 1)

 @raise [ValueError] if the identifier could not be interpreted
 @raise [KeyError] if the identified account is not known to the account
   service