if list2 does not start with list1, we can't really check and return 0
344100
def compare_parts(list1, list2):
    

    for i, item in enumerate(list1):
        if item != list2[i]:
            return 0
    if len(list2) > len(list1):
        return ISDIR
    else:
        return ISFILE
590548
def expected_count

      if h.ccount.nil?
        count_list_size
      elsif h.ccount >= 0
        [ h.ccount, count_list_size ].min
      else # all but 1, 2, ...
        i = count_list_size + h.ccount
        i < 1 ? 1 : i
      end
    end
975144
def is_list(node):
    """"""
    return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == u"["
            and node.children[-1].value == u"]")
500563
public static boolean compareQNameLists(List<QName> list1, List<QName> list2) {
        if (list1 == list2)
            return true;
        if (list1 == null || list2 == null)
            return false;
        if (list1.size() != list2.size())
            return false;

        for (int i = 0; i < list1.size(); i++) {
            if (!compareQNames(list1.get(i), list2.get(i)))
                return false;
        }

        return true;
    }
758405
def first(self):
        
        pairs = self.resolve()
        try:
            return iter_first(pairs)
        except ValueError:
            raise NotFoundError(u"{0} not found".format(self.name))
95358
function (list, value, missingIsFalse) {
				if (list === "*") return true;
				return list.length > 0 ? list.indexOf(value) != -1 : !missingIsFalse;
			}
80707
static boolean isLineNumberList(List<Long> list) {
    if (list == null) {
      return false;
    }
    for (Long line : list) {
      if (line != null && line < 1) {
        return false;
      }
    }
    return true;
  }
795928
def _get_value(first, second):
    

    if isinstance(first, list) and isinstance(second, list):
        return list(set(first).union(set(second)))
    elif isinstance(first, dict) and isinstance(second, dict):
        first.update(second)
        return first
    elif first is not None and second is not None and not isinstance(first, type(second)):
        return type(first)(second)
    else:
        return second
1062672
def list_filter(lst, startswith=None, notstartswith=None,
                contain=None, notcontain=None):
    
    keeped = []
    for item in lst:
        keep = False
        if startswith is not None:
            if item.startswith(startswith):
                keep = True
        if notstartswith is not None:
            if not item.startswith(notstartswith):
                keep = True
        if contain is not None:
            if contain in item:
                keep = True
        if notcontain is not None:
            if not notcontain in item:
                keep = True

        if keep:
            keeped.append(item)
    return keeped
793459
def isetdiff_flags(list1, list2):
    
    set2 = set(list2)
    return (item not in set2 for item in list1)
872539
def _sublist(items, starting_value, ending_value=None):
        
        have_started = starting_value is None

        for x in items:
            have_started = have_started or x == starting_value
            if have_started:
                yield x

            if ending_value is not None and x == ending_value:
                break
769403
def is_in(self, search_list, pair):
        
        index = -1
        for nr, i in enumerate(search_list):
            if(np.all(i == pair)):
                return nr
        return index
667756
def _check_split_list_validity(self):
        
        # FIXME: Currently very primitive, but needs to be fast
        if not (hasattr(self,"_splitListsSet") and (self._splitListsSet)):
            return False
        elif len(self) != self._splitListsLength:
            return False
        else:
            return True
1209877
def _lscmp(a, b):
    '''  '''
    return not sum(0 if x==y else 1 for x, y in zip(a, b)) and len(a) == len(b)
866910
def process_lists(self):
        """"""
        for l1_idx, obj1 in enumerate(self.l1):
            for l2_idx, obj2 in enumerate(self.l2):
                if self.equal(obj1, obj2):
                    self.matches.add((l1_idx, l2_idx))
874483
function listReady(list, error) {
        if (typeof error != 'undefined') {
          callback(error);
          return;
        }
        self.shouldBeTrue(list instanceof List, 'is list');
        self.shouldBeTrue(list.length() == 2, 'is 2');
        list.moveFirst();
        self.shouldBeTrue(list.get('name') == 'Larry', 'larry');
        list.moveNext();
        self.shouldBeTrue(list.get('name') == 'Moe', 'moe');
        createSets();
      }
632616
def list_diff(list_a, list_b):
    
    result = []
    for item in list_b:
        if not item in list_a:
            result.append(item)
    return result