def get_scope(fname):
    """ Return the scope of the res file so that results on the same dataset can be paired. """
    city = fname[:2]
    if 'targetbase' in fname:
        return city, 'base'
    elif 'targetcategory' in fname:
        return city, 'category'
    else:
        raise ValueError('%s do not have a scope' % fname)