Sets the source node.
356545
public final void setSource(Node source) {
    if (prototypeSlot != null) {
      // NOTE(bashir): On one hand when source is null we want to drop any
      // references to old nodes retained in prototypeSlot. On the other hand
      // we cannot simply drop prototypeSlot, so we retain all information
      // except the propertyNode for which we use an approximation! These
      // details mostly matter in hot-swap passes.
      if (source == null || prototypeSlot.getNode() == null) {
        prototypeSlot =
            new Property(
                prototypeSlot.getName(),
                prototypeSlot.getType(),
                prototypeSlot.isTypeInferred(),
                source);
      }
    }
    this.source = source;
  }
919324
private void setNodeDirty(final Node<K, V> node) {
		final int nodeid = node.id;
		final int index = nodeid < 0 ? -nodeid : nodeid;
		(node.isLeaf() ? dirtyLeafNodes : dirtyInternalNodes).put(nodeid, node);
		(node.isLeaf() ? cacheLeafNodes : cacheInternalNodes).remove(nodeid);
		if (enableIOStats) {
			getIOStat(nodeid).incCacheWrite();
		}
		if (enableDirtyCheck) {
			dirtyCheck.set(index);
		}
	}
192049
protected function setSource( $value, ?string $key = null ) {
    if( $key === null ) $this->_source = $value === null ? [] : $value;
    else if( $value === null ) unset( $this->_source[ $key ] );
    else $this->_source[ $key ] = $value;

    // reset iterations and clean caches
    $this->rewind();
    $this->clean();
  }
1146090
public void setNodeType(int nodeType) {
        if (nodeType != Token.VAR
            && nodeType != Token.CONST
            && nodeType != Token.LET)
            throw new IllegalArgumentException("invalid node type");
        setType(nodeType);
    }
570627
private void setParent(DepTreeNode parent) {
		if (this.name.length() == 0) {
			// A child node must have a name.
			throw new IllegalStateException();
		}
		this.parent = new WeakReference<DepTreeNode>(parent);
	}
22068
def setnode(delta, graph, node, exists):
    """"""
    delta.setdefault(graph, {}).setdefault('nodes', {})[node] = bool(exists)
1274318
def set_action(self, value):
        """"""
        if value not in ("remove", "add"):
            log = "Sources field 'action' should be 'remove' or 'add'."
            raise MalFormattedSource(log)
        self._action = value
953666
def set(self, uri, content):
        
        key, value = self._prepare_node(uri, content)
        self._set(key, value)
1228797
def set_node_description(self, node: BaseEntity, description: str) -> None:
        """"""
        self._set_node_attr(node, DESCRIPTION, description)
695757
void setLength(
      Node node, SourcePosition start, SourcePosition end) {
    node.setLength(end.offset - start.offset);
  }
855462
def set(self, uri, content, **meta):
        
        try:
            node = self._update(uri, content, **meta)
            created = False
        except NodeDoesNotExist:
            node = self._create(uri, content, **meta)
            created = True
        return self._serialize(uri, node), created
846830
private function setSubmittedSource()
    {
        // Get actual source ($this->source may be the parent, not the source to
        // execute on). Do so without trusting the input.
        $sourceType = $this->getSubmittedValue('type') === Source::Order ? Source::Order : Source::CreditNote;
        $sourceId = (int) $this->getSubmittedValue('source');
        $this->submittedSource = null;
        if ($this->source->getType() === $sourceType && $this->source->getId() === $sourceId) {
            $this->submittedSource = $this->source;
        } else {
            $creditNotes = $this->source->getCreditNotes();
            foreach ($creditNotes as $creditNote) {
                if ($creditNote->getType() === $sourceType && $creditNote->getId() === $sourceId) {
                    $this->submittedSource = $creditNote;
                }
            }
        }
    }
996356
def setCurrentNode(self, node):
        
        self.blockSignals(True)
        self.clearSelection()
        if node:
            node.setSelected(True)
        self.blockSignals(False)
1255089
@VisibleForTesting
  public void setSource(PropertyKey key, Source source) {
    mSources.put(key, source);
  }
951629
public static Node toNode(Source s) {
        Node n = tryExtractNodeFromDOMSource(s);
        return n != null ? n 
            : toDocument(s, DocumentBuilderFactoryConfigurer.Default.configure(DocumentBuilderFactory.newInstance()));
    }
1153399
def __set_authoring_nodes(self, source, target):
        

        editor = self.__script_editor.get_editor(source)
        editor.set_file(target)
        self.__script_editor.model.update_authoring_nodes(editor)
266157
def add_node(self, node):
        """"""
        other_nodes = [n for n in self.nodes() if n.id != node.id]
        if len(self.nodes()) > 11:
            parents = [max(other_nodes, key=attrgetter("creation_time"))]
        else:
            parents = [n for n in other_nodes if isinstance(n, Source)]

        for parent in parents:
            parent.connect(whom=node)