我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用pip._vendor.six.viewkeys()。
def adjust_attributes(token, replacements): if PY3 or _utils.PY27: needs_adjustment = viewkeys(token['data']) & viewkeys(replacements) else: needs_adjustment = frozenset(token['data']) & frozenset(replacements) if needs_adjustment: token['data'] = OrderedDict((replacements.get(k, k), v) for k, v in token['data'].items())