empty lists are falsey in python, so you can actually do:

    if stats_per_locator: