human
Complete this python program:
def makeSplitter(lstrip=None, sep='|', comments=True, origNotesSep='    (', newNotesSep='::(', strip=None):
assistant
#Here is the Python code you requested.

    """Return a splitter function suitable for a given set of data.
    """
    def splitter(x):
        if (not x):
            return x
        x = x.strip()
        if (not x):
            return x
        if (lstrip is not None):
            x = x.lstrip(lstrip).lstrip()
        lx = x.split(sep)
        lx[:] = filter(None, [j.strip() for j in lx])
        if comments:
            lx[:] = [j.replace(origNotesSep, newNotesSep, 1) for j in lx]
        if strip:
            lx[:] = [j.strip(strip) for j in lx]
        return lx
    return splitter