Coerces an a parameter into a callback for matching elements. This accepts an element name, an element type and returns a callback to match for those elements.
327739
function coerceElementMatchingCallback(value) {
  // Element Name
  if (typeof value === 'string') {
    return element => element.element === value;
  }

  // Element Type
  if (value.constructor && value.extend) {
    return element => element instanceof value;
  }

  return value;
}
1158691
public static <T extends MethodDescription> ElementMatcher.Junction<T> isToString() {
        return named("toString").and(takesArguments(0)).and(returns(TypeDescription.STRING));
    }
68022
def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:
        """"""
        return getElementsBy(self, cond)
228020
function(sel) {
      if (!this.length) {
        return this;
      }
      var matched = [],
    	 		el = this[0];

    	while (el = el.previousElementSibling) {
    		sel ?
    			(u(el).is(sel) && matched.push(el)) :
    			matched.push(el);
    	}
    	return u(matched);
    }
868973
def params(self):
        
        if self.context.el_type in [Function, Subroutine]:
            return self.evaluator.element.parameters
352469
def abi_get_element_by_name(abi, name):
    
    if (abi and "abi" in abi):
        for a in abi["abi"]:
            if ("name" in a and a["name"] == name):
                return a
    return None
1216204
def getElements(self,name=''):
		''
		#If no tag name is specified, return the all children
		if not name:
			return self.children
		else:
			# else return only those children with a matching tag name
			elements = []
			for element in self.children:
				if element.name == name:
					elements.append(element)
			return elements
1126629
function(sel) {
      if (!this.length) {
        return this;
      }
      var matched = [],
    	 		el = this[0];

    	while (el = el.nextElementSibling) {
    		sel ?
    			(u(el).is(sel) && matched.push(el)) :
    			matched.push(el);
    	}
    	return u(matched);
    }
599237
public static By callback(final Function<SearchContext, List<WebElement>> callback) {
		if (callback == null)
			throw new IllegalArgumentException("Cannot find elements when the callback is null");

		return new ByCallback(callback);
	}
1143651
function( elems, name, selector ) {
		// Build a new jQuery matched element set
		var ret = this.constructor();

		if ( jQuery.isArray( elems ) ) {
			push.apply( ret, elems );

		} else {
			jQuery.merge( ret, elems );
		}

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;

		ret.context = this.context;

		if ( name === "find" ) {
			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
		} else if ( name ) {
			ret.selector = this.selector + "." + name + "(" + selector + ")";
		}

		// Return the newly-formed element set
		return ret;
	}
893086
function(element) {
    if (!element.bindings) {
      element.bindings = compile(this, element);
      View.makeInstanceOf(element);
    }

    return element;
  }
876105
boolean matches(StartElement element) {
        for (ElementConstraint constraint : getConstraints()) {
            if (!constraint.matches(element)) return false;
        }
        return true;
    }
906411
function (elements, attribute, value) {
            var foundElements = [], value = value || null;
            for (i = 0; i < elements.length; i++) {
                // If the value parameter is set, return only the
                // elements that has the given attribute value.
                if (value !== null) {
                    if (elements[i].getAttribute(attribute) === value)
                        foundElements.push(elements[i]);
                } else {
                    if (elements[i].getAttribute(attribute) !== null)
                        foundElements.push(elements[i]);
                }
            }

            return foundElements;
        }
1014482
def set_element_attributes(elem_to_parse, **attrib_kwargs):
    

    element = get_element(elem_to_parse)

    if element is None:
        return element

    if len(attrib_kwargs):
        element.attrib.update(attrib_kwargs)

    return element.attrib
589270
function getClosestNode (element, method, selector) {
        do {
            element = element[method]
        } while (element && ((selector && !matches(element, selector)) || !util.isElement(element)))
        return element
    }
243627
def match(self, expression=None, xpath=None, namespaces=None): 
        """"""
        class MatchObject(Dict):
            pass
        def _match(function):
            self.matches.append(
                MatchObject(expression=expression, xpath=xpath, function=function, namespaces=namespaces))
            def wrapper(self, *args, **params):
                return function(self, *args, **params)
            return wrapper
        return _match
134466
function( elem, context, xml ) {
			while ( (elem = elem[ dir ]) ) {
				if ( checkNonElements || elem.nodeType === 1  ) {
					return matcher( elem, context, xml );
				}
			}
		}