code: function(nodes, selector) {
          nodes = nodes || [];
  
          var node,
              result = [],
              tokens = Y.Selector._tokenize(selector);
  
          if (!nodes.item) { // if not HTMLCollection, handle arrays of ids and/or nodes
              YAHOO.log('filter: scanning input for HTMLElements/IDs', 'info', 'Selector');
              for (var i = 0, len = nodes.length; i < len; ++i) {
                  if (!nodes[i].tagName) { // tagName limits to HTMLElements 
                      node = Y.Selector.document.getElementById(nodes[i]);
                      if (node) { // skip IDs that return null 
                          nodes[i] = node;
                      } else {
                          YAHOO.log('filter: skipping invalid node', 'warn', 'Selector');
                      }
                  }
              }
          }
          result = Y.Selector._filter(nodes, Y.Selector._tokenize(selector)[0]);
          YAHOO.log('filter: returning:' + result.length, 'info', 'Selector');
          return result;
      }
docs: Filters a set of nodes based on a given CSS selector.
  @method filter
  
  @param {array} nodes A set of nodes/ids to filter.
  @param {string} selector The selector used to test each node.
  @return{array} An array of nodes from the supplied array that match the given selector.
  @static