utils/check_dummies.py/create_dummy_object
def create_dummy_object(name, backend_name):
    """Create the code for the dummy object corresponding to `name`."""
    _pretrained = [
        "Config",
        "ForCausalLM",
        "ForConditionalGeneration",
        "ForMaskedLM",
        "ForMultipleChoice",
        "ForObjectDetection",
        "ForQuestionAnswering",
        "ForSegmentation",
        "ForSequenceClassification",
        "ForTokenClassification",
        "Model",
        "Tokenizer",
        "Processor",
    ]
    if name.isupper():
        return DUMMY_CONSTANT.format(name)
    elif name.islower():
        return DUMMY_FUNCTION.format(name, backend_name)
    else:
        is_pretrained = False
        for part in _pretrained:
            if part in name:
                is_pretrained = True
                break
        if is_pretrained:
            return DUMMY_PRETRAINED_CLASS.format(name, backend_name)
        else:
            return DUMMY_CLASS.format(name, backend_name)