import json


def is_valid_json(j):
    """
    Tries to load the json to test if it is valid.

    :param j: The json to test.
    :return: True if the json is valid, False on any exception.
    """
    try:
        json.dumps(j)
        return True
    except json.JSONDecodeError:
        print("not valid json")
        return False