<commit_before>package jocket.test;

import static junit.framework.Assert.assertEquals;

import java.io.EOFException;
import java.nio.ByteBuffer;

import jocket.impl.Const;
import jocket.impl.JocketReader;
import jocket.impl.JocketWriter;

public class AbstractJocketTest {

  private final int readBufSize = 8192;

  protected JocketWriter w;
  protected JocketReader r;

  protected void init(int npackets, int capacity) {
    // allows to run tests several times without resetting the socket
    if (w == null) {
      ByteBuffer buf = ByteBuffer.allocate(Const.PACKET_INFO + npackets
          * Const.LEN_PACKET_INFO + capacity);
      w = new JocketWriter(buf, npackets);
      r = new JocketReader(buf, npackets);
    }
  }

  /**
   * Writes strings, flushing after each of them.
   * 
   * @return number of bytes successfully written
   */
  protected int write(String... strs) {
    return write(true, strs);
  }

  /**
   * Writes strings without flushing.
   * 
   * @return number of bytes successfully written
   */
  protected int write0(String... strs) {
    return write(false, strs);
  }

  protected int write(boolean flush, String... strs) {
    int total = 0;
    for (String s : strs) {
      total += w.write(s.getBytes(), 0, s.length());
      if (flush)
        w.flush();
    }
    return total;
  }

  protected void flush() {
    w.flush();
  }
<commit_msg>Disable automatic alignment to restore test success<commit_after>package jocket.test;

import static junit.framework.Assert.assertEquals;

import java.io.EOFException;
import java.nio.ByteBuffer;

import jocket.impl.Const;
import jocket.impl.JocketReader;
import jocket.impl.JocketWriter;

import org.junit.*;

@Ignore
public abstract class AbstractJocketTest {

  private final int readBufSize = 8192;

  protected JocketWriter w;
  protected JocketReader r;

  protected void init(int npackets, int capacity) {
    // allows to run tests several times without resetting the socket
    if (w == null) {
      ByteBuffer buf = ByteBuffer.allocate(Const.PACKET_INFO + npackets
          * Const.LEN_PACKET_INFO + capacity);
      w = new JocketWriter(buf, npackets);
      r = new JocketReader(buf, npackets);
      w.setAlign(0);
    }
  }

  /**
   * Writes strings, flushing after each of them.
   *
   * @return number of bytes successfully written
   */
  protected int write(String... strs) {
    return write(true, strs);
  }

  /**
   * Writes strings without flushing.
   *
   * @return number of bytes successfully written
   */
  protected int write0(String... strs) {
    return write(false, strs);
  }

  protected int write(boolean flush, String... strs) {
    int total = 0;
    for (String s : strs) {
      total += w.write(s.getBytes(), 0, s.length());
      if (flush)
        w.flush();
    }
    return total;
  }

  protected void flush() {
    w.flush();
  }

{'fraction_non_alphanumeric': 0.10708057202650854, 'fraction_numerical': 0.005231949773282177, 'mean_word_length': 2.918032786885246, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6332342', 'n_tokens_mistral': 913, 'n_tokens_neox': 884, 'n_words': 261}