<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _svg_path(self, pathcodes, data):
 """ Return the SVG path's 'd' element. """

        def gen_path_elements(pathcodes, data):
            counts = {'M': 1, 'L': 1, 'C': 3, 'Z': 0}
            it = iter(data)
            for code in pathcodes:
                yield code
                for _ in range(counts[code]):
                    p = next(it)
                    yield str(p[0])
                    yield str(p[1])

        return ' '.join(gen_path_elements(pathcodes, data))