def _valid_registration(content):
    fields = [('hostname', basestring), ('checks', dict), ('roles', list)]
    for field in fields:
        if field[0] in content:
            if not isinstance(content[field[0]], field[1]):
                return False
        else:
            return False
    # validate checks each should have a interval and args field
    for check in content['checks']:
        if not isinstance(content['checks'][check], dict):
            return False
        if 'interval' not in content['checks'][check]:
            return False
        if not isinstance(content['checks'][check]['interval'], int):
            return False
        if not isinstance(content['checks'][check]['follow_up'], int):
            return False
        if content['checks'][check] not in 'args':
            return False
        if 'priority' in content['checks'][check]:
            if not isinstance(content['checks'][check]['priority'], int):
                return False
        if not isinstance(content['checks'][check]['args'], basestring):
            return False
    # everything checked out
    return True
dataset/ETHPy150Open pandemicsyn/stalker/stalkerweb/stalkerweb/views.py/_valid_registration/swapped operands of `not in`