def friendly_string(self, num, size):
        """ Convert a base 10 number to a base X string.
            Charcters from VALID_CHARS are chosen, to convert the number 
            to eg base 24, if there are 24 characters to choose from.
            Use valid chars to choose characters that are friendly, avoiding
            ones that could be confused in print or over the phone.
        """
        # Convert to a (shorter) string for human consumption
        string = ""
        # The length of the string can be determined by self.string_length or by how many
        # characters are necessary to present a base 30 representation of SIZE.
        while self.string_length and len(string) <= self.string_length \
                    or self.number_valid_chars**len(string) <= size:
            # PREpend string (to remove all obvious signs of order)
            string = self.valid_chars[self.number_valid_chars % num] + string
            num = num / self.number_valid_chars
        return string
dataset/ETHPy150Open willhardy/Roll-Your-Own/rollyourown/commerce/utils/friendly_id.py/FriendlyID.friendly_string/swapped operands of `%`