You could simplify that to 
````python
elif d not in ('', 'NOT_IMPLEMENTED', None)
````