Sorry if I am nitpicking, and also given that I just started following this project; Isn't it better to use 'enumerate' construct here.
i.e. something like below:

```
    if type(labels) == list:
        # Convert any given Label objects to strings
        for (index,val) in enumerate(labels):
            if type(val) == Label:
                labels[index] = val.name

```