<commit_before># -*- Encoding: utf-8 -*-
'''wrappers.py - Wrappers for Java classes and instances

python-javabridge is licensed under the BSD license.  See the
accompanying file LICENSE for details.

Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2014 Broad Institute
All rights reserved.

'''

import inspect
import sys
import numpy as np
import javabridge as J

class JWrapper(object):
    '''A class that wraps a Java object
    
    JWrapper uses Java reflection to find a Java object's methods and fields.
    You can then use dot notation to call the methods and get references
    to the fields. If methods return Java objects, these will also be
    wrapped, so you can use the wrapper to do almost anything.
    
    When a class has overloaded methods with the same name, JWrapper will
    try to pick the one that matches the types of the arguments.
    <commit_msg>Define basestring in Python 3<commit_after># -*- Encoding: utf-8 -*-
'''wrappers.py - Wrappers for Java classes and instances

python-javabridge is licensed under the BSD license.  See the
accompanying file LICENSE for details.

Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2014 Broad Institute
All rights reserved.

'''

import inspect
import sys
import numpy as np
import javabridge as J

try:
    basestring            # Python 2
except NameError:
    basestring = (str, )  # Python 3


class JWrapper(object):
    '''A class that wraps a Java object
    
    JWrapper uses Java reflection to find a Java object's methods and fields.
    You can then use dot notation to call the methods and get references
    to the fields. If methods return Java objects, these will also be
    wrapped, so you can use the wrapper to do almost anything.
    
    When a class has overloaded methods with the same name, JWrapper will
    try to pick the one that matches the types of the arguments.
    
{'fraction_non_alphanumeric': 0.04951005673027334, 'fraction_numerical': 0.019082001031459517, 'mean_word_length': 3.379232505643341, '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': '476221', 'n_tokens_mistral': 530, 'n_tokens_neox': 496, 'n_words': 278}