def _normalize_utf8_keys(kwargs):
  if any(type(key) is six.binary_type for key in kwargs.keys()):
    # This is to preserve the original dict type for kwargs.
    dict_type = type(kwargs)
    return dict_type([(six.text_type(k), v) for k, v in kwargs.items()])
  return kwargs
When kwargs are passed literally in a source file, their keys are ascii: normalize.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/engine/exp/struct.py/_normalize_utf8_keys