Maybe something like this will work for these cases, if they are 100% outliers, trouble is that it fights with GitHub, which is not great.
https://github.com/.../get-started/mnist_mlp.py?#L16-L18-context-3
Or even maybe just include context out of the box if the region is 4 lines or less.