Return comparison of first, middle, and last components
340462
def _compare_components(self, other, settings, ratio=False):
        """"""

        first = compare_name_component(
            self.first_list,
            other.first_list,
            settings['first'],
            ratio,
        )

        if settings['check_nickname']:
            if first is False:
                first = compare_name_component(
                    self.nickname_list,
                    other.first_list,
                    settings['first'],
                    ratio
                ) or compare_name_component(
                    self.first_list,
                    other.nickname_list,
                    settings['first'],
                    ratio
                )
            elif ratio and first is not 100:
                first = max(
                    compare_name_component(
                        self.nickname_list,
                        other.first_list,
                        settings['first'],
                        ratio
                    ),
                    compare_name_component(
                        self.first_list,
                        other.nickname_list,
                        settings['first'],
                        ratio
                    ),
                    first,
                )

        middle = compare_name_component(
            self.middle_list,
            other.middle_list,
            settings['middle'],
            ratio,
        )

        last = compare_name_component(
            self.last_list,
            other.last_list,
            settings['last'],
            ratio,
        )

        return first, middle, last
1213893
def find_previous(element, l):
    
    length = len(l)
    for index, current in enumerate(l):
        # current is the last element
        if length - 1 == index:
            return current

        # current is the first element
        if index == 0:
            if element < current:
                return None

        if current <= element < l[index+1]:
            return current
388576
function isOpponentsEqual(exOpponents, currentOpponents) {
    var ans = false,
        cOpponents = currentOpponents.sort();

    if (exOpponents.length) {
        exOpponents.forEach(function(i) {
            var array = i.sort();

            ans = (array.length == cOpponents.length) && array.every(function(el, index) {
                return el === cOpponents[index];
            });
        });
    }

    return ans;
}
1137480
def get_component_product(self, other):
        """"""
        return Point(self.x * other.x, self.y * other.y)
1267773
def get_component(self, component_type):
        '''
        
        '''
        matching_components = list(filter(lambda component:
                                          isinstance(component,
                                                     component_type),
                                          self._components))
        if matching_components:
            return matching_components[0]
        else:
            return None
1120824
function comparison(model, options, keys, index=0) {
  const key = keys[index];

  if (keys.length === index) {
    return model[key] === options[key];
  } else if (model[key] === options[key]) {
    return comparison(model, options, keys, index + 1);
  }

  return false;
}
1143908
function getComponent(aType) {
      var ucname = aType.toUpperCase();
      return (ucname in this.parts ? this.parts[ucname].slice() : []);
    }
539358
function getLeftmost(start) {
       var p = start,
           leftmost = start;
       do {
           if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
           p = p.next;
       } while (p !== start);

       return leftmost;
   }
621112
public int compare(Object o1, Object o2) {
		List list1 = (List) o1;
		List list2 = (List) o2;

		for (int i = 0; i < list1.size(); i++) {
			if (list2.size() > i) {
				Comparable component1 = (Comparable) list1.get(i);
				Comparable component2 = (Comparable) list2.get(i);
				int componentsCompared = component1.compareTo(component2);
				if (componentsCompared != 0) {
					return componentsCompared;
				}
			}
			else {
				// First instance has more components, so that instance is
				// greater.
				return 1;
			}
		}

		// All components so far are equal - if the other instance has
		// more components it is greater otherwise they are equal.
		if (list2.size() > list1.size()) {
			return -1;
		}
		else {
			return 0;
		}
	}
1039467
private static <T> Comparator<List<Optional<LocalProperty<T>>>> matchedLayoutPreference()
    {
        return (matchLayout1, matchLayout2) -> {
            Iterator<Optional<LocalProperty<T>>> match1Iterator = matchLayout1.iterator();
            Iterator<Optional<LocalProperty<T>>> match2Iterator = matchLayout2.iterator();
            while (match1Iterator.hasNext() && match2Iterator.hasNext()) {
                Optional<LocalProperty<T>> match1 = match1Iterator.next();
                Optional<LocalProperty<T>> match2 = match2Iterator.next();
                if (match1.isPresent() && match2.isPresent()) {
                    return Integer.compare(match1.get().getColumns().size(), match2.get().getColumns().size());
                }
                else if (match1.isPresent()) {
                    return 1;
                }
                else if (match2.isPresent()) {
                    return -1;
                }
            }
            checkState(!match1Iterator.hasNext() && !match2Iterator.hasNext()); // Should be the same size
            return 0;
        };
    }
982907
private static final boolean longMultisetsEqual(long[] firstDeps, long[] secondDeps) {
    if (firstDeps.length != secondDeps.length) {
      return false;
    }
    Arrays.sort(firstDeps);
    Arrays.sort(secondDeps);

    for (int i = 0; i < firstDeps.length; i++) {
      if (firstDeps[i] != secondDeps[i]) {
        return false;
      }
    }
    return true;
  }
581693
def last(self, skipna=None, keep_attrs=None):
        
        return self._first_or_last(duck_array_ops.last, skipna, keep_attrs)
219234
function findPartials(fragment) {
	var found = [];

	walkRecursive(fragment.t, function(item) {
		if (item.t === 8) {
			found.push(item.r);
		}
	});

	return _.uniq(found);
}
248788
function compare (options, less, x, y) {
  const ifLess = options.asc ? -1 : 1;

  return less(x, y) ? ifLess
    : less(y, x) ? -ifLess
    : 0;
}
431995
function Compare(left, right, columns, order)
{
	//Compare all
	for(var i = 0; i < columns.length; i++)
	{
		//Check if que difference is numeric
		var numeric = !isNaN(+left[columns[i]] - +right[columns[i]]);

		//Get the values
		var a = (numeric === true) ? +left[columns[i]] : left[columns[i]].toLowerCase();
		var b = (numeric === true) ? +right[columns[i]] : right[columns[i]].toLowerCase();

		//Check the values
		if(a < b)
		{
			//Check the order
			return (order[i] === 'ASC') ? -1 : 1;
		}
		else if(a > b)
		{
			//Check the order
			return (order[i] === 'ASC') ? 1 : -1;
		}
	}

	//Default, return 0
	return 0;
}
453671
def get_range_info(array, component):
    """"""
    r = array.GetRange(component)
    comp_range = {}
    comp_range['min'] = r[0]
    comp_range['max'] = r[1]
    comp_range['component'] = array.GetComponentName(component)
    return comp_range
393761
static int compare (final Date nextFireTime1,
                        final int priority1,
                        final TriggerKey key1,
                        final Date nextFireTime2,
                        final int priority2,
                        final TriggerKey key2)
    {
      if (nextFireTime1 != null || nextFireTime2 != null)
      {
        if (nextFireTime1 == null)
          return 1;
        if (nextFireTime2 == null)
          return -1;
        if (nextFireTime1.before (nextFireTime2))
          return -1;
        if (nextFireTime1.after (nextFireTime2))
          return 1;
      }

      int comp = priority2 - priority1;
      if (comp == 0)
        comp = key1.compareTo (key2);
      return comp;
    }