def get_available_name(self, name):
        # If the filename already exists, keep adding an underscore to the name
        # of the file until the filename doesn't exist.
        while self.exists(name):
            try:
                dot_index = name.rindex('.')
            except ValueError: # filename has no dot
                name += '_'
            else:
                name = name[:dot_index] + '_' + name[dot_index:]
        return name
Convert an Enaml Image into a QImage.
dataset/ETHPy150Open dcramer/django-compositepks/django/core/files/storage.py/Storage.get_available_name--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/q_resource_helpers.py/QImage_from_Image