code: function (node, single, layoutBy) {
      if (!node._private.data.collapsedChildren){
        return;
      }
  
      //check how the position of the node is changed
      var positionDiff = {
        x: node._private.position.x - node._private.data['position-before-collapse'].x,
        y: node._private.position.y - node._private.data['position-before-collapse'].y
      };
  
      node.removeData("infoLabel");
      node.removeClass('cy-expand-collapse-collapsed-node');
  
      node.trigger("expandcollapse.beforeexpand");
      node._private.data.collapsedChildren.restore();
      this.repairEdges(node);
      node._private.data.collapsedChildren = null;
  
      elementUtilities.moveNodes(positionDiff, node.children());
      node.removeData('position-before-collapse');
  
      node.trigger("position"); // position not triggered by default when nodes are moved
      node.trigger("expandcollapse.afterexpand");
  
      // If expand is called just for one node then call end operation to perform layout
      if (single) {
        this.endOperation(layoutBy);
      }
    }
docs: /*
  A funtion basicly expanding a node, it is to be called when a node is expanded anyway.
  Single parameter indicates if the node is expanded alone and if it is truthy then layoutBy parameter is considered to
  perform layout after expand.