`.keys()` is unnecessary, you can just do `if 'tags' in net`.