<commit_before>package com.ripple.cli;

import com.ripple.client.Client;
import com.ripple.client.ClientLogger;
import com.ripple.client.requests.Request;
import com.ripple.client.responses.Response;
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl;
import com.ripple.core.types.*;
import org.json.JSONArray;
import org.json.JSONException;

import java.math.BigDecimal;

public class CheckPrice {
    public static final AccountID BITSTAMP = AccountID.fromAddress("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B");
    public static final Issue BITSTAMP_USD = BITSTAMP.issue("USD");
    public static final Issue BITSTAMP_BTC = BITSTAMP.issue("BTC");
    public static final Issue XRP = Issue.XRP;

    public static void main(String[] args) throws JSONException {
        ClientLogger.quiet = true;
        Client client = new Client(new JavaWebSocketTransportImpl());
        client.connect("wss://s1.ripple.com");

        Request request = client.requestBookOffers(XRP, BITSTAMP_BTC);
        request.once(Request.OnResponse.class, new Request.OnResponse() {
            @Override
            public void called(Response response) {
                if (response.succeeded) {
                    JSONArray offersJSON = response.result.optJSONArray("offers");
                    STArray offers = STArray.translate.fromJSONArray(offersJSON);
                    for (STObject offer : offers) showOfferInfo(offer);
                } else {
                    System.out.println("There was an error: " + response.message);
                }
            }
        });
        request.request();
    }

    private static void showOfferInfo(STObject offer) {
        Amount takerPays = offer.get(Amount.TakerPays);
        Amount takerGets = offer.get(Amount.TakerGets);
        BigDecimal payForOne = takerPays.computeQuality(takerGets);


        Amount getsOne = takerGets.oneAtXRPScale();
        Amount paysOne = takerPays.oneAtXRPScale();

        printSeparatorBanner();
        print("%60s == %s\n", paysOne.multiply(payForOne), getsOne);
        print("%60s == %s\n", getsOne.divide(payForOne), paysOne);
    }

    private static void print(String fmt, Object... args) {
        System.out.printf(fmt, args);
    }

    private static void printSeparatorBanner() {
        for (int i = 0; i < 120; i++) System.out.print("-");
        System.out.println();
    }
}<commit_msg>Updated CheckPrice example<commit_after>package com.ripple.cli;

import com.ripple.client.Client;
import com.ripple.client.ClientLogger;
import com.ripple.client.requests.Request;
import com.ripple.client.responses.Response;
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl;
import com.ripple.core.types.*;
import org.json.JSONArray;
import org.json.JSONException;

import java.math.BigDecimal;

public class CheckPrice {
    public static final AccountID BITSTAMP = AccountID.fromAddress("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B");
    public static final Issue BITSTAMP_USD = BITSTAMP.issue("USD");
    public static final Issue BITSTAMP_BTC = BITSTAMP.issue("BTC");
    public static final Issue XRP = Issue.XRP;

    public static void main(String[] args) throws JSONException {
        ClientLogger.quiet = true;
        Client client = new Client(new JavaWebSocketTransportImpl());
        client.connect("wss://s1.ripple.com");

        Request request = client.requestBookOffers(XRP, BITSTAMP_BTC);
        request.once(Request.OnResponse.class, new Request.OnResponse() {
            @Override
            public void called(Response response) {
                if (response.succeeded) {
                    JSONArray offersJSON = response.result.optJSONArray("offers");
                    STArray offers = STArray.translate.fromJSONArray(offersJSON);
                    for (STObject offer : offers) showOfferInfo(offer);
                } else {
                    System.out.println("There was an error: " + response.message);
                }
            }
        });
        request.request();
    }

    private static void showOfferInfo(STObject offer) {
        Amount takerPays     = offer.get(Amount.TakerPays);
        Amount takerGets     = offer.get(Amount.TakerGets);
        BigDecimal payForOne = takerPays.computeQuality(takerGets);

        Amount getsOne = takerGets.oneAtXRPScale();
        Amount paysOne = takerPays.oneAtXRPScale();

        printSeparatorBanner();
        print("%60s == %s\n", paysOne.multiply(payForOne), getsOne);
        print("%60s == %s\n", getsOne.divide(payForOne),   paysOne);
    }

    private static void print(String fmt, Object... args) {
        System.out.printf(fmt, args);
    }

    private static void printSeparatorBanner() {
        for (int i = 0; i < 120; i++) System.out.print("-");
        System.out.println();
    }
}
{'fraction_non_alphanumeric': 0.11, 'fraction_numerical': 0.007916666666666667, 'mean_word_length': 2.7982594936708862, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1465083', 'n_tokens_mistral': 1480, 'n_tokens_neox': 1396, 'n_words': 292}