def get_cost_fns(self, topic):
        """Returns a list of tuples containing weights and cost functions to
        use for weighing hosts
        """
        if topic in self.cost_fns_cache:
            return self.cost_fns_cache[topic]
        cost_fns = []
        for cost_fn_str in FLAGS.least_cost_scheduler_cost_functions:
            if '.' in cost_fn_str:
                short_name = cost_fn_str.split('.')[-1]
            else:
                short_name = cost_fn_str
                cost_fn_str = "%s.%s.%s" % (
                        __name__, self.__class__.__name__, short_name)
            if not (short_name.startswith('%s_' % topic) or
                    short_name.startswith('noop')):
                continue

            try:
                # NOTE(sirp): import_class is somewhat misnamed since it can
                # any callable from a module
                cost_fn = utils.import_class(cost_fn_str)
            except exception.ClassNotFound:
                raise exception.SchedulerCostFunctionNotFound(
                        cost_fn_str=cost_fn_str)

            try:
                flag_name = "%s_weight" % cost_fn.__name__
                weight = getattr(FLAGS, flag_name)
            except __HOLE__:
                raise exception.SchedulerWeightFlagNotFound(
                        flag_name=flag_name)
            cost_fns.append((weight, cost_fn))

        self.cost_fns_cache[topic] = cost_fns
        return cost_fns
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/scheduler/least_cost.py/LeastCostScheduler.get_cost_fns