merge_machine/api.py
def update_labeller(project_id):
    '''
    Send an user input to the labeller and receive the updated labeller state    
    
    GET:
        project_id: ID for "link" project
    
    POST:
        module_params:
            user_input: #TODO: document
    '''
    _, module_params = _parse_request()
    logging.info(module_params)
    user_input = module_params['user_input']

    proj = ESLinker(project_id=project_id)
    labeller = proj.labeller_from_json()

    if labeller.answer_is_valid(user_input):
        labeller.update(user_input)
    else:
        raise ValueError('Answer received "{0}" is not valid'.format(user_input))
    
    proj.labeller_to_json(labeller)
        
    encoder = MyEncoder()
    return jsonify(error=False,
                   result=encoder.encode(labeller.to_emit()))

    Send an user input to the labeller and receive the updated labeller state    
    
    GET:
        project_id: ID for "link" project
    
    POST:
        module_params:
            user_input: #TODO: document
    
Send an user input to the labeller and receive the updated labeller state
GET:
project_id: ID for "link" project

#TODO: document
Send an user input to the labeller and receive the updated labeller state GET : project_id : ID for " link " project #TODO : document
def update_labeller(project_id):
    _, module_params = _parse_request()
    logging.info(module_params)
    user_input = module_params['user_input']
    proj = ESLinker(project_id=project_id)
    labeller = proj.labeller_from_json()
    if labeller.answer_is_valid(user_input):
        labeller.update(user_input)
    else:
        raise ValueError('Answer received "{0}" is not valid'.format(user_input))
    proj.labeller_to_json(labeller)
    encoder = MyEncoder()
    return jsonify(error=False,
                   result=encoder.encode(labeller.to_emit()))
def update_labeller ( project_id ) : _ , module_params = _parse_request ( ) logging . info ( module_params ) user_input = module_params [ 'user_input' ] proj = ESLinker ( project_id = project_id ) labeller = proj . labeller_from_json ( ) if labeller . answer_is_valid ( user_input ) : labeller . update ( user_input ) else : raise ValueError ( 'Answer received "{0}" is not valid' . format ( user_input ) ) proj . labeller_to_json ( labeller ) encoder = MyEncoder ( ) return jsonify ( error = False , result = encoder . encode ( labeller . to_emit ( ) ) )
Send an user input to the labeller and receive the updated labeller state
GET:
project_id: ID for "link" project
Send an user input to the labeller and receive the updated labeller state GET : project_id : ID for " link " project
'''
    Send an user input to the labeller and receive the updated labeller state    
    
    GET:
        project_id: ID for "link" project
    
    POST:
        module_params:
            user_input: #TODO: document
    '''
project_id