This would be better as:

```
if settings_file is None:
    current_directory = os.path.dirname(os.path.realpath(__file__))
    settings_file = os.path.join(current_directory, "settings.json"))

with open(settings_file) as source:
    self.index_settings = json.load(source)
```