def int_to_bit_str(number, dimensionality=-1):
    """Convert an integer number to a bit string

    Can also be passed a dimensionality to pad the bit string with
    leading zeros. Example:
        2 with no dimensionality would be "10"
        2 with dimensionality 5 would be "00010"

    Args:
        number: the integer number to be converted
        dimensionality: if supplied, will be used to pad the bit string
                        with leading zeros

    Returns:
        bit string representation of the integer
    """
    bit_str = bin(number)[2:]
    if dimensionality > 0:
        missing_leading_zeros = dimensionality - len(bit_str)
        bit_str = '0' * missing_leading_zeros + bit_str
    return bit_str
