def import_json_object(instance, json_object):
    "\n        Converts a JSON formatted object to a ListData object.\n\n        Args:\n            json_dictionary(dict): a dictionary that is formatted as JSON\n\n        Returns:\n            \n        Examples:\n            >>> my_json_object = {\n            ... 1: {'label': 'Example', 'value': 3},\n            ... 2: {'label': 'Test', 'value': 1},\n            ... 3: {'label': 'Tryout'}\n            ... }\n            >>> print(my_json_object)\n            {1: {'label': 'Example', 'value': 3}, 2: {'label': 'Test', 'value': 1}, 3: {'label': 'Tryout'}}\n\n            >>> my_list_data = ListData()\n            >>> my_list_data.import_json_object(my_json_object)\n            >>> print(my_list_data.dataset)\n            [['label', 'value'], ['Example', 3], ['Test', 1], ['Tryout', ' ']]\n        "
    from preprocessor.legacy_functions.get_header_index import get_header_index
    try:
        if instance.headers():
            raise Exception('Instance.headers not empty prior to append operation. This method is not compatible with adding new headers/columns.')
    except IndexError:
        headers_list = []
        for (each_entry_id, each_entry_data) in json_object.items():
            for each_field_name in each_entry_data.keys():
                if (each_field_name not in headers_list):
                    headers_list.append(each_field_name)
    instance.dataset.append(headers_list)
    for (each_entry_id, each_entry_data) in json_object.items():
        instance.dataset.append([])
        current_row = instance.dataset[(- 1)]
        while (len(current_row) < len(instance.headers())):
            current_row.append(instance.missing_data_character)
        for (each_field_name, each_field_value) in each_entry_data.items():
            current_field_name_header_index = get_header_index(each_field_name, instance.dataset)
            current_row[current_field_name_header_index] = each_field_value
Converts a JSON formatted object to a ListData object.

Args:
    json_dictionary(dict): a dictionary that is formatted as JSON

Returns:
    
Examples:
    >>> my_json_object = {
    ... 1: {'label': 'Example', 'value': 3},
    ... 2: {'label': 'Test', 'value': 1},
    ... 3: {'label': 'Tryout'}
    ... }
    >>> print(my_json_object)
    {1: {'label': 'Example', 'value': 3}, 2: {'label': 'Test', 'value': 1}, 3: {'label': 'Tryout'}}

    >>> my_list_data = ListData()
    >>> my_list_data.import_json_object(my_json_object)
    >>> print(my_list_data.dataset)
    [['label', 'value'], ['Example', 3], ['Test', 1], ['Tryout', ' ']]
def import_json_object(instance, json_object):
    "\n        Converts a JSON formatted object to a ListData object.\n\n        Args:\n            json_dictionary(dict): a dictionary that is formatted as JSON\n\n        Returns:\n            \n        Examples:\n            >>> my_json_object = {\n            ... 1: {'label': 'Example', 'value': 3},\n            ... 2: {'label': 'Test', 'value': 1},\n            ... 3: {'label': 'Tryout'}\n            ... }\n            >>> print(my_json_object)\n            {1: {'label': 'Example', 'value': 3}, 2: {'label': 'Test', 'value': 1}, 3: {'label': 'Tryout'}}\n\n            >>> my_list_data = ListData()\n            >>> my_list_data.import_json_object(my_json_object)\n            >>> print(my_list_data.dataset)\n            [['label', 'value'], ['Example', 3], ['Test', 1], ['Tryout', ' ']]\n        "
    from preprocessor.legacy_functions.get_header_index import get_header_index
    try:
        if instance.headers():
            raise Exception('Instance.headers not empty prior to append operation. This method is not compatible with adding new headers/columns.')
    except IndexError:
        headers_list = []
        for (each_entry_id, each_entry_data) in json_object.items():
            for each_field_name in each_entry_data.keys():
                if (each_field_name not in headers_list):
                    headers_list.append(each_field_name)
    instance.dataset.append(headers_list)
    for (each_entry_id, each_entry_data) in json_object.items():
        instance.dataset.append([])
        current_row = instance.dataset[(- 1)]
        while (len(current_row) < len(instance.headers())):
            current_row.append(instance.missing_data_character)
        for (each_field_name, each_field_value) in each_entry_data.items():
            current_field_name_header_index = get_header_index(each_field_name, instance.dataset)
            current_row[current_field_name_header_index] = each_field_value