Get <em>last</em> match element with given label, if any.
438481
public PatternElementMatch getLastLabeledMatch(String label) {
        PatternElementMatch cur = this;
        while (cur != null) {
            String elementLabel = cur.patternElement.getLabel();
            if (elementLabel != null && elementLabel.equals(label)) {
                return cur;
            }
            cur = cur.prev;
        }
        return null;
    }
392287
public static boolean hasMatchingLabels(FlatRow row) {
    int inLabelCount = 0;
    int outLabelCount = 0;
    for (FlatRow.Cell cell : row.getCells()) {
      for (String label : cell.getLabels()) {
        // TODO(kevinsi4508): Make sure {@code label} is a {@link WhileMatchFilter} label.
        // TODO(kevinsi4508): Handle multiple {@link WhileMatchFilter} labels.
        if (label.endsWith(WHILE_MATCH_FILTER_IN_LABEL_SUFFIX)) {
          inLabelCount++;
        } else if (label.endsWith(WHILE_MATCH_FILTER_OUT_LABEL_SUFFIX)) {
          outLabelCount++;
        }
      }
    }

    // Checks if there is mismatching {@link WhileMatchFilter} label.
    if (inLabelCount != outLabelCount) {
      return false;
    }

    return true;
  }
751100
public static String getOperatorCodeFromLabel(String label) {
		if (label != null) {
			if (I18nProvider.getSearch().operatorEquals().equals(label)) {
				return "=";
			} else if (I18nProvider.getSearch().operatorNotEquals().equals(label)) {
				return "<>";
			} else if (I18nProvider.getSearch().operatorST().equals(label)) {
				return "<";
			} else if (I18nProvider.getSearch().operatorSE().equals(label)) {
				return "<=";
			} else if (I18nProvider.getSearch().operatorBT().equals(label)) {
				return ">";
			} else if (I18nProvider.getSearch().operatorBE().equals(label)) {
				return ">=";
			} else if (I18nProvider.getSearch().operatorContains().equals(label)) {
				return "contains";
			} else if (I18nProvider.getSearch().operatorBefore().equals(label)) {
				return "BEFORE";
			} else if (I18nProvider.getSearch().operatorAfter().equals(label)) {
				return "AFTER";
			}
		}
		return label;
	}
11096
public Long getValueLong(String label) {
        PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.LONG, "Long");
        if (o == null) {
            return null;
        }
        return (Long) o.getObject();
    }
1298099
private Node getLastChild(Node node) {

		if (node == null)
			return null;

		Node newNode = node.getLastChild();
		if (newNode == null)
			return null;

		int accept = acceptNode(newNode);
		if (accept == NodeFilter.FILTER_ACCEPT)
			return newNode;
		else if (accept == NodeFilter.FILTER_SKIP && newNode.hasChildNodes())
			return getLastChild(newNode);

		// if (accept == NodeFilter.REJECT_NODE)
		return getPreviousSibling(newNode);

	}
512264
def click_on_label(self, label):
    

    elem = ElementSelector(
        world.browser,
        str('//label[normalize-space(text())=%s]' % string_literal(label)),
        filter_displayed=True,
    )
    if not elem:
        raise AssertionError(
            "Cannot find a label with text '{}'.".format(label))
    elem.click()
1307505
def element_id_by_label(browser, label):
    """"""
    label = XPathSelector(browser,
                          unicode('//label[contains(., "%s")]' % label))
    if not label:
        return False
    return label.get_attribute('for')
1158886
def match? label, x
      x.is_a?(Regexp) ? label.to_s =~ x : label == x
    end
1046985
def get_last_offset(self, field, filters_=[]):
        '''
            
        '''

        offset = self.get_last_item_field(field, filters_=filters_, offset=True)

        return offset
353043
def _get_x_label(self, i):
        """"""
        if not self.x_labels or not self._y_labels or len(self._y_labels) <= i:
            return
        return self._y_labels[i][0]
419422
function filterDomElement(domElement, names, labels) {
			/*
			 Where we look to find a match, in this order:
			 name, id, <label> tags, placeholder, title
			 Our searches first conduct fairly liberal "contains" searches:
			 if the attribute even contains the name or label, we map it.
			 The names and labels we choose to find are very particular.
			 */

			var name = lowercase(domElement.name);
			var id = lowercase(domElement.id);
			var selectorSafeID = id.replace(/[\[|\]|\(|\)|\:|\'|\"|\=|\||\#|\.|\!|\||\@|\^|\&|\*]/g, "\\\\$&");
			var placeholder = lowercase(domElement.placeholder);
			var title = lowercase(domElement.title);

			// First look through name and id attributes of the element, the most common
			for (var i = 0; i < names.length; i++)
				if (name.indexOf(names[i]) > -1 || id.indexOf(names[i]) > -1)
					return true;

			// If we can't find it in name or id, look at labels associated to the element.
			// Webkit automatically associates labels with form elements for us. But for other
			// browsers, we have to find them manually, which this next block does.
			if (!("labels" in domElement)) {
				var lbl = $("label[for=\"" + selectorSafeID + "\"]")[0] || $(domElement).parents("label")[0];
				domElement.labels = !lbl ? [] : [lbl];
			}

			// Iterate through the <label> tags now to search for a match.
			for (var i = 0; i < domElement.labels.length; i++) {
				// This inner loop compares each label value with what we're looking for
				for (var j = 0; j < labels.length; j++)
					if ($(domElement.labels[i]).text().toLowerCase().indexOf(labels[j]) > -1)
						return true;
			}

			// Still not found? Then look in "placeholder" or "title"...
			for (var i = 0; i < labels.length; i++)
				if (placeholder.indexOf(labels[i]) > -1 || title.indexOf(labels[i]) > -1)
					return true;

			// Got all the way to here? Probably not a match then.
			return false;
		}
369563
def match_node(node,expected,label)
        
        #check type 
        if !check_type(node,expected['type'],label,expected['ok_empty'])
          @errors.push('Error: node ' + label + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
          return false
        end
        
        if (node.kind_of?(Hash) || node.kind_of?(Array))
          
          if node.empty? && !expected['ok_empty']
            @errors.push('Error: node ' + label + ' cannot be empty')
            return false
          elsif !node.empty? && expected.has_key?('accepts')
            valid_content = false
            
            if node.kind_of?(Hash)
              matched = []
              unmatched = []
              node.each_pair{
                |key,value|
                
                expected['accepts'].each{
                  |accepts|
                     
                  result = check_type(value,accepts,key)
                  
                  if result
                    matched.push(key)
                    if !unmatched.find_index(key).nil?
                      unmatched.slice(unmatched.find_index(key))
                    end
                    break
                  else
                    unmatched.push(key)
                  end
                 
                }
                
              }
                   
              if(matched.count==node.count)
                valid_content = true
               else
                unmatched.each{
                  |node|
                  
                  @errors.push('Error: node ' + node + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
                }
              end
              
            elsif node.kind_of?(Array)
              matched = []
              unmatched = []
              node.each_index{
                |n|
                
                expected['accepts'].each{
                  |accepts|
                  
                  key = label + '[' + n.to_s + ']'
                  result = check_type(node[n],accepts,key)
                  
                  if result
                    
                    matched.push(key)
                    if !unmatched.find_index(key).nil?
                      unmatched.slice(unmatched.find_index(key))
                    end
                    break
                  else
                    unmatched.push(key)
                  end
                  
                }
              }
              
              if(matched.count==node.count)
                valid_content = true
              else
                unmatched.each{
                  |node|
                  
                  @errors.push('Error: node ' + node + ' is not of an accepted type. Should be one of ' + expected['accepts'].join(', '))
                }
              end
            
            end
            
            if !valid_content
              @errors.push('Error: node ' + label + ' contains an unaccepted type.')
              return false
            end
         end
         
        end
       
        return true
                
      end
387145
public String getValueString(String label) {
        PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.STRING, "String");
        if (o == null) {
            return null;
        }
        return (String) o.getObject();
    }
637112
def _validate_label(self, label):
        """"""

        letter_pattern = compile("^[a-z]{1}$")
        number_pattern = compile("^[0]{1}$|^[1-9]{1,2}$")
        icon_pattern = compile("^[a-zA-Z ]{1,}$")

        if not match(letter_pattern, label)\
            and not match(number_pattern, label)\
                and not match(icon_pattern, label):
                    raise InvalidLabelError(
                        "{} is not a valid label".format(label)
                    )

        return label
1036212
def getLabel(self,form):
        """"""
        return specialInterpretValue(self.label,self.name,form=form)
444479
def get(self, ns, label=None):
        
        query = Tag.query.filter(Tag.ns == ns)

        if label is not None:
            return query.filter(Tag.label == label).first()

        return query.all()
1163719
def valueByLabel(self, label):
        
        keys = self.keys()
        labels = [text.pretty(key) for key in keys]
        if label in labels:
            return self[keys[labels.index(label)]]
        return 0