def _bit_str(bits, mask_names):
  """Convert a bit field to list of names.

  Args:
    bits: an int that holds a combined bit field.
    mask_names: a mapping from individual bit masks to names.

  Returns:
    A human readable presentation of the combined bit field.
  """
  hex_str = hex(bits)
  names = []
  mask = 0x1
  while bits:
    if bits & mask:
      bits &= ~mask
      names.append(mask_names.get(mask, mask % '(0x%x)'))
    mask <<= 1
  return '%s (%s)' % ('|'.join(names), hex_str)
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/inotify_file_watcher.py/_bit_str/swapped operands of `%`