public int getNumBits(SimpleTypeReference simpleTypeReference) {
        switch (simpleTypeReference.getBaseType()) {
            case BIT:
                // bit is always 1 bit
                return 1;
            case BYTE:
                // byte is always 8 bits
                return 8;
            case UINT:
            case INT:
                // integer type references have a variable number of bits depending on the
                // size specified by the type reference
                IntegerTypeReference integerTypeReference = (IntegerTypeReference) simpleTypeReference;
                return integerTypeReference.getSizeInBits();
            case FLOAT:
                // float type references have a variable number of bits depending on the
                // precision specified by the type reference
                FloatTypeReference floatTypeReference = (FloatTypeReference) simpleTypeReference;
                return floatTypeReference.getSizeInBits();
            case STRING:
            case VSTRING:
                // string type references have a variable number of bits depending on the
                // length of the string
                StringTypeReference stringTypeReference = (StringTypeReference) simpleTypeReference;
                return stringTypeReference.getSizeInBits();
            default:
                // for all other types, return 0 as there is no meaningfull number of bits
                return 0;
        }
    }
Returns the number of bits for the given simple type reference.

@param simpleTypeReference the simple type reference to get the number of bits for
@return the number of bits for the given simple type reference
code-generation/language-python/src/main/java/org/apache/plc4x/language/python/PythonLanguageTemplateHelper.java