def METHOD_NAME(stitches, repeats, bean_stitch_repeats):
    if any(bean_stitch_repeats):
        # add bean stitches, but ignore travel stitches
        stitches = bean_stitch(stitches, bean_stitch_repeats, ['auto_fill_travel'])
    if repeats:
        for i in range(1, repeats):
            if i % 2 == 1:
                # reverse every other pass
                stitches.extend(stitches[::-1])
            else:
                stitches.extend(stitches)
    return stitches