8f50f1ec380766a9c197b0238c5ddb4ad2362ca4,skorch/history.py,History,__getitem__,#History#Any#,177

Before Change


        // handles: history[..., k_e, i_b][k_b]
        if k_b is not None:
            items = [
                _filter_none([_getitem(b, k_b) for b in batches])
                if isinstance(batches, (list, tuple))
                else _getitem(batches, k_b)
                for batches in items

After Change


        // extract epoch-level values, but only if not already done
        // handles: history[..., k_e]
        if (k_e is not None) and (i_b is None):
            if not items:
                raise KeyError(keyerror_msg.format(k_e))

            extract = _get_getitem_method(items[0], k_e)
            items = [extract(item, k_e) for item in items]
            if not _filter_none(items):
                raise KeyError(keyerror_msg.format(k_e))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: dnouri/skorch
Commit Name: 8f50f1ec380766a9c197b0238c5ddb4ad2362ca4
Time: 2020-12-20
Author: b.bossan@gmail.com
File Name: skorch/history.py
Class Name: History
Method Name: __getitem__


Project Name: flow-project/flow
Commit Name: 560b8b450da344aff0b9d6ff9751c1230c1b07ec
Time: 2018-09-20
Author: kathyjang@gmail.com
File Name: flow/envs/green_wave_env.py
Class Name: PO_TrafficLightGridEnv
Method Name: __init__


Project Name: facebookresearch/ParlAI
Commit Name: 7415a04e39e0ba687f4cd468dede3e24315e5984
Time: 2020-11-08
Author: roller@fb.com
File Name: parlai/core/teachers.py
Class Name: StreamDialogData
Method Name: __init__