'Run a visualization\'s data_source tests to find out if
it can be applied to the target_object.'

def is_object_applicable(self, trans, target_object, data_source_tests):

    for test in data_source_tests:
        test_type = test['type']
        result_type = test['result_type']
        test_result = test['result']
        test_fn = test['fn']
        if (test_type == 'isinstance'):
            if (result_type == 'datatype'):
                datatype_class_name = test_result
                test_result = trans.app.datatypes_registry.get_datatype_class_by_name(datatype_class_name)
                if (not test_result):
                    continue
        if test_fn(target_object, test_result):
            return True
    return False
