<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_fields(model):
 """ Returns a Model's knockout_fields, or the default set of field names. """


    try:
        if hasattr(model, "knockout_fields"):
            fields = model.knockout_fields()
        else:
            try:
                fields = model_to_dict(model).keys()
            except Exception as e:
                fields = model._meta.get_fields()
        return fields

    # Crash proofing
    except Exception as e:
        logger.exception(e)
        return []