def safe_dict_min(key, data):
    min_value = None
    for d in data:
        if (key in d) and (d[key] is not None):
            try:
                val = int(d[key])
            except ValueError:
                raise exc.OpenStackCloudException(
                    "Search for minimum value failed. "
                    "Value for {key} is not an integer: {value}".format(
                        key=key, value=d[key])
                )
            if (min_value is None) or (val < min_value):
                min_value = val
    return min_value
Safely find the minimum for a given key in a list of dict objects.
dataset/ETHPy150Open openstack-infra/shade/shade/_utils.py/safe_dict_min