Selects a node in the group.
423846
private void doSelectNode(final Message<JsonObject> message) {
    final Object key = message.body().getValue("key");
    if (key == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No key specified."));
    } else {
      context.execute(new Action<String>() {
        @Override
        public String perform() {
          String address = nodeSelectors.get(key);
          if (address != null) {
            return address;
          }
          Collection<String> nodes = groups.get(group);
          int index = new Random().nextInt(nodes.size());
          int i = 0;
          for (String node : nodes) {
            if (i == index) {
              nodeSelectors.put(key, node);
              return node;
            }
            i++;
          }
          return null;
        }
      }, new Handler<AsyncResult<String>>() {
        @Override
        public void handle(AsyncResult<String> result) {
          if (result.failed()) {
            message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
          } else if (result.result() == null) {
            message.reply(new JsonObject().putString("status", "error").putString("message", "No nodes to select."));
          } else {
            message.reply(new JsonObject().putString("status", "ok").putString("result", result.result()));
          }
        }
      });
    }
  }
427740
def parse_xml_node(self, node):
        '''

        '''
        self.group_id = node.getAttributeNS(RTS_NS, 'groupId')
        self._members = []
        for c in node.getElementsByTagNameNS(RTS_NS, 'Members'):
            self._members.append(TargetComponent().parse_xml_node(c))
        return self
247812
private RedBlackTreeNode<Key, Value> select(RedBlackTreeNode<Key, Value> x, int k) {
	// assert x != null;
	// assert k >= 0 && k < size(x);
	int t = size(x.getLeft());
	if (t > k)
	    return select(x.getLeft(), k);
	else if (t < k)
	    return select(x.getRight(), k - t - 1);
	else
	    return x;
    }
383686
def select(target, path, default=None, slient=True):
    
    def _(value, slient):
        if slient:
            return value
        else:
            raise KeyError("")
    default = partial(_, default, slient)
    names = path.split(".")
    node = target
    for name in names:
        if isinstance(node, dict):
            try:
                node = node[name]
            except:
                return default()
        elif isinstance(node, list) and name.isdigit():
            try:
                node = node[int(name)]
            except:
                return default()
        elif hasattr(node, name):
            node = getattr(node, name)
        else:
            return default()
    return node
379043
@Override
    public boolean rmGroup(Node node) {
        LdapGroup group = (LdapGroup) node;
        try {
            deletionCount++;
            ctx.unbind(getOuForNode(group));
        } catch (NamingException ex) {
            handleNamingException(group, ex);
        }
        Node ldapGroup = getGroup(group.getCn());
        return ldapGroup.isEmpty();
    }
633711
function(group) {
		this.deselectGroup();
		this.selectedGroup = group;
		WireIt.GroupUtils.applyToContainers(this.selectedGroup, true, function(c) { c.highlight(); });
   }
74004
def select(self, Class, set=None, recursive=True,  ignore=True):
        """"""
        if self.mode == Mode.MEMORY:
            for t in self.data:
                if Class.__name__ == 'Text':
                    yield t
                else:
                    for e in t.select(Class,set,recursive,ignore):
                        yield e
1013136
void migrateGroup(Node oldGroupNode) throws Exception
   {
      String groupName = oldGroupNode.getName();
      String desc = utils.readString(oldGroupNode, GroupProperties.JOS_DESCRIPTION);
      String label = utils.readString(oldGroupNode, GroupProperties.JOS_LABEL);
      String parentId = utils.readString(oldGroupNode, MigrationTool.JOS_PARENT_ID);

      GroupImpl group = new GroupImpl(groupName, parentId);
      group.setDescription(desc);
      group.setLabel(label);

      Group parentGroup = findGroupById(group.getParentId());

      if (findGroupById(group.getId()) != null)
      {
         removeGroup(group, false);
      }

      addChild(parentGroup, group, false);
   }
260518
def create_group(value):
    """"""
    node = etree.Element('div', attrib={'class': 'group-by'})
    span = etree.Element('span', attrib={'class': 'group-label'})
    span.text = value
    node.append(span)
    return node
153484
public static <G extends GroupedOptions> G select(String[] params, G... groupings)
    {
        for (String param : params)
        {
            boolean accepted = false;
            for (GroupedOptions grouping : groupings)
                accepted |= grouping.accept(param);
            if (!accepted)
                throw new IllegalArgumentException("Invalid parameter " + param);
        }
        for (G grouping : groupings)
            if (grouping.happy() && grouping.accepted == params.length)
                return grouping;
        return null;
    }
589174
function (oTree) {
			var oResult = {};
			oTree.selected = this.isNodeSelected(oTree);
			this.setHierarchyNode(oResult, oTree);
			return oResult;
		}
155922
def select(self, Class, set=None, recursive=True,  ignore=True, node=None):
        """"""
        if self.include:
            return self.subdoc.data[0].select(Class,set,recursive, ignore, node) #pass it on to the text node of the subdoc
        else:
            return iter([])
1269200
public void nodeSelected(SiteNode node) {
		if (node != null) {
			siteModel.setSelectedItem(ScanPanel.cleanSiteName(node, true));
		}
	}
1046121
def outgoing(self, node):
        """"""
        nodes = node if isinstance(node, list) else [node]
        node_ids = [self.id(n) for n in nodes]
        # Find edges outgoing from this group but not incoming to it
        outgoing = [self[e[1]] for e in self.edges
                    if e[0] in node_ids and e[1] not in node_ids]
        return outgoing
1313878
function select(selector) {
    var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;

    var selection = root.querySelectorAll(selector);

    return selection.length ? selection : null;
}
441210
Node getGroupNode(Session session, Group group) throws PathNotFoundException, RepositoryException
   {
      return getGroupNode(session, group == null ? "" : group.getId());
   }
238138
public void select(Item item, boolean considerSelectableFlag) {
        if (considerSelectableFlag && !item.isSelectable()) {
            return;
        }
        item.withSetSelected(true);
        if (mSelectionListener != null) {
            mSelectionListener.onSelectionChanged(item, true);
        }
    }