move all group instructions except for the root from the underlying method into the groups Insnlist
506151
private void extractInstructions(InstructionGroup group) {
        for (InstructionGraphNode node : group.getNodes()) {
            if (node != group.getRoot()) {
                AbstractInsnNode insn = node.getInstruction();
                method.instructions.remove(insn);
                group.getInstructions().add(insn);
            }
        }
    }
374119
private void cleanGlobalBlockList() {
    for (Iterator<Block> globalBlockListIterator=globalBlockList.keySet().iterator();
    globalBlockListIterator.hasNext();) {
      Block block = globalBlockListIterator.next();
      if(!movedBlocks.contains(block)) {
        globalBlockListIterator.remove();
      }
    }
  }
634145
def rename(self, **kwargs):
        ''''''
        for old, new in kwargs.iteritems():
            if old in self.groups:
                self.groups[new] = self.groups[old]
                del self.groups[old]
1283659
def move_group_in_parent(self, group = None, index = None):
        
        
        if group is None or index is None:
            raise KPError("group and index must be set")
        elif type(group) is not v1Group or type(index) is not int:
            raise KPError("group must be a v1Group-instance and index "
                          "must be an integer.")
        elif group not in self.groups:
            raise KPError("Given group doesn't exist")
        elif index < 0 or index >= len(group.parent.children):
            raise KPError("index must be a valid index if group.parent.groups")
        else:
            group_at_index = group.parent.children[index]
            pos_in_parent = group.parent.children.index(group) 
            pos_in_groups = self.groups.index(group)
            pos_in_groups2 = self.groups.index(group_at_index)

            group.parent.children[index] = group
            group.parent.children[pos_in_parent] = group_at_index
            self.groups[pos_in_groups2] = group
            self.groups[pos_in_groups] = group_at_index
            if group.children:
                self._move_group_helper(group)
            if group_at_index.children:
                self._move_group_helper(group_at_index)
            group.last_mod = datetime.now().replace(microsecond=0)
            return True
179588
function(aKeyIndexes, newIndex) {
    if(lang.isArray(aKeyIndexes) && lang.isNumber(newIndex) && this._elColgroup && (this._elColgroup.childNodes.length > aKeyIndexes[aKeyIndexes.length-1])) {
        var i,
            tmpCols = [];
        // Remove COL
        for(i=aKeyIndexes.length-1; i>-1; i--) {
            tmpCols.push(this._elColgroup.removeChild(this._elColgroup.childNodes[aKeyIndexes[i]]));
        }
        // Insert COL
        var nextSibling = this._elColgroup.childNodes[newIndex] || null;
        for(i=tmpCols.length-1; i>-1; i--) {
            this._elColgroup.insertBefore(tmpCols[i], nextSibling);
        }
    }
}
1134981
async def remove(gc: GroupControl, slaves):
    """"""
    click.echo("Removing from existing group: %s" % slaves)
    click.echo(await gc.remove(slaves))
1254092
function moveAssignments(dest) {
                if (assignments.length) {
                    dest.argument = {
                        type: 'SequenceExpression',
                        expressions: assignments.map(function (a) {
                            var b = cloneNode(a);
                            coerce(a, a.left);
                            return b;
                        }).concat(dest.argument)
                    };
                    assignments = [];
                }
            }
210429
def hide_methods(mod, except_defaults, *stuff)
      options = stuff.last.is_a?(Hash) ? stuff.pop : {}
      include_ancestors  = options.fetch(:ancestors){false}
      except             = Array(options.fetch(:except){except_defaults})
      protect            = Array(options[:protect])
      except_methods     = collect_methods(true, *except)
      protect_methods    = collect_methods(true, *protect)
      methods_to_hide    = collect_methods(include_ancestors, *stuff)
      (methods_to_hide - except_methods).each do |method_name|
        mod.module_eval do 
          next unless method_defined?(method_name)
          if protect_methods.include?(method_name)
            protected method_name
          else
            private method_name
          end
        end
      end
    end
119103
private void migrateGroups(Node startNode) throws Exception
   {
      NodeIterator iterator = ((ExtendedNode)startNode).getNodesLazily();
      GroupHandlerImpl gh = ((GroupHandlerImpl)service.getGroupHandler());
      while (iterator.hasNext())
      {
         Node oldGroupNode = iterator.nextNode();
         gh.migrateGroup(oldGroupNode);

         migrateGroups(oldGroupNode);
      }
   }
1150587
private void rollingRemove() throws TTException {
        final ITreeData startNode = mDelegate.getCurrentNode();
        long hashToRemove = startNode.getHash();
        long hashToAdd = 0;
        long newHash = 0;
        // go the path to the root
        do {
            synchronized (mDelegate.getCurrentNode()) {
                getPtx().getData(mDelegate.getCurrentNode().getDataKey());
                if (mDelegate.getCurrentNode().getDataKey() == startNode.getDataKey()) {
                    // the begin node is always null
                    newHash = 0;
                } else if (mDelegate.getCurrentNode().getDataKey() == startNode.getParentKey()) {
                    // the parent node is just removed
                    newHash = mDelegate.getCurrentNode().getHash() - (hashToRemove * PRIME);
                    hashToRemove = mDelegate.getCurrentNode().getHash();
                } else {
                    // the ancestors are all touched regarding the modification
                    newHash = mDelegate.getCurrentNode().getHash() - (hashToRemove * PRIME);
                    newHash = newHash + hashToAdd * PRIME;
                    hashToRemove = mDelegate.getCurrentNode().getHash();
                }
                mDelegate.getCurrentNode().setHash(newHash);
                hashToAdd = newHash;
                getPtx().setData(mDelegate.getCurrentNode());
            }
        } while (moveTo(mDelegate.getCurrentNode().getParentKey()));

        mDelegate.setCurrentNode(startNode);
    }
290563
private static void inheritOwnerAndGroupIfEmpty(MutableInode<?> newInode,
      InodeDirectoryView ancestorInode) {
    if (ServerConfiguration.getBoolean(PropertyKey.MASTER_METASTORE_INODE_INHERIT_OWNER_AND_GROUP)
        && newInode.getOwner().isEmpty() && newInode.getGroup().isEmpty()) {
      // Inherit owner / group if empty
      newInode.setOwner(ancestorInode.getOwner());
      newInode.setGroup(ancestorInode.getGroup());
    }
  }
359921
def removereadergroup(self, group):
        """"""
        if not isinstance(group, type("")):
            raise BadReaderGroupException
        self.remove(group)
1189242
private void processGroups(ConfigurationAdmin configAdmin,
                               String roleName,
                               Dictionary<String, Object> roleProps, Set<String> pids) {

        String[] groupPids = (String[]) roleProps.get(CFG_KEY_GROUP);
        if (groupPids == null || groupPids.length == 0) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "No groups in role " + roleName);
            }
        } else {
            Set<String> badGroups = new HashSet<String>();
            Set<String> badAccessIds = new HashSet<String>();
            for (int i = 0; i < groupPids.length; i++) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "group pid " + i + ": " + groupPids[i]);
                }
                pids.add(groupPids[i]);
                Configuration groupConfig = null;
                try {
                    groupConfig = configAdmin.getConfiguration(groupPids[i], bundleLocation);
                } catch (IOException ioe) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Invalid group entry " + groupPids[i]);
                    }
                    continue;
                }
                if (groupConfig == null || groupConfig.getProperties() == null) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Null group element", groupPids[i]);
                    }
                    continue;
                }

                Dictionary<String, Object> groupProps = groupConfig.getProperties();
                final String name = (String) groupProps.get("name");
                final String accessId = (String) groupProps.get("access-id");
                if (name == null || name.trim().isEmpty()) {
                    continue;
                }
                // access id takes precedence
                if (accessId != null && AccessIdUtil.isGroupAccessId(accessId)) {
                    if (badAccessIds.contains(accessId)) {
                        // This accessId is already flagged as a duplicate
                        continue;
                    }
                    if (!accessIds.add(accessId)) {
                        Tr.error(tc, "AUTHZ_TABLE_DUPLICATE_ROLE_MEMBER", getRoleName(), CFG_KEY_ACCESSID, accessId);
                        badAccessIds.add(accessId);
                        accessIds.remove(accessId);
                    }
                } else {
                    // TODO: check for bad access id
                    if (badGroups.contains(name)) {
                        // This group is already flagged as a duplicate
                        continue;
                    }
                    if (name.trim().isEmpty()) {
                        // Empty entry, ignoring
                        continue;
                    }
                    if (!groups.add(name)) {
                        Tr.error(tc, "AUTHZ_TABLE_DUPLICATE_ROLE_MEMBER", getRoleName(), CFG_KEY_GROUP, name);
                        badGroups.add(name);
                        groups.remove(name);
                    }
                }
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Role " + roleName + " has groups:", groups);
            }
        }
    }
648452
public void initializeRoot(String owner, String group, Mode mode, JournalContext context)
      throws UnavailableException {
    if (mState.getRoot() == null) {
      MutableInodeDirectory root = MutableInodeDirectory.create(
          mDirectoryIdGenerator.getNewDirectoryId(context), NO_PARENT, ROOT_INODE_NAME,
          CreateDirectoryContext
              .mergeFrom(CreateDirectoryPOptions.newBuilder().setMode(mode.toProto()))
              .setOwner(owner).setGroup(group));
      root.setPersistenceState(PersistenceState.PERSISTED);
      mState.applyAndJournal(context, root);
    }
  }
865647
private void removeWebpackModuleShim(Node root) {
    checkState(root.isScript());
    Node n = root.getFirstChild();

    // Sometimes scripts start with a semicolon for easy concatenation.
    // Skip any empty statements from those
    while (n != null && n.isEmpty()) {
      n = n.getNext();
    }

    // An IIFE wrapper must be the only non-empty statement in the script,
    // and it must be an expression statement.
    if (n == null || !n.isExprResult() || n.getNext() != null) {
      return;
    }

    Node call = n.getFirstChild();
    if (call == null || !call.isCall()) {
      return;
    }

    // Find the IIFE call and function nodes
    Node fnc;
    if (call.getFirstChild().isFunction()) {
      fnc = n.getFirstFirstChild();
    } else if (call.getFirstChild().isGetProp()
        && call.getFirstFirstChild().isFunction()
        && call.getFirstFirstChild().getNext().matchesQualifiedName("call")) {
      fnc = call.getFirstFirstChild();
    } else {
      return;
    }

    Node params = NodeUtil.getFunctionParameters(fnc);
    Node moduleParam = null;
    Node param = params.getFirstChild();
    int paramNumber = 0;
    while (param != null) {
      paramNumber++;
      if (param.isName() && param.getString().equals(MODULE)) {
        moduleParam = param;
        break;
      }
      param = param.getNext();
    }
    if (moduleParam == null) {
      return;
    }

    boolean isFreeCall = call.getBooleanProp(Node.FREE_CALL);
    Node arg = call.getChildAtIndex(isFreeCall ? paramNumber : paramNumber + 1);
    if (arg == null) {
      return;
    }

    if (arg.isCall()
        && arg.getFirstChild().isCall()
        && isCommonJsImport(arg.getFirstChild())
        && arg.getSecondChild().isName()
        && arg.getSecondChild().getString().equals(MODULE)) {
      String importPath = getCommonJsImportPath(arg.getFirstChild());

      ModulePath modulePath =
          compiler
              .getInput(root.getInputId())
              .getPath()
              .resolveJsModule(
                  importPath, arg.getSourceFileName(), arg.getLineno(), arg.getCharno());
      if (modulePath == null) {
        // The module loader will issue an error
        return;
      }

      if (modulePath.toString().contains("/buildin/module.js")) {
        arg.detach();
        param.detach();
        compiler.reportChangeToChangeScope(fnc);
        compiler.reportChangeToEnclosingScope(fnc);
      }
    }
  }
1188473
public void moveDown(I_CmsEditableGroupRow row) {

        int index = m_container.getComponentIndex(row);
        if ((index >= 0) && (index < (m_container.getComponentCount() - 1))) {
            m_container.removeComponent(row);
            m_container.addComponent(row, index + 1);
        }
        updateButtonBars();
    }
1191560
private Group removeGroup(Session session, Group group, boolean broadcast) throws Exception
   {
      if (group == null)
      {
         throw new OrganizationServiceException("Can not remove group, since it is null");
      }

      Node groupNode = utils.getGroupNode(session, group);

      // need to minus one because of child "jos:memberships" node
      long childrenCount = ((ExtendedNode)groupNode).getNodesLazily(1).getSize() - 1;

      if (childrenCount > 0)
      {
         throw new OrganizationServiceException("Can not remove group till children exist");
      }

      if (broadcast)
      {
         preDelete(group);
      }

      removeMemberships(groupNode, broadcast);
      groupNode.remove();
      session.save();

      removeFromCache(group.getId());
      removeAllRelatedFromCache(group.getId());

      if (broadcast)
      {
         postDelete(group);
      }

      return group;
   }