This last extend would perhaps be clearer as:

```python
if sources['objects']:
  ids.extend([obj['resource'] for obj in sources['objects'])
```