human
I found an interesting problem on https://www.codewars.com/kata/542ea700734f7daff80007fc:
In this task you have to code process planner.

You will be given initial thing, target thing and a set of processes to turn one thing into another (in the form of _[process\_name, start\_thing, end\_thing]_). You must return  names of shortest sequence of processes to turn initial thing into target thing, or empty sequence if it's impossible.

If start already equals end, return [], since no path is required.

Example: 

```python
test_processes = [
        ['gather', 'field', 'wheat'],
        ['bake', 'flour', 'bread'],
        ['mill', 'wheat', 'flour']
];

processes('field', 'bread', test_processes) # should return ['gather', 'mill', 'bake']
processes('field', 'ferrari', test_processes) # should return []
processes('field', 'field', test_processes) # should return [], since no processes are needed
```

Good luck!

I tried it in Python, but could not do it. Can you solve it?

 Give me a the Python program you requested?
assistant
#Here is the Python program you requested.

def processes(start, end, procs):
    def _p(start, end, procs, re_):
        for step in procs:
            res = re_[:]
            if step[1] == start:
                res.append(step[0])

                _p(step[2], end, [x for x in procs if x != step], res)

                if step[2] == end:
                    _p.gres.append(res);

    _p.gres = []
    _p(start, end, procs, [])
    return min(_p.gres, key=lambda x: len(x)) if _p.gres else []