def get_locator(self, dmin, dmax):
_check_implicitly_registered()<EOL>delta = relativedelta(dmax, dmin)<EOL>num_days = (delta.years * <NUM_LIT> + delta.months) * <NUM_LIT> + delta.days<EOL>num_sec = (delta.hours * <NUM_LIT> + delta.minutes) * <NUM_LIT> + delta.seconds<EOL>tot_sec = num_days * <NUM_LIT> + num_sec<EOL>if abs(tot_sec) < self.minticks:<EOL><INDENT>self._freq = -<NUM_LIT:1><EOL>locator = MilliSecondLocator(self.tz)<EOL>locator.set_axis(self.axis)<EOL>locator.set_view_interval(*self.axis.get_view_interval())<EOL>locator.set_data_interval(*self.axis.get_data_interval())<EOL>return locator<EOL><DEDENT>return dates.AutoDateLocator.get_locator(self, dmin, dmax)<EOL>
Pick the best locator based on a distance.