<commit_before>import numpy as np
import scipy.ndimage as nd
from .selem import _default_selem

# Our function names don't exactly correspond to ndimages.
# These dictionaries translate from our names to scipy's.
skimage2ndimage = {x: 'grey_' + x
                   for x in ('erosion','dilation','opening','closing')}
skimage2ndimage.update({x: x
                        for x in ('binary_erosion','binary_dilation',
                                  'binary_opening','binary_closing',
                                  'black_tophat','white_tophat')})

def default_fallback(func):
    """Decorator to fall back on ndimage for images with more than 2 dimensions

    Parameters
    ----------
    func : function
        A morphology function such as erosion, dilation, opening, closing,
        white_tophat, or black_tophat.

    Returns
    -------
    func_out : function
        If the image dimentionality is greater than 2D, the ndimage
        function is returned, otherwise skimage function is used.
    """
    
    def func_out(image, selem=None, out=None, **kwargs):
        """Select a function appropriate for the image dimensionality
    
        Parameters
        ----------
        image : ndarray
            Image array.<commit_msg>Adjust hanging indentation whitespace in dict comprehension<commit_after>import numpy as np
import scipy.ndimage as nd
from .selem import _default_selem

# Our function names don't exactly correspond to ndimages.
# These dictionaries translate from our names to scipy's.
skimage2ndimage = {x: 'grey_' + x
    for x in ('erosion','dilation','opening','closing')}
skimage2ndimage.update({x: x
    for x in ('binary_erosion','binary_dilation',
        'binary_opening','binary_closing',
        'black_tophat','white_tophat')})

def default_fallback(func):
    """Decorator to fall back on ndimage for images with more than 2 dimensions

    Parameters
    ----------
    func : function
        A morphology function such as erosion, dilation, opening, closing,
        white_tophat, or black_tophat.

    Returns
    -------
    func_out : function
        If the image dimentionality is greater than 2D, the ndimage
        function is returned, otherwise skimage function is used.
    """
    
    def func_out(image, selem=None, out=None, **kwargs):
        """Select a function appropriate for the image dimensionality
    
        Parameters
        ----------
        image : ndarray
            Image array.
{'fraction_non_alphanumeric': 0.09566274827725983, 'fraction_numerical': 0.0032428050263477908, 'mean_word_length': 2.476056338028169, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7456664', 'n_tokens_mistral': 689, 'n_tokens_neox': 647, 'n_words': 231}