import re


def get_bitwidth(input_type):
    """
    given a string input type e.g. bool, uint32_t, return the number of bits,
    (i.e. 2 or 32 for the examples above)
    """
    bitwidth_match = re.search("[\d]+",input_type)
    if bitwidth_match:
        bitwidth = int(bitwidth_match.group())
    else:
        bitwidth = 1
    return bitwidth