def METHOD_NAME(api, cfg, job_id, model_name):
    """
    Gets the status of the given training job id
    Arguments :
        api : object, API object to access CloudML Engine
        cfg : dict, Configurations from yaml file
        job_id : string, Job ID of the training job
        model_name : string, Name of the model
    Returns :
        job_response : string, State of the executed training job
        project_id : string, project id of the project
        model_id : string, model id of the project
    """
    project_id = 'projects/{}'.format(cfg['project_id'])
    model_id = '{}/models/{}'.format(project_id, model_name)
    job_response = api.projects().jobs().get(
        name='{}/jobs/{}'.format(project_id, job_id)).execute()
    return job_response['state'], project_id, model_id