def getstart_temp(self, best_state):
assert(self.dims is not None)<EOL>lrange = self.lower<EOL>urange = self.upper<EOL>fmax = _double_min<EOL>fmin = _double_max<EOL>for _ in range(self.Ninit):<EOL><INDENT>x0 = random.uniform(size=self.dims)*(urange-lrange) + lrange<EOL>fval = self.func(x0, *self.args)<EOL>self.feval += <NUM_LIT:1><EOL>if fval > fmax:<EOL><INDENT>fmax = fval<EOL><DEDENT>if fval < fmin:<EOL><INDENT>fmin = fval<EOL>best_state.cost = fval<EOL>best_state.x = array(x0)<EOL><DEDENT><DEDENT>self.T0 = (fmax-fmin)*<NUM_LIT><EOL>return best_state.x<EOL>
Find a matching starting temperature and starting parameters vector
        i.e. find x0 such that func(x0) = T0.

        Parameters
        ----------
        best_state : _state
            A _state object to store the function value and x0 found.

        Returns
        -------
        x0 : array
            The starting parameters vector.