bff50cfc37380140d53debfb140e262a38668db0,python/ray/autoscaler/_private/kubernetes/config.py,,_get_resource,#Any#Any#Any#,102

Before Change




def _get_resource(container_resources, resource_name, field_name):
    if (field_name in container_resources
            and resource_name in container_resources[field_name]):
        return _parse_resource(container_resources[field_name][resource_name])
    else:
        return float("inf")

After Change


    if field_name not in container_resources:
        // No limit/resource field.
        return float("inf")
    resources = container_resources[field_name]
    // Look for keys containing the resource_name. For example,
    // the key "nvidia.com/gpu" contains the key "gpu".
    matching_keys = [key for key in resources if resource_name in key.lower()]
    if len(matching_keys) == 0:
        return float("inf")
    if len(matching_keys) > 1:
        // Should have only one match -- mostly relevant for gpu.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: ray-project/ray
Commit Name: bff50cfc37380140d53debfb140e262a38668db0
Time: 2020-12-18
Author: 62982571+Gekho457@users.noreply.github.com
File Name: python/ray/autoscaler/_private/kubernetes/config.py
Class Name:
Method Name: _get_resource


Project Name: uber/ludwig
Commit Name: 7169a99e6c53ff162ee3417bec5e2e554dddd163
Time: 2020-05-04
Author: jimthompson5802@gmail.com
File Name: ludwig/models/modules/combiners.py
Class Name: ConcatCombiner
Method Name: call


Project Name: evilsocket/pwnagotchi
Commit Name: 90b0e10e81a5a0e03753715ec1034278bdd5f600
Time: 2019-10-07
Author: evilsocket@gmail.com
File Name: pwnagotchi/plugins/default/api.py
Class Name:
Method Name: parse_pcap