import os


def fn_has_ext(fn, ext, case_sensitive=False):
    """
    Determine whether a file has a particular extension.

    Parameters
    ----------
    fn : string
        The filename of the query file.
    ext : string
        The extension being checked.
    case_sensitive : bool
        Whether or not to treat the extension as case sensitive.

    Returns
    -------
    file_has_ext : bool
        True if the filename has the specified extension.

    Examples
    --------
    >>> dib_file = 'AS_09125_050116110001_A01f00d0.DIB'
    >>> fn_has_ext(dib_file, 'dib', case_sensitive=True)
    False
    """
    fn_ext = os.path.splitext(fn)[1][1:]
    if case_sensitive:
        file_has_ext = fn_ext == ext
    else:
        file_has_ext = fn_ext.lower() == ext.lower()
    return file_has_ext


def is_cellomics_image(fn):
    """Determine whether a file is a Cellomics image.

    Parameters
    ----------
    fn : string
        The filename of the file in question.

    Returns
    -------
    is_cellom : bool
        True if the filename points to a Cellomics image.
    """
    is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB')
    return is_cellom


def is_cellomics_mask(fn):
    """Determine whether a file is a Cellomics mask image.

    Parameters
    ----------
    fn : string
        The filename.

    Returns
    -------
    is_mask : bool
        True if the filename points to a Cellomics mask image.

    Examples
    --------
    >>> mask_fn = 'MFGTMP_120628160001_C18f00o1.C01'
    >>> is_cellomics_mask(mask_fn)
    True
    """
    base_fn = os.path.splitext(fn)[0]
    is_mask = base_fn.endswith('o1') or base_fn.endswith('o1')
    return is_mask

@@ -13,48 +13,35 @@
 def 
-fn_
 has_ext
-(fn, ext, case_sensitive=False
+ension(filename, ext
 ):%0A 
@@ -132,33 +132,39 @@
 ----------%0A    f
-n
+ilename
  : string%0A      
@@ -254,99 +254,8 @@
 ked.
-%0A    case_sensitive : bool%0A        Whether or not to treat the extension as case sensitive.
 %0A%0A  
@@ -449,26 +449,29 @@
     %3E%3E%3E 
-fn_
 has_ext
+ension
 (dib_fil
@@ -482,39 +482,17 @@
 dib'
-, case_sensitive=True
 )%0A    
-Fals
+Tru
 e%0A  
@@ -528,17 +528,23 @@
 litext(f
-n
+ilename
 )%5B1%5D%5B1:%5D
@@ -548,82 +548,8 @@
 1:%5D%0A
-    if case_sensitive:%0A        file_has_ext = fn_ext == ext%0A    else:%0A    
     
@@ -922,26 +922,29 @@
 ellom = 
-fn_
 has_ext
+ension
 (fn, 'C0
@@ -954,18 +954,21 @@
  or 
-fn_
 has_ext
+ension
 (fn,

Refactor fn_has_ext * Rename to has_extension * Remove case sensitivity parameter