def _Contains(i, j, areas, lens, cls):
    """Return True if path i contains majority of vertices of path j.

    Args:
      i: index of supposed containing path
      j: index of supposed contained path
      areas: list of floats - areas of all the paths
      lens: list of ints - lenths of each of the paths
      cls: dict - maps pairs to result of _ClassifyPathPairs
    Returns:
      bool - True if path i contains at least 55% of j's vertices
    """

    if i == j:
        return False
    (jinsidei, joni) = cls[(i, j)]
    if jinsidei == 0 or joni == lens[j] or \
       float(jinsidei) / float(lens[j]) < 0.55:
        return False
    else:
        (insidej, _) = cls[(j, i)]
        if float(insidej) / float(lens[i]) > 0.55:
            return areas[i] > areas[j]  # tie breaker
        else:
            return True