def _IsFile(self, filename, requires_root=False, sudo_ok=False):
    """Check if a file exists and is a file.

    Args:
      filename: str, filename to check
      requires_root: bool, optional, whether root is required to read
      sudo_ok: bool, optional, whether sudo may be used for root file access
    Returns:
      bool, True if the file exists
    """
    if requires_root and os.getuid() != 0 and sudo_ok:
      try:
        # the path location of bash is more standard than that of test(1)
        self._SudoExec(
            ['/bin/bash', '-c', filename % '[ -f %s ]'],
            expect_rc=0)
        return True
      except SudoExecError:
        return False
    else:
      return os.path.isfile(filename)
dataset/ETHPy150Open google/simian/src/simian/client/client.py/HttpsAuthClient._IsFile/swapped operands of `%`