def METHOD_NAME(obj):
    # obj.start_date can't be None
    if obj.command != "error":
        if obj.end_date:
            return (obj.end_date - obj.start_date).seconds + (
                        (obj.end_date - obj.start_date).microseconds / 1000000.0)
        else:
            return 'In progress'
    return 'Error'