def name_to_id(self, name, add_if_missing=False):
        if type(name) is str:
            # lookup name or assign new
            if name not in self.names:
                if not add_if_missing:
                    raise ValueError("name " + name + " not found")
                # Use an empty slot in the list if one exists.
                try:
                    id_ = self.names.index(None)
                    self.names[id_] = name
                    self.hashesperid[id_] = 0
                except ValueError:
                    self.names.append(name)
                    self.hashesperid = np.append(self.hashesperid, [0])
            id_ = self.names.index(name)
        else:
            # we were passed in a numerical id
            id_ = name
        return id_
Get range warning/error message
dataset/ETHPy150Open dpwe/audfprint/hash_table.py/HashTable.name_to_id--crossover with--dataset/ETHPy150Open mikrosimage/ColorPipe-tools/utils/clcc_helper.py/CLCCHelper._get_range_message