<commit_before>package construct.lib;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Various containers.
 */
public class Containers
{
	static public class Pair{
		public String s;
		public Object o;
		
		public Pair( String s, Object o){
			this.s = s;
			this.o = o;
		}
	}

	static public Pair P( final String s, final Object o ){
		return new Pair( s, o);
	}
	
	/**
    A generic container of attributes.

    Containers are the common way to express parsed data.
	 */
	static public Container Container( Pair... dict ){
		return new Container( dict );
	}
	static public class Container{
		
		HashMap<String, Object> dict = new HashMap<String, Object>();
		
		public Container( Pair... dict ){
			for( Pair p : dict ){
				this.dict.put( p.s, p.o);
			}
		}

		public Container( Map<String, Object> dict ){
			this.dict.putAll( dict );
		}

		public Object get( String name ){
			return dict.get(name);
		}
		
		public void del( String name ){
			dict.remove( name );
		}
		
		public void set( String name, Object value ){
			dict.put( name, value);
		}
		
		public Set<String> keys(){
			return dict.keySet();
		}
		
		public void update( Container other ){
			for( String s : other.keys() ){
					set( s, other.get(s));
			}
		}
		
		public boolean contains( String name ){
			return dict.containsKey(name);
		}
		
		@Override
		public boolean equals( Object o ){
			if( o instanceof Container)
				return dict.equals(((Container)o).dict);
			else
				return false;
		}
    
		public Container clone(){
			return new Container( dict );
		}

    public final String toString() {
      return dict.toString();
  }

	/*
    def iteritems(self):
        return self.__dict__.iteritems()

    # Rich comparisons.

    def __eq__(self, other):
        try:
            return self.__dict__ == other.__dict__
        except AttributeError:
            return False

    def __ne__(self, other):
        return not self == other

    # Copy interface.

    def copy(self):
        return self.__class__(**self.__dict__)

    __copy__ = copy

    # Iterator interface.

    def __iter__(self):
        return iter(self.__dict__)

    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, repr(self.__dict__))

    def __str__(self):
        return "%s(%s)" % (self.__class__.__name__, str(self.__dict__))
*/
	}
}
<commit_msg>Changed toa ccept any Object as keys<commit_after>package construct.lib;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Various containers.
 */
public class Containers
{
	static public class Pair{
		public Object s;
		public Object o;
		
		public Pair( Object s, Object o){
			this.s = s;
			this.o = o;
		}
	}

	static public Pair P( final Object s, final Object o ){
		return new Pair(s, o);
	}

	/**
    A generic container of attributes.

    Containers are the common way to express parsed data.
	 */
	static public Container Container( Pair... dict ){
		return new Container( dict );
	}
	static public class Container{
		
		HashMap<Object, Object> dict = new HashMap<Object, Object>();
		
		public Container( Pair... dict ){
			for( Pair p : dict ){
				this.dict.put( p.s, p.o);
			}
		}

		public Container( Map<Object, Object> dict ){
			this.dict.putAll( dict );
		}

		public Object get( Object name ){
			return dict.get(name);
		}
		
		public void del( Object name ){
			dict.remove( name );
		}
		
		public void set( Object name, Object value ){
			dict.put( name, value);
		}
		
		public Set<Object> keys(){
			return dict.keySet();
		}
		
		public void update( Container other ){
			for( Object s : other.keys() ){
					set( s, other.get(s));
			}
		}
		
		public boolean contains( Object name ){
			return dict.containsKey(name);
		}
		
		@Override
		public boolean equals( Object o ){
			if( o instanceof Container)
				return dict.equals(((Container)o).dict);
			else
				return false;
		}
    
		public Container clone(){
			return new Container( dict );
		}

    public final String toString() {
      return dict.toString();
  }

	/*
    def iteritems(self):
        return self.__dict__.iteritems()

    # Rich comparisons.

    def __eq__(self, other):
        try:
            return self.__dict__ == other.__dict__
        except AttributeError:
            return False

    def __ne__(self, other):
        return not self == other

    # Copy interface.

    def copy(self):
        return self.__class__(**self.__dict__)

    __copy__ = copy

    # Iterator interface.

    def __iter__(self):
        return iter(self.__dict__)

    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, repr(self.__dict__))

    def __str__(self):
        return "%s(%s)" % (self.__class__.__name__, str(self.__dict__))
*/
	}
}

{'fraction_non_alphanumeric': 0.12088142707240294, 'fraction_numerical': 0.0, 'mean_word_length': 2.517343173431734, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2218845', 'n_tokens_mistral': 1686, 'n_tokens_neox': 1438, 'n_words': 457}