def METHOD_NAME(entity, locale_code, string):
    """
    Run all compare-locales checks on provided translation and entity.
    :arg pontoon.base.models.Entity entity: Source entity instance
    :arg basestring locale_code: Locale of a translation
    :arg basestring string: translation string
    :return: Dictionary with the following structure:
        {
            'clErrors': [
                'Error1',
            ],
            'clWarnings': [
                'Warning1',
            ]
        }
        Both keys are optional.
    """
    resource_ext = f".{entity.resource.format}"
    extra_tests = None
    if "mobile/android/base" in entity.resource.path:
        extra_tests = {"android-dtd"}
        entity.string = escape_quotes(entity.string)
        string = escape_quotes(string)
    source_ent, translation_ent = cast_to_compare_locales(
        resource_ext,
        entity,
        string,
    )
    checker = getChecker(
        File(entity.resource.path, entity.resource.path, locale=locale_code),
        extra_tests,
    )
    if checker is None:
        # compare-locales has no checks for this format, it's OK.
        return {}
    # Currently, references are required only by DTD files but that may change in the future.
    if checker.needs_reference:
        references = KeyedTuple(
            CompareDTDEntity(
                e.key,
                e.string,
                e.comment,
            )
            for e in entity.resource.entities.all()
        )
        checker.set_reference(references)
    errors = {}
    for severity, _, message, _ in checker.check(source_ent, translation_ent):
        messages = errors.setdefault("cl%ss" % severity.capitalize(), [])
        # Old-school duplicate prevention - set() is not JSON serializable
        if message not in messages:
            messages.append(message)
    return errors