def make_reducer(delimiter):
    """Create a reducer with a custom delimiter.
    Parameters
    ----------
    delimiter : str
        Delimiter to use to join keys.
    Returns
    -------
    f : Callable
        Callable that can be passed to `flatten()`'s `reducer` argument.
    """

    def f(k1, k2):
        if k1 is None:
            return k2
        else:
            return "{}{}{}".format(k1, delimiter, k2)

    return f