human
Complete this python program:
def _mark_every_path(markevery, tpath, affine, ax_transform):
assistant
#Here is the Python program you requested.

    """Helper function that sorts out how to deal the input
    `markevery` and returns the points where markers should be drawn.
    Takes in the `markevery` value and the line path and returns the
    sub-sampled path.
    """
    (codes, verts) = (tpath.codes, tpath.vertices)
    def _slice_or_none(in_v, slc):
        u'\n                                Helper    function    to    cope    with    `codes`    being    an\n                                ndarray    or    `None`\n                                '
        if (in_v is None):
            return None
        return in_v[slc]
    if isinstance(markevery, float):
        markevery = (0.0, markevery)
    elif isinstance(markevery, int):
        markevery = (0, markevery)
    elif isinstance(markevery, np.integer):
        markevery = (0, markevery.item())
    if isinstance(markevery, tuple):
        if (len(markevery) != 2):
            raise ValueError((u'`markevery`    is    a    tuple    but    its    len    is    not    2;    markevery=%s' % (markevery,)))
        (start, step) = markevery
        if isinstance(step, int):
            if (not isinstance(start, int)):
                raise ValueError((u'`markevery`    is    a    tuple    with    len    2    and    second    element    is    an    int,    but    the    first    element    is    not    an    int;    markevery=%s' % (markevery,)))
            return Path(verts[slice(start, None, step)], _slice_or_none(codes, slice(start, None, step)))
        elif isinstance(step, float):
            if (not (isinstance(start, int) or isinstance(start, float))):
                raise ValueError((u'`markevery`    is    a    tuple    with    len    2    and    second    element    is    a    float,    but    the    first    element    is    not    a    float    or    an    int;    markevery=%s' % (markevery,)))
            disp_coords = affine.transform(tpath.vertices)
            delta = np.empty((len(disp_coords), 2), dtype=float)
            delta[0, :] = 0.0
            delta[1:, :] = (disp_coords[1:, :] - disp_coords[:(-1), :])
            delta = np.sum((delta ** 2), axis=1)
            delta = np.sqrt(delta)
            delta = np.cumsum(delta)
            scale = ax_transform.transform(np.array([[0, 0], [1, 1]]))
     ...