<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _locate_index(self, index):
 """ given index, find out sub-db and sub-index Parameters index : int index of a specific image Returns a tuple (sub-db, sub-index) """

        assert index >= 0 and index < self.num_images, "index out of range"
        pos = self.image_set_index[index]
        for k, v in enumerate(self.imdbs):
            if pos >= v.num_images:
                pos -= v.num_images
            else:
                return (k, pos)