Return whether *collection* is compatible with this collection.

        To be compatible *collection* must have the same head, tail and padding
        properties as this collection.
195673
def is_compatible(self, collection):
        '''

        '''
        return all([
            isinstance(collection, Collection),
            collection.head == self.head,
            collection.tail == self.tail,
            collection.padding == self.padding
        ])
1208932
private static boolean isCollectionMatching(Joinable mainSideJoinable, OgmCollectionPersister inverseSidePersister) {
		boolean isSameTable = mainSideJoinable.getTableName().equals( inverseSidePersister.getTableName() );

		if ( !isSameTable ) {
			return false;
		}

		return Arrays.equals( mainSideJoinable.getKeyColumnNames(), inverseSidePersister.getElementColumnNames() );
	}
802000
public function sameValueAs(ValueObjectInterface $collection)
    {
        if (false === Util::classEquals($this, $collection) || false === $this->count()->sameValueAs($collection->count())) {
            return false;
        }

        $arrayCollection = $collection->toArray();

        foreach ($this->items as $index => $item) {
            if (!isset($arrayCollection[$index]) || false === $item->sameValueAs($arrayCollection[$index])) {
                return false;
            }
        }

        return true;
    }
597389
def has_common(self, other):
        """"""
        if not isinstance(other, WordSet):
            raise ValueError('Can compare only WordSets')
        return self.term_set & other.term_set
197425
public boolean compatibleWithTable(VoltTable table) {
            String candidateName = getTableName(table);
            // table can't have the same name as the view
            if (candidateName.equals(viewName)) {
                return false;
            }
            // view is for a different table
            if (candidateName.equals(srcTableName) == false) {
                return false;
            }

            try {
                // ignore ret value here - just looking to not throw
                int groupColIndex = table.getColumnIndex(groupColName);
                VoltType groupColType = table.getColumnType(groupColIndex);
                if (groupColType == VoltType.DECIMAL) {
                    // no longer a good type to group
                    return false;
                }

                // check the sum col is still value
                int sumColIndex = table.getColumnIndex(sumColName);
                VoltType sumColType = table.getColumnType(sumColIndex);
                if ((sumColType == VoltType.TINYINT) ||
                        (sumColType == VoltType.SMALLINT) ||
                        (sumColType == VoltType.INTEGER)) {
                    return true;
                }
                else {
                    // no longer a good type to sum
                    return false;
                }
            }
            catch (IllegalArgumentException e) {
                // column index is bad
                return false;
            }
        }
256986
function (collection) {
    if (!collection || !_.isObject(collection)) {
      var err = new Error('Please pass a valid collection!');
      debug(err);
      throw err;
    }

    this.collection = collection;
  }
701049
public static <T> Matcher<T> isNotIn(Collection<T> collection) {
        return not(isIn(collection));
    }
1033395
@SuppressWarnings("unchecked")
    protected static boolean sameType(Collection[] cols) {
        List all = new LinkedList();
        for (Collection col : cols) {
            all.addAll(col);
        }
        if (all.isEmpty())
            return true;

        Object first = all.get(0);

        //trying to determine the base class of the collections
        //special case for Numbers
        Class baseClass;
        if (first instanceof Number) {
            baseClass = Number.class;
        } else if (first == null) {
            baseClass = NullObject.class;
        } else {
            baseClass = first.getClass();
        }

        for (Collection col : cols) {
            for (Object o : col) {
                if (!baseClass.isInstance(o)) {
                    return false;
                }
            }
        }
        return true;
    }
1309613
private static final boolean contains(Collection<String> list, String value) {
        for (String item : list)
            if (item.contains(value))
                return true;
        return false;
    }
1137291
private boolean compatible(int i, int j, Set<Integer> T[][]) {
	if(s2comp[i] != s2comp[j]) return false;
	for(int k = 0; k < nbLabels; k++) {
	    if(! T[i][k].equals(T[j][k])) return false;
	}
	return true;
    }
859883
public static boolean hasUniqueObject(Collection<?> collection) {
        if (isEmpty(collection)) {
            return false;
        }
        boolean hasCandidate = false;
        Object candidate = null;
        for (Object elem : collection) {
            if (!hasCandidate) {
                hasCandidate = true;
                candidate = elem;
            } else if (candidate != elem) {
                return false;
            }
        }
        return true;
    }
423556
private boolean isCompatibleClass(Class checkClass)
    {
        //
        // If the check class is equal to or a super-interface of the map class, then
        // they are compatible.
        //
        if (_mapClass.isAssignableFrom(checkClass))
            return true;

        //
        // If the check class is a property set declared by the map class or a super interface
        // of the map class, then they are compatible.
        //
        if (checkClass.isAnnotationPresent(PropertySet.class))
        {
            Class declaringClass = checkClass.getDeclaringClass();

            // External property sets are always compatible.
            // TODO: Could do a more extensive check..
            if (declaringClass == null)
                return true;

            if (declaringClass.isAssignableFrom(_mapClass))
                return true;
        }

        //
        // If the map class is a property set declared by the check class or a super interface
        // of the check class, then they are compatible.  This is the inverse of the last check,
        // and happens e.g. when a programatically instantiated control w/ an initial property
        // map needs to delegate to the control interface's property map.
        //
        if (_mapClass.isAnnotationPresent(PropertySet.class))
        {
            Class declaringClass = _mapClass.getDeclaringClass();
            if (declaringClass != null &&
                declaringClass.isAssignableFrom(checkClass))
                return true;

            // External property sets have no declaring class
            if (declaringClass == null)
            {
                ExternalPropertySets eps = (ExternalPropertySets) checkClass.getAnnotation(ExternalPropertySets.class);
                if (eps != null)
                {
                    Class[] propSets = eps.value();
                    if (propSets != null)
                    {
                        for (Class ps : propSets)
                        {
                            if (_mapClass.equals(ps))
                                return true;
                        }
                    }
                }
            }
        }

        return false;
    }
1181487
private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding)
    {
    VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
    return (currentValue == null || currentValue.equals( binding.getValueDef()));
    }
104345
public boolean isCompatible()
    {
    boolean compatible;
    Iterator<VarBindingDef> bindings;
    VarBindingDef binding = null;

    for( compatible = true,
           bindings = getBindings();

         compatible
           && bindings.hasNext();

         compatible =
           (binding = bindings.next())
           .getEffectiveCondition()
           .compatible( properties_));

    if( !compatible && size() == 1)
      {
      throw
        new IllegalStateException
        ( "Invalid " + binding
          + ", value condition=" + binding.getValueDef().getCondition()
          + " is incompatible its own properties=" + binding.getValueDef().getProperties());
      }
    
    return compatible;
    }
125566
def allowed(name, collection='all'):
    '''
    
    '''

    if not valid(name):
        return False

    blacklist = names()
    for forbidden in blacklist[collection]:
        if name.lower() == forbidden.lower():
            return False
        if forbidden.endswith('*'):
            # very primitive glob matching
            if name.lower().startswith(forbidden[:-1].lower()):
                return False
        if forbidden.startswith('/'):
            # reference to another collection
            if not allowed(name, collection=forbidden[1:]):
                return False

    # No match.
    return True
414405
public static boolean isCollectionOfType(TypeName typeName, TypeName elementTypeName) {
		return isAssignable(typeName, Collection.class)
				&& isEquals(((ParameterizedTypeName) typeName).typeArguments.get(0), elementTypeName);
	}
1281287
public boolean compatible()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "compatible", this);
        if (tc.isEntryEnabled())
            Tr.exit(tc, "compatible", new Boolean(_compatible));
        return _compatible;
    }