def METHOD_NAME(a, b):
    if 'rank' not in a:
        return 1
    if 'rank' not in b:
        return -1
    if a['rank'] == b['rank']:
        return 0
    if a['rank'] == -1:
        return 1
    if b['rank'] == -1:
        return -1
    if a['rank'] < b['rank']:
        return -1
    return 1