'Returns the locations as a generator.'

def _get_locations(self, location=None):

    if (location is not None):
        (yield location)
    else:
        for loc in self.list_locations():
            (yield loc)
