<commit_before>import java.util.*;

public class Inventory
{
    public Inventory (boolean debug)
    {
        _bags = new Vector<Bag>();
        _debug = debug;
    }

    public final void insert (Bag b)
    {
        _bags.add(b);
    }

    public final int bagCount (Bag theBag)
    {
        int count = 0;
        Enumeration<Bag> iter = _bags.elements();
        Vector<Bag> indirect = new Vector<Bag>();

        while (iter.hasMoreElements())
        {
            Bag b = iter.nextElement();

            if (b.contains(theBag))
            {
                count++;

                indirect.add(b);
            }
        }

        iter = indirect.elements();

        while (iter.hasMoreElements())
        {
            Bag b = iter.nextElement();

            if (b.contains(theBag))
                count++;
        }

        return count;
    }

    @Override
    public String toString ()
    {
        String str = "";
        Enumeration<Bag> iter = _bags.elements();

        while (iter.hasMoreElements())
        {
            Bag b = iter.nextElement();

            str += b.printRule()+"\n";
        }

        return str;
    }

    private Vector<Bag> _bags;
    private boolean _debug;
}<commit_msg>Update Inventory.java<commit_after>import java.util.*;

public class Inventory
{
    public Inventory (boolean debug)
    {
        _bags = new Vector<Bag>();
        _debug = debug;
    }

    public final void insert (Bag b)
    {
        _bags.add(b);
    }

    public final int bagCount (Bag theBag)
    {
        int count = 0;
        Enumeration<Bag> iter = _bags.elements();

        while (iter.hasMoreElements())
        {
            Bag b = iter.nextElement();

            if (b.contains(theBag))
            {
                if (_debug)
                    System.out.println("Bag "+b+" containts "+theBag);

                count++;
            }
        }

        return count;
    }

    @Override
    public String toString ()
    {
        String str = "";
        Enumeration<Bag> iter = _bags.elements();

        while (iter.hasMoreElements())
        {
            Bag b = iter.nextElement();

            str += b.printRule()+"\n";
        }

        return str;
    }

    private Vector<Bag> _bags;
    private boolean _debug;
}
{'fraction_non_alphanumeric': 0.11708169506334644, 'fraction_numerical': 0.0008737439930100481, 'mean_word_length': 1.4335812964930925, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3382435', 'n_tokens_mistral': 682, 'n_tokens_neox': 632, 'n_words': 156}