Returns the precedence of a given object.
501097
def precedence(item):
    """"""
    try:
        mro = item.__class__.__mro__
    except AttributeError:
        return PRECEDENCE["Atom"]
    for i in mro:
        n = i.__name__
        if n in PRECEDENCE_FUNCTIONS:
            return PRECEDENCE_FUNCTIONS[n](item)
        elif n in PRECEDENCE_VALUES:
            return PRECEDENCE_VALUES[n]
    return PRECEDENCE["Atom"]
207222
private static int classPriority(Class<?> o1) {
    Priority p = o1.getAnnotation(Priority.class);
    if(p == null) {
      Class<?> pa = o1.getDeclaringClass();
      p = (pa != null) ? pa.getAnnotation(Priority.class) : null;
    }
    return p != null ? p.value() : Priority.DEFAULT;
  }
816271
public function getPriority(ObjectHandlable $object)
    {
        $result = false;

        if($handle = $object->getHandle())
        {
            if($this->__priority_list->offsetExists($handle)) {
                $result = $this->__priority_list->offsetGet($handle);
            }
        }

        return $result;
    }
1051363
function sortObj(obj) {
    return Object.keys(obj).sort()
        .filter(key => obj[key] || obj[key] === 0)
        .reduce((acc, key) => ({ ...acc, [key]: obj[key] }), {});
}
863921
private String getOrdinal(Integer value)
   {
      String result;
      int index = value.intValue();
      if (index >= ORDINAL.length)
      {
         result = "every " + index + "th";
      }
      else
      {
         result = ORDINAL[index];
      }
      return result;
   }
1269292
public static <T> T first(Iterable<T> objects) {
        if (objects != null) {
            for (T object : objects) {
                return object;
            }
        }
        return null;
    }
448428
def ordered(obj):
    
    if isinstance(obj, collections.abc.Mapping):
        return sorted((k, ordered(v)) for k, v in obj.items())
    # Special case str since it's a collections.abc.Iterable
    elif isinstance(obj, str):
        return obj
    elif isinstance(obj, collections.abc.Iterable):
        return sorted(ordered(x) for x in obj)
    else:
        return obj
1087144
public static <T> int compareTo(Comparable<T> object1, T object2) {
		if (object1 == object2) {
			return 0;
		}
		if (object1 == null) {
			return Integer.MIN_VALUE;
		}
		if (object2 == null) {
			return Integer.MAX_VALUE;
		}
		assert object1 != null && object2 != null;
		return object1.compareTo(object2);
	}
286301
public int indexOf(T object) {
        synchronized (mLock) {
            if (mOriginalValues != null) {
                return mOriginalValues.indexOf(object);
            } else {
                return mObjects.indexOf(object);
            }
        }
    }
563703
def get_value(cls, object_version, key):
        """"""
        obj = cls.get(object_version, key)
        return obj.value if obj else None
1112495
public int compareTo(Object object)
   {

      if (object == null || !(object instanceof Named))

      {

         return -1;

      }
      else

      {

         Named vo = (Named) object;

         return getName().compareTo(vo.getName());

      }

   }
113858
function _objEquals(a, b) {
    const aKeys = Object.keys(a);

    return _arrEquals(aKeys.sort(), Object.keys(b).sort()) &&
        aKeys.every(i => _equals(a[i], b[i]));
}
1170949
public int compareTo(Object obj) {
		DistinguishedName that = (DistinguishedName) obj;
		ListComparator comparator = new ListComparator();
		return comparator.compare(this.names, that.names);
	}
1294540
public static final Function<Float,Boolean> eq(final Float object) {
        return (Function<Float,Boolean>)((Function)FnObject.eq(object));
    }
1361162
function getIndex(objects, obj) {

            var i;
            for (i = 0; i < objects.length; i++) {
                if (objects[i] === obj) {
                    return i;
                }
            }

            return -1;
        }
898745
def un_priority(op,val):
  ""
  if isinstance(val,BinX) and val.op < op: return bin_priority(val.op,UnX(op,val.left),val.right)
  else: return UnX(op,val)
1167584
public static <T> Predicate<T> equalTo(final T obj) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T o) {
        return Objects.equal(o, obj);
      }
    };
  }