code: def put(self, artifact):
      
      artifact = M2Coordinate.create(artifact)
      if artifact.rev is None:
        raise self.MissingVersion('Cannot pin an artifact to version "None"! {}'.format(artifact))
      key = self._key(artifact)
      previous = self._artifacts_to_versions.get(key)
      self._artifacts_to_versions[key] = artifact
      if previous != artifact:
        self._id = None
docs: Adds the given coordinate to the set, using its version to pin it.
  
      If this set already contains an artifact with the same coordinates other than the version, it is
      replaced by the new artifact.
  
      :param M2Coordinate artifact: the artifact coordinate.