Search between separators to find a radio menu item and return its group id
174609
function generateGroupId (items, pos) {
  if (pos > 0) {
    for (let idx = pos - 1; idx >= 0; idx--) {
      if (items[idx].type === 'radio') return items[idx].groupId
      if (items[idx].type === 'separator') break
    }
  } else if (pos < items.length) {
    for (let idx = pos; idx <= items.length - 1; idx++) {
      if (items[idx].type === 'radio') return items[idx].groupId
      if (items[idx].type === 'separator') break
    }
  }
  groupIdIndex += 1
  return groupIdIndex
}
587061
def doFind(self, WHAT={}, SORT=[], SKIP=None, MAX=None, LOP='AND', **params):
		""""""

		self._preFind(WHAT, SORT, SKIP, MAX, LOP)

		for key in params:
			self._addDBParam(key, params[key])

		try:
			return self._doAction('-find')
		except FMServerError as e:
			if e.args[0] in [401, 8]:
				return []
50743
def find(self, item, description='', event_type=''):
        
        # TODO: should be refactored, dumb logic
        if ': ' in item:
            splited = item.split(': ', 1)
            if splited[0] in self.TYPES:
                description = item.split(': ')[1]
                event_type = item.split(': ')[0]
            else:
                description = item
        else:
            if not description:
                description = item

        if event_type:
            found = [x['time'] for x in self.log if re.search(description, x['description'])
                     and x['eventTypeText'] == event_type]
        else:
            found = [x['time'] for x in self.log if re.search(description, x['description'])]

        if len(found):
            return found
        raise exceptions.NotFoundError("Item '{}' is not found with (description='{}', event_type='{}')".
                                       format(item, description, event_type))
582753
def join(items, separator=None):
    
    if not items:
        return ''
    if separator is None:
        separator = _default_separator()
    return separator.join([str(item) for item in items])
627633
def attrfindrows(self, groupname, attrname, value):
        """"""
        values = self.attrgetcol(groupname, attrname)
        return [i for i in range(len(values)) if values[i] == value]
366997
def get_id2parents(objs):
    """"""
    id2parents = {}
    for obj in objs:
        _get_id2parents(id2parents, obj.item_id, obj)
    return id2parents
1077642
def format_item(self, item):
        ""
        result = {
            'id': self.get_item_id(item),
            'value': self.get_item_value(item),
            'label': self.get_item_label(item),
        }
        for key in settings.SELECTABLE_ESCAPED_KEYS:
            if key in result:
                result[key] = conditional_escape(result[key])
        return result
544491
def get_all(selector, separator)
      elements = @mechanize_page.search(selector)
      throw_if_empty(elements, "elements", selector)

      (elements.map &:text).join(separator)
    end
346646
function(selector, node) {
        var groups = selector.split(','),
            queries = [],
            prefix = '',
            i, len;

        if (node) {
            // enforce for element scoping
            if (node.tagName) {
                node.id = node.id || Y.guid();
                prefix = '[id="' + node.id + '"] ';
            }

            for (i = 0, len = groups.length; i < len; ++i) {
                selector =  prefix + groups[i];
                queries.push([selector, node]);
            }
        }

        return queries;
    }
185401
protected int renderGroupOrItemRadio(FacesContext facesContext,
                                         UIComponent uiComponent, SelectItem selectItem,
                                         Object currentValue,
                                         Converter converter, boolean pageDirectionLayout,
                                         Integer itemNum) throws IOException
    {

        ResponseWriter writer = facesContext.getResponseWriter();

        boolean isSelectItemGroup = (selectItem instanceof SelectItemGroup);

        // TODO : Check here for getSubmittedValue. Look at RendererUtils.getValue
        // this is useless object creation
//        Object itemValue = selectItem.getValue();

        UISelectOne selectOne = (UISelectOne)uiComponent;

        if (isSelectItemGroup) 
        {
            if (pageDirectionLayout)
            {
                writer.startElement(HTML.TR_ELEM, null); // selectOne);
            }

            writer.startElement(HTML.TD_ELEM, null); // selectOne);
            if (selectItem.isEscape())
            {
                writer.writeText(selectItem.getLabel(),HTML.LABEL_ATTR);
            }
            else
            {
                writer.write(selectItem.getLabel());
            }
            writer.endElement(HTML.TD_ELEM);

            if (pageDirectionLayout)
            {
                writer.endElement(HTML.TR_ELEM);
                writer.startElement(HTML.TR_ELEM, null); // selectOne);
            }
            writer.startElement(HTML.TD_ELEM, null); // selectOne);

            writer.startElement(HTML.TABLE_ELEM, null); // selectOne);
            writer.writeAttribute(HTML.BORDER_ATTR, "0", null);
            
            if(!pageDirectionLayout)
            {
                writer.startElement(HTML.TR_ELEM, null); // selectOne);
            }

            SelectItemGroup group = (SelectItemGroup) selectItem;
            SelectItem[] selectItems = group.getSelectItems();

            for (SelectItem groupSelectItem : selectItems)
            { 
                itemNum = renderGroupOrItemRadio(facesContext, selectOne, groupSelectItem, currentValue, 
                                                 converter, pageDirectionLayout, itemNum);
            }

            if(!pageDirectionLayout)
            {
                writer.endElement(HTML.TR_ELEM);
            }
            writer.endElement(HTML.TABLE_ELEM);
            writer.endElement(HTML.TD_ELEM);

            if (pageDirectionLayout)
            {
                writer.endElement(HTML.TR_ELEM);
            }

        } 
        else 
        {
            String itemStrValue = org.apache.myfaces.shared.renderkit.RendererUtils.getConvertedStringValue(
                    facesContext, selectOne, converter, selectItem.getValue());
            boolean itemChecked = (itemStrValue == null) ? 
                    itemStrValue == currentValue : 
                    "".equals(itemStrValue) ? 
                            (currentValue == null || itemStrValue.equals(currentValue)) : 
                            itemStrValue.equals(currentValue);
            
            // IF the hideNoSelectionOption attribute of the component is true
            // AND this selectItem is the "no selection option"
            // AND there are currently selected items
            // AND this item (the "no selection option") is not selected
            if (HtmlRendererUtils.isHideNoSelectionOption(uiComponent) && selectItem.isNoSelectionOption() 
                    && currentValue != null && !"".equals(currentValue) && !itemChecked)
            {
                // do not render this selectItem
                return itemNum;
            }
            
            writer.write("\t\t");
            if (pageDirectionLayout)
            {
                writer.startElement(HTML.TR_ELEM, null); // selectOne);
            }
            writer.startElement(HTML.TD_ELEM, null); // selectOne);
    
            boolean itemDisabled = selectItem.isDisabled();
    
            String itemId = renderRadio(facesContext, selectOne, itemStrValue, itemDisabled, 
                    itemChecked, false, itemNum);
    
            // label element after the input
            boolean componentDisabled = isDisabled(facesContext, selectOne);
            boolean disabled = (componentDisabled || itemDisabled);
    
            HtmlRendererUtils.renderLabel(writer, selectOne, itemId, selectItem, disabled);
    
            writer.endElement(HTML.TD_ELEM);
            if (pageDirectionLayout)
            {
                writer.endElement(HTML.TR_ELEM);
            }
            
            // we rendered one radio --> increment itemNum
            itemNum++;
        }
        return itemNum;
    }
850256
private static Comparable<?> getGroupElement(OpcodeStack.Item itm) {
        Comparable<?> groupElement = null;

        int reg = itm.getRegisterNumber();
        if (reg >= 0) {
            groupElement = Integer.valueOf(reg);
        } else {
            XField field = itm.getXField();
            if (field != null) {
                int regLoad = itm.getFieldLoadedFromRegister();
                if (regLoad >= 0) {
                    groupElement = field.getName() + ":{" + regLoad + '}';
                }
            }
        }

        return groupElement;
    }
345164
def _find_value(content, ns, key):
    
    doc = ElementTree.fromstring(content)
    query = './/{%(ns)s}%(item)s' % {'ns': ns, 'item': key}
    rv = doc.find(query)
    return rv.text
740976
function findClosestGroup(oRef) {
			var oGroup = findClosestCustomGroup(oRef);
			if (oGroup) {
				return oGroup;
			}

			var $Group = jQuery(oRef).closest('[data-' + F6Navigation.fastNavigationKey + '="true"]');
			return $Group[0];
		}
1124198
def find(self, name, menu=None):
        
        menu = menu or self.menu
        for i in menu:
            if i.name == name:
                return i
            else:
                if i.childs:
                    ret_item = self.find(name, menu=i.childs)
                    if ret_item:
                        return ret_item
163554
def find(self, changed=True, forward=True,
             rehighlight=True, start_highlight_timer=False, multiline_replace_check=True):
        """"""
        # When several lines are selected in the editor and replace box is activated, 
        # dynamic search is deactivated to prevent changing the selection. Otherwise
        # we show matching items.
        if multiline_replace_check and self.replace_widgets[0].isVisible() and \
           len(to_text_string(self.editor.get_selected_text()).splitlines())>1:
            return None
        text = self.search_text.currentText()
        if len(text) == 0:
            self.search_text.lineEdit().setStyleSheet("")
            if not self.is_code_editor:
                # Clears the selection for WebEngine
                self.editor.find_text('')
            self.change_number_matches()
            return None
        else:
            case = self.case_button.isChecked()
            words = self.words_button.isChecked()
            regexp = self.re_button.isChecked()
            found = self.editor.find_text(text, changed, forward, case=case,
                                          words=words, regexp=regexp)

            stylesheet = self.STYLE[found]
            tooltip = self.TOOLTIP[found]
            if not found and regexp:
                error_msg = regexp_error_msg(text)
                if error_msg:  # special styling for regexp errors
                    stylesheet = self.STYLE['regexp_error']
                    tooltip = self.TOOLTIP['regexp_error'] + ': ' + error_msg
            self.search_text.lineEdit().setStyleSheet(stylesheet)
            self.search_text.setToolTip(tooltip)

            if self.is_code_editor and found:
                block = self.editor.textCursor().block()
                TextHelper(self.editor).unfold_if_colapsed(block)

                if rehighlight or not self.editor.found_results:
                    self.highlight_timer.stop()
                    if start_highlight_timer:
                        self.highlight_timer.start()
                    else:
                        self.highlight_matches()
            else:
                self.clear_matches()

            number_matches = self.editor.get_number_matches(text, case=case,
                                                            regexp=regexp)
            if hasattr(self.editor, 'get_match_number'):
                match_number = self.editor.get_match_number(text, case=case,
                                                            regexp=regexp)
            else:
                match_number = 0
            self.change_number_matches(current_match=match_number,
                                       total_matches=number_matches)
            return found
380819
def select(str_or_rx)
      %i[value label].each do |key|
        radio = radio(key => str_or_rx)
        next unless radio.exist?

        radio.click unless radio.selected?
        return key == :value ? radio.value : radio.text
      end
      raise UnknownObjectException, "Unable to locate radio matching #{str_or_rx.inspect}"
    end
1339500
function checkKeyframesSelectorsGroup(i) {
  const start = i;
  let l;

  if (l = checkKeyframesSelector(i)) i += l;
  else return 0;

  while (i < tokensLength) {
    const spaceBefore = checkSC(i);
    const comma = checkDelim(i + spaceBefore);
    if (!comma) break;

    const spaceAfter = checkSC(i + spaceBefore + comma);
    if (l = checkKeyframesSelector(i + spaceBefore + comma + spaceAfter)) {
      i += spaceBefore + comma + spaceAfter + l;
    } else break;
  }

  tokens[start].selectorsGroupEnd = i;

  return i - start;
}