def _IsPackageUploadNecessary(self, filename, upload_pkginfo):
    """Returns True if the package file should be uploaded.

    This method helps the client decide whether to upload the entire package
    and package info, or just new package info.  It compares the sha256 hash
    of the existing package on the server with the one of the package file
    which would potentially be uploaded.  If the existing package info is
    not obtainable or not parseable the hash value cannot be compared, so
    True is returned to force an upload.

    Args:
      filename: str, package filename
      upload_pkginfo: str, new pkginfo to upload.
    Returns:
      True if the package file and package info should be uploaded
      False if the package file is same, so just upload package info
    """
    try:
      cur_pkginfo = self.GetPackageInfo(filename)
    except client.SimianServerError:
      return True

    pkginfo_plist = plist.MunkiPackageInfoPlist(cur_pkginfo)

    try:
      pkginfo_plist.Parse()
    except plist.PlistError:
      return True

    pkginfo = pkginfo_plist.GetContents()

    upload_pkginfo = plist.MunkiPackageInfoPlist(upload_pkginfo)
    upload_pkginfo.Parse()

    if pkginfo in 'installer_item_hash':
      cur_sha256_hash = pkginfo['installer_item_hash']
    elif 'uninstaller_item_hash' in pkginfo:
      cur_sha256_hash = pkginfo['uninstaller_item_hash']
    else:
      cur_sha256_hash = None

    upload_pkginfo_dict = upload_pkginfo.GetContents()
    if 'installer_item_size' in upload_pkginfo_dict:
      new_sha256_hash = upload_pkginfo_dict['installer_item_hash']
    else:
      new_sha256_hash = upload_pkginfo_dict['uninstaller_item_hash']

    return cur_sha256_hash != new_sha256_hash
dataset/ETHPy150Open google/simian/src/simian/mac/client/client.py/SimianClient._IsPackageUploadNecessary/swapped operands of `in`