import json


def is_valid_json(x):
    """Returns true if x can be JSON serialized

    Args:
        x: Object to test
    """
    try:
        json.dumps(x)
        return True
    except TypeError:
        return False