<commit_before>#authors <NAME>, <NAME>

import numpy
import jpype
import os


def reader(fileName=None):
    """ Function to read LIF (Leica Image Format) files. The function expects a filenames a returns a list of 5D data objects
        on item for each series contained in the LIF file. The function expects to find a running Java Virtual Machine. This Machine
        should only be started ones, so make sure it is started outside this function before you call it.
		
		This function requires jpype to be installed.
	"""
    #the switch is added to work also inside eclipse
    pathtoLOCI=os.getcwd() 
    if pathtoLOCI[-7:]!= 'ilastik':
        pathtoLOCI=os.getcwd()+ "/ilastik/core/loci_tools.jar"
    else:
        pathtoLOCI= os.getcwd() + '/core/loci_tools.jar'

    try:
        if not jpype.isJVMStarted():
            jpype.startJVM(jpype.getDefaultJVMPath(),'-Djava.class.path=' + pathtoLOCI)
    except:
        print "JVM Start failed, propably it has been started already..."	<commit_msg>do not fail if jpype is not installed, instead print helpful error message<commit_after>#authors <NAME>, <NAME>

import numpy

try:
    import jpype
except:
    print "Please install jpype if you want to read microscopy formats images like LIF."
import os


def reader(fileName=None):
    """ Function to read LIF (Leica Image Format) files. The function expects a filenames a returns a list of 5D data objects
        on item for each series contained in the LIF file. The function expects to find a running Java Virtual Machine. This Machine
        should only be started ones, so make sure it is started outside this function before you call it.
		
		This function requires jpype to be installed.
	"""
    #the switch is added to work also inside eclipse
    pathtoLOCI=os.getcwd() 
    if pathtoLOCI[-7:]!= 'ilastik':
        pathtoLOCI=os.getcwd()+ "/ilastik/core/loci_tools.jar"
    else:
        pathtoLOCI= os.getcwd() + '/core/loci_tools.jar'

    try:
        if not jpype.isJVMStarted():
            jpype.startJVM(jpype.getDefaultJVMPath(),'-Djava.class.path=' + pathtoLOCI)
    except:
        print "JVM Start failed, propably it has been started already..."	
{'fraction_non_alphanumeric': 0.08440366972477065, 'fraction_numerical': 0.001834862385321101, 'mean_word_length': 3.1542857142857144, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4410971', 'n_tokens_mistral': 689, 'n_tokens_neox': 662, 'n_words': 258}