def minimize(self, parameter, interval, stepsize, args, algorithm, parallel=True):

        diff = interval[1] - interval[0]
        if(diff % stepsize > 0):
            raise Exception("Steps dont fit into interval")
        steps = int(diff / stepsize)

        values = []
        for step in xrange(steps):
            value = interval[0] + step * stepsize
            values.append(value)

        self.results = {}

        run = lambda val : self._run_value(val, parameter, args, algorithm)
        if(parallel):
            task = values
            cpus = cpu_count()
            tl = int(float(len(values)) / float(cpus))
            carryover = len(values) % cpus

            task_slices = [task[i * tl : (i+1) * tl] for i in range(0, cpus)]
            if(carryover > 0):
                task_slices.append(task[cpus * tl:])

            sequential = lambda lis : map(run, lis)

            results = pmap(sequential, task_slices)
        else:
            results = map(run, values)

        aggregated = sum(results, [])
        self.results = dict(aggregated)

        tus = [(val, error) for val, error in self.results.iteritems()]
        sortedtus = sorted(tus, key = lambda t : t[1])
        best_val, best_error = sortedtus[0]

        return best_val, best_error
Set the name.
dataset/ETHPy150Open cigroup-ol/windml/windml/optimization/grid_search.py/GridSearch.minimize--crossover with--dataset/ETHPy150Open lyda/chkcrontab/chkcrontab_lib.py/CronTimeFieldLimit._SetName