public String getLanguageTypeNameForTypeReference(TypeReference typeReference, String encoding) {
        if (typeReference == null) {
            // TODO: shouldn't this be an error case
            return "";
        }
        if (typeReference.isArrayTypeReference()) {
            // We can use the array type reference to generate code for the type of the array.
            final ArrayTypeReference arrayTypeReference = (ArrayTypeReference) typeReference;
            TypeReference elementTypeReference = arrayTypeReference.getElementTypeReference();
            emitRequiredImport("from typing import List");
            // We use List to represent an array in python, as the type system doesn't support arrays.
            // We also use the name of the element type as the type parameter.
            return "List[" + getLanguageTypeNameForTypeReference(elementTypeReference) + "]";
        }
        if (typeReference.isNonSimpleTypeReference()) {
            // We have a complex type, such as a data io type or a custom type.
            emitRequiredImport("from plc4py.protocols." + protocolName + "." + flavorName.replace("-", "") + "." + typeReference.asNonSimpleTypeReference().orElseThrow().getName() + " import " + typeReference.asNonSimpleTypeReference().orElseThrow().getName());
            // We import the name of the complex type, and then use the name of the complex type as the type name.
            return typeReference.asNonSimpleTypeReference().orElseThrow().getName();
        }
        if (typeReference instanceof ByteOrderTypeReference) {
            // Byte order is represented by a class in the protocol, so we import that class and use its name as the type name.
            return "binary.ByteOrder";
        }
        SimpleTypeReference simpleTypeReference = typeReference.asSimpleTypeReference().orElseThrow();
        switch (simpleTypeReference.getBaseType()) {
            case BIT:
                // Bit is represented by a boolean in python.
                return "bool";
            case BYTE:
                // Byte is represented by an integer in python.
                return "int";
            case UINT:
                // Unsigned integer is represented by an integer in python, with the appropriate size.
                IntegerTypeReference unsignedIntegerTypeReference = simpleTypeReference.asIntegerTypeReference().orElseThrow();
                int sizeInBits = unsignedIntegerTypeReference.getSizeInBits();
                if (sizeInBits <= 8) {
                    // Size <= 8 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInBits <= 16) {
                    // Size <= 16 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInBits <= 32) {
                    // Size <= 32 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInBits <= 64) {
                    // Size <= 64 bit is represented by an int in python.
                    return "int";
                }
                // Size > 64 bit is not supported in python.
                throw new UnsupportedOperationException("Size > 64 bit is not supported in python");
            case INT:
                // Integer is represented by an integer in python, with the appropriate size.
                IntegerTypeReference integerTypeReference = simpleTypeReference.asIntegerTypeReference().orElseThrow();
                int sizeInIntegerBits = integerTypeReference.getSizeInBits();
                if (sizeInIntegerBits <= 8) {
                    // Size <= 8 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInIntegerBits <= 16) {
                    // Size <= 16 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInIntegerBits <= 32) {
                    // Size <= 32 bit is represented by an int in python.
                    return "int";
                }
                if (sizeInIntegerBits <= 64) {
                    // Size <= 64 bit is represented by an int in python.
                    return "int";
                }
                // Size > 64 bit is not supported in python.
                throw new UnsupportedOperationException("Size > 64 bit is not supported in python");
            case FLOAT:
            case UFLOAT:
                // Float is represented by a float in python, with the appropriate size.
                FloatTypeReference floatTypeReference = simpleTypeReference.asFloatTypeReference().orElseThrow();
                int sizeInFloatBits = floatTypeReference.getSizeInBits();
                if (sizeInFloatBits <= 32) {
                    // Size <= 32 bit is represented by a float in python.
                    return "float";
                }
                if (sizeInFloatBits <= 64) {
                    // Size <= 64 bit is represented by a float in python.
                    return "float";
                }
                // Size > 64 bit is not supported in python.
                throw new UnsupportedOperationException("Size > 64 bit is not supported in python");
            case STRING:
            case VSTRING:
                // String is represented by a str in python.
                return "str";
            case TIME:
            case DATE:
            case DATETIME:
                // Time is represented by a datetime in python.
                return "datetime";
            default:
                // For all other types, an error should be thrown.
                throw new FreemarkerException("Unsupported simple type");
        }
    }
Get the language name for a given type reference.
This method is used to generate code for type references
in the generated code.

@param typeReference the type reference for which the language name should be generated
@param encoding the encoding for the type reference, if applicable
@return the language name for the given type reference
code-generation/language-python/src/main/java/org/apache/plc4x/language/python/PythonLanguageTemplateHelper.java