<commit_before>import sys
import logging
from pyole import *


def print_usage():
    message = 'Usage: [Option] ' + sys.argv[0] + ' OLEFile\r\n\r\n'
    message += 'Options:\r\n'
    message += '-h\tshow help message\r\n'
    message += '-d\tdebug mode\r\n'
    print message
    

if __name__ == '__main__':
    
    if len(sys.argv) == 2:
        
        try:
            olefile = OLEFile(sys.argv[1])
            print olefile.OLEHeader.Signature.encode('hex')
            print olefile.Directory[0].Name
            print olefile.find_object_by_name('Root Entry')
            print olefile.find_object_by_index(2)
            
        except Exception as e:
            print e
            
    elif len(sys.argv) == 3:
        
        if sys.argv[1] == '-d':
            
            logger = logging.getLogger('ole.logger')
            logger.setLevel(logging.DEBUG)
            ch = logging.StreamHandler()
            ch.setLevel(logging.DEBUG)
            formatter = logging.Formatter('%(levelname)s - %(message)s')
            ch.setFormatter(formatter)
            logger.addHandler(ch)
            
            try:
                olefile = OLEFile(sys.argv[2])
            except Exception as e:
                print e
            
        else:
            print_usage()
    else:
        print_usage()<commit_msg>Update the example<commit_after>import sys
import logging
from pyole import *


def print_usage():
    message = 'Usage: [Option] ' + sys.argv[0] + ' OLEFile\r\n\r\n'
    message += 'Options:\r\n'
    message += '-h\tshow help message\r\n'
    message += '-d\tdebug mode\r\n'
    print message
    

if __name__ == '__main__':
    
    if len(sys.argv) == 2:
        
        try:
            init_logging(False)
            
            olefile = OLEFile(sys.argv[1])
            print olefile.OLEHeader.Signature.encode('hex')
            print olefile.Directory[0].Name
            print olefile.find_object_by_name('Root Entry')
            print olefile.Directory[2].Name
            print olefile.find_object_by_index(2)
            
        except Exception as e:
            print e
            
    elif len(sys.argv) == 3:
        
        if sys.argv[1] == '-d':
            
            init_logging(True)
            
            try:
                olefile = OLEFile(sys.argv[2])
            except Exception as e:
                print e
            
        else:
            print_usage()
    else:
        print_usage()
{'fraction_non_alphanumeric': 0.11079660331581076, 'fraction_numerical': 0.006874241811564901, 'mean_word_length': 1.4641434262948207, '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': '1908776', 'n_tokens_mistral': 762, 'n_tokens_neox': 735, 'n_words': 152}