8c17debc9dc6552da8c317c0c852b55f03c80c61,slm_lab/spec/spec_util.py,,resolve_aeb,#Any#,141

Before Change


            range(agent_num), range(env_num), range(body_num)))
    elif ae_product == "inner":
        ae_coor_itr = zip(range(agent_num), range(env_num))
        aeb_coor_list = list(itertools.product(
            ae_coor_itr, range(body_num)))
        aeb_coor_list = [(a, e, b) for ((a, e), b) in aeb_coor_list]
    else:  // custom AEB, body_num is a coor_list
        aeb_coor_list = [tuple(aeb) for aeb in sorted(body_num)]
    assert is_aeb_compact(
        aeb_coor_list), "Failed check: for a, e, uniq count == len (shape), and for each a,e hash, b uniq count == b len (shape)"

After Change


    body_num = _.get(spec, "body.num")
    body_num_list = body_num if _.is_list(body_num) else [body_num] * env_num

    aeb_list = []
    if ae_product == "outer":
        for e in range(env_num):
            sub_aeb_list = list(itertools.product(
                range(agent_num), [e], range(body_num_list[e])))
            aeb_list.extend(sub_aeb_list)
    elif ae_product == "inner":
        for a, e in zip(range(agent_num), range(env_num)):
            sub_aeb_list = list(
                itertools.product([a], [e], range(body_num_list[e])))
            aeb_list.extend(sub_aeb_list)
    else:  // custom AEB, body_num is a aeb_list
        aeb_list = [tuple(aeb) for aeb in body_num]
    aeb_list.sort()
    assert is_aeb_compact(
        aeb_list), "Failed check: for a, e, uniq count == len (shape), and for each a,e hash, b uniq count == b len (shape)"
    return aeb_list
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/spec/spec_util.py
Class Name:
Method Name: resolve_aeb


Project Name: pfnet/optuna
Commit Name: ab17d5539e5c33c6bacc9a522fd3ae6dd9661314
Time: 2021-03-24
Author: parsiad.azimzadeh@gmail.com
File Name: optuna/_multi_objective.py
Class Name:
Method Name: _get_pareto_front_trials_2d


Project Name: sepandhaghighi/pycm
Commit Name: c973a8c15f08a1d4bd77a796232a1c31a552cafc
Time: 2019-10-04
Author: sabouri.sadra@gmail.com
File Name: pycm/pycm_output.py
Class Name:
Method Name: sparse_table_print