def to_binary(decimal, length):
        """
        Given a decimal, generate the binary equivalent string of
        given length.
        e.g. binary(2, 5) = 00010
        """
        b = bitstring.Bits(int=decimal, length=length)
        return b.bin
def to_binary ( decimal , length ) : b = bitstring . Bits ( int = decimal , length = length ) return b . bin
Given a decimal, generate the binary equivalent string of
        given length.
        e.g. binary(2, 5) = 00010