Probably better to move it a closer to where `attrs` is used (at the end of the function).

If you like, you could make it a one-liner:
```python
attrs = self.attrs if keep_attrs else {}
```

(The attributes dictionary is always copied, so it doesn't matter whether you provide it as an OrderedDict or a normal dict.)