Returns true if the resource has changed (either the contents or the tags)
558887
protected EncodedResource populateResourceIntoEntity(RequestDetails theRequest, IBaseResource theResource, ResourceTable theEntity, boolean theUpdateHash) {
		if (theEntity.getResourceType() == null) {
			theEntity.setResourceType(toResourceName(theResource));
		}

		if (theResource != null) {
			List<BaseResourceReferenceDt> refs = myContext.newTerser().getAllPopulatedChildElementsOfType(theResource, BaseResourceReferenceDt.class);
			for (BaseResourceReferenceDt nextRef : refs) {
				if (nextRef.getReference().isEmpty() == false) {
					if (nextRef.getReference().hasVersionIdPart()) {
						nextRef.setReference(nextRef.getReference().toUnqualifiedVersionless());
					}
				}
			}
		}

		byte[] bytes;
		ResourceEncodingEnum encoding;
		boolean changed = false;

		if (theEntity.getDeleted() == null) {

			encoding = myConfig.getResourceEncoding();
			Set<String> excludeElements = ResourceMetaParams.EXCLUDE_ELEMENTS_IN_ENCODED;
			theEntity.setFhirVersion(myContext.getVersion().getVersion());

			bytes = encodeResource(theResource, encoding, excludeElements, myContext);

			if (theUpdateHash) {
				HashFunction sha256 = Hashing.sha256();
				String hashSha256 = sha256.hashBytes(bytes).toString();
				if (hashSha256.equals(theEntity.getHashSha256()) == false) {
					changed = true;
				}
				theEntity.setHashSha256(hashSha256);
			}

			Set<ResourceTag> allDefs = new HashSet<>();
			Set<ResourceTag> allTagsOld = getAllTagDefinitions(theEntity);

			if (theResource instanceof IResource) {
				extractTagsHapi((IResource) theResource, theEntity, allDefs);
			} else {
				extractTagsRi((IAnyResource) theResource, theEntity, allDefs);
			}

			RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource);
			if (def.isStandardType() == false) {
				String profile = def.getResourceProfile("");
				if (isNotBlank(profile)) {
					TagDefinition profileDef = getTagOrNull(TagTypeEnum.PROFILE, NS_JPA_PROFILE, profile, null);
					if (def != null) {
						ResourceTag tag = theEntity.addTag(profileDef);
						allDefs.add(tag);
						theEntity.setHasTags(true);
					}
				}
			}

			Set<ResourceTag> allTagsNew = getAllTagDefinitions(theEntity);
			Set<TagDefinition> allDefsPresent = new HashSet<>();
			allTagsNew.forEach(tag -> {

				// Don't keep duplicate tags
				if (!allDefsPresent.add(tag.getTag())) {
					theEntity.getTags().remove(tag);
				}

				// Drop any tags that have been removed
				if (!allDefs.contains(tag)) {
					if (shouldDroppedTagBeRemovedOnUpdate(theRequest, tag)) {
						theEntity.getTags().remove(tag);
					}
				}

			});

			if (!allTagsOld.equals(allTagsNew)) {
				changed = true;
			}
			theEntity.setHasTags(!allTagsNew.isEmpty());

		} else {
			theEntity.setHashSha256(null);
			bytes = null;
			encoding = ResourceEncodingEnum.DEL;
		}

		if (changed == false) {
			if (theEntity.getId() == null) {
				changed = true;
			} else {
				ResourceHistoryTable currentHistoryVersion = myResourceHistoryTableDao.findForIdAndVersion(theEntity.getId(), theEntity.getVersion());
				if (currentHistoryVersion == null || currentHistoryVersion.getResource() == null) {
					changed = true;
				} else {
					changed = !Arrays.equals(currentHistoryVersion.getResource(), bytes);
				}
			}
		}

		EncodedResource retVal = new EncodedResource();
		retVal.setEncoding(encoding);
		retVal.setResource(bytes);
		retVal.setChanged(changed);

		return retVal;
	}
262605
def has_tag? tag
      selected.each do |view|
        return true if view.rmq_data.has_tag?(tag)
      end
      false # tag doesn't exist if we got here
    end
1014021
def changed(self):
        
        # Not installed modules cannot issue a change to save
        if not self.installed:
            return False

        # Check if module status changed
        if self._info._changed:
            return True

        # Check model changes
        for model in self.models():
            if model.objects.changed().count() or \
               model.objects.deleted().count():
                return True

        # Nothing passed, module not changed
        return False
600403
def isModified(self):
        
        # NOTE: only check content digest if locally cached content is set
        # (content already pulled or new content set); otherwise this
        # results in pulling content down to checksum it !
        return self.info_modified or \
            self._content and self._content_digest() != self.digest
1158812
def has_changed(self, initial, data):
        ""
        if initial is None and data is None:
            return False
        if data and not hasattr(data, '__iter__'):
            data = self.widget.decompress(data)
        initial = self.to_python(initial)
        data = self.to_python(data)
        if hasattr(self, '_coerce'):
            data = self._coerce(data)
        if isinstance(data, Model) and isinstance(initial, Model):
            return model_vars(data) != model_vars(initial)
        else:
            return data != initial
1110957
public boolean checkIfChanged(Collection<Host> hostsUp, Collection<Host> hostsDown) {
		boolean changed = activeSetChanged(hostsUp) || inactiveSetChanged(hostsUp, hostsDown);

		if (changed && logger.isDebugEnabled()) {
			Set<Host> changedHostsUp = new HashSet<>(hostsUp);
			changedHostsUp.removeAll(activeHosts);
			changedHostsUp.forEach(x -> logger.debug("New host up: {}", x.getHostAddress()));

			Set<Host> changedHostsDown = new HashSet<>(hostsDown);
			changedHostsDown.removeAll(inactiveHosts);
			changedHostsDown.forEach(x -> logger.debug("New host down: {}", x.getHostAddress()));
		}
		return changed;
	}
1032143
public final boolean isModified ()
    {
        int mcount = _modified.length;
        for (int ii = 0; ii < mcount; ii++) {
            if (_modified[ii]) {
                return true;
            }
        }
        return false;
    }
489709
static boolean isChanged(Collection<RedisNodeDescription> o1, Collection<RedisNodeDescription> o2) {

        if (o1.size() != o2.size()) {
            return true;
        }

        for (RedisNodeDescription base : o2) {
            if (!essentiallyEqualsTo(base, findNodeByUri(o1, base.getUri()))) {
                return true;
            }
        }

        return false;
    }
401274
def changed(dirname, filename='.md5', args=None, glob=None):
    
    root = Path(dirname)
    if not root.exists():
        # if dirname doesn't exist it is changed (by definition)
        return True

    cachefile = root / filename
    current_digest = cachefile.open().read() if cachefile.exists() else ""
    
    _digest = digest(dirname, glob=glob)
    if args and args.verbose:  # pragma: nocover
        print("md5:", _digest)
    has_changed = current_digest != _digest

    if has_changed:
        with open(os.path.join(dirname, filename), 'w') as fp:
            fp.write(_digest)

    return has_changed
463788
private boolean isNotModified(HttpRequest request, long lastModified) throws ParseException {
    String ifModifiedSince = request.headers().get(HttpHeaderNames.IF_MODIFIED_SINCE);
    if (ifModifiedSince != null && !ifModifiedSince.equals("")) {
      SimpleDateFormat dateFormatter = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.US);
      Date ifModifiedSinceDate = dateFormatter.parse(ifModifiedSince);

      // Only compare up to the second because the datetime format we send to the client does
      // not have milliseconds
      long ifModifiedSinceDateSeconds = ifModifiedSinceDate.getTime() / 1000;
      long fileLastModifiedSeconds = lastModified / 1000;
      return ifModifiedSinceDateSeconds == fileLastModifiedSeconds;
    }
    return false;
  }
1294101
def has_file_changed(directory, checksums, filetype='genbank'):
    """"""
    pattern = NgdConfig.get_fileending(filetype)
    filename, expected_checksum = get_name_and_checksum(checksums, pattern)
    full_filename = os.path.join(directory, filename)
    # if file doesn't exist, it has changed
    if not os.path.isfile(full_filename):
        return True

    actual_checksum = md5sum(full_filename)
    return expected_checksum != actual_checksum
241825
private boolean hasHashChanged(Hasher hasher, RegData regDatum) {
        String urlExternalForm = regDatum.getURLExternalForm();
        Boolean modified = mUrlExternalForm2Modified.get(urlExternalForm);
        if (modified != null) {
            return modified;
        }
        // Check hash
        String newHash = hasher.hashURL(urlExternalForm);
        modified = !newHash.equals(regDatum.getHash());
        mUrlExternalForm2Modified.put(urlExternalForm, modified);
        return modified;
    }
619516
def report_change(project, path, old_content):
    
    resource = path_to_resource(project, path)
    if resource is None:
        return
    for observer in list(project.observers):
        observer.resource_changed(resource)
    if project.pycore.automatic_soa:
        rope.base.pycore.perform_soa_on_changed_scopes(project, resource,
                                                       old_content)
1339100
private boolean tagResource(String resourceId, String tagName) {
		boolean result = false;
		if(! Utils.isEmptyOrWhitespaces(tagName)) {
			Tag tag = new Tag( "Name", tagName );
			CreateTagsRequest ctr = new CreateTagsRequest(Collections.singletonList(resourceId), Arrays.asList( tag ));
			try {
				this.ec2Api.createTags( ctr );
			} catch(Exception e) {
				this.logger.warning("Error tagging resource " + resourceId + " with name=" + tagName + ": " + e);
			}
			result = true;
		}
		return result;
	}
861804
public boolean isModified()
    {
        gatekeeper.signIn();
        try
        {
            for (ChangeStack<String> stack : properties.values())
            {
                if (stack.isModified())
                {
                    return true;
                }
            }

            return false;
        }
        finally
        {
            gatekeeper.signOut();
        }
    }
375400
protected boolean hasChangedEditables() {

        if (m_editables == null) {
            return true;
        }
        for (CmsListCollectorEditor editor : m_editables.values()) {
            if (!editor.isValid()) {
                return true;
            }
        }
        return getEditableElements().size() > m_editables.size();
    }
234279
@Override
  public boolean isModified()
  {
    long now = CurrentTime.currentTime();
    long lastCheckTime = _lastCheckTime.get();
    
    if (now <= lastCheckTime + _checkInterval) {
      return _isModified;
    }

    if (! _lastCheckTime.compareAndSet(lastCheckTime, now)) {
      return _isModified;
    }

    if (isModifiedImpl()) {
      _isModified = true;
      //_lastCheckTime.set(0);
    }
    else {
      _isModified = false;
    }

    return _isModified;
  }