def check_model_structure(model):
    """Checks the model structure to see if it contains all the needed keys

    """
    return (isinstance(model, dict) and 'resource' in model and
            model['resource'] is not None and
            ('object' in model and 'model' in model['object'] or
             'model' in model))
dataset/ETHPy150Open bigmlcom/python/bigml/modelfields.py/check_model_structure/original