Can this just be
```python
if not function:
    function = self._run_proxy
```
then it adds a lot less noise.