/*
Determine if this conversion should be performed on the given
collection.
422777
public function shouldBePerformedOn(string $collectionName): bool
    {
        //if no collections were specified, perform conversion on all collections
        if (! count($this->performOnCollections)) {
            return true;
        }

        if (in_array('*', $this->performOnCollections)) {
            return true;
        }

        return in_array($collectionName, $this->performOnCollections);
    }
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() );
	}
1072621
public static <T, J extends Convertable<T>> ArrayList<T> convert(Collection<J> collection) {
        if (collection == null) {
            return null;
        }

        ArrayList<T> list = new ArrayList<>(collection.size());

        for (J json : collection) {
            try {
                T item = json == null ? null : json.convert();
                if (item != null) {
                    list.add(item);
                }
            } catch (ParseException e) {
                Log.e("ConvertUtils", "Error converting item (" + json.getClass().getSimpleName()
                        + ") : " + e.getMessage());
            }
        }

        return list;
    }
231575
protected void checkCollectionType(Collection c) {
        if (type != null) {
            for (Iterator iter = c.iterator(); iter.hasNext(); ) {
                Object element = iter.next();
                checkType(element);
            }
        }
    }
180415
@Override
    public boolean shouldCompile(ScriptArchive archive) {

        Set<String> entries = archive.getArchiveEntryNames();
        boolean shouldCompile = false;
        for (String entry: entries) {
            if (entry.endsWith(".class")) {
                shouldCompile = true;
            }
        }

        return shouldCompile;
    }
1351686
private boolean isCollection(Class<?> rawType) {

    // this sucks... is there really no way to work around this in GWT?
    // http://code.google.com/p/google-web-toolkit/issues/detail?id=4663
    if (rawType == Collection.class) {
      return true;
    }
    if (rawType == List.class) {
      return true;
    }
    if (rawType == Set.class) {
      return true;
    }
    Class<?> superType = rawType;
    while (superType != null) {
      if (superType == AbstractCollection.class) {
        return true;
      }
      superType = superType.getSuperclass();
    }
    return false;
  }
526504
@Override
    public boolean supportsConvert(int fromType, int toType) throws SQLException {
        checkClosed();
        switch (fromType) {
        /*
         * ALL types can be converted to VARCHAR /VoltType.String
         */
        case java.sql.Types.VARCHAR:
        case java.sql.Types.VARBINARY:
        case java.sql.Types.TIMESTAMP:
        case java.sql.Types.OTHER:
            switch (toType) {
            case java.sql.Types.VARCHAR:
                return true;

            default:
                return false;
            }
        case java.sql.Types.TINYINT:
        case java.sql.Types.SMALLINT:
        case java.sql.Types.INTEGER:
        case java.sql.Types.BIGINT:
        case java.sql.Types.FLOAT:
        case java.sql.Types.DECIMAL:
            switch (toType) {
            case java.sql.Types.VARCHAR:
            case java.sql.Types.TINYINT:
            case java.sql.Types.SMALLINT:
            case java.sql.Types.INTEGER:
            case java.sql.Types.BIGINT:
            case java.sql.Types.FLOAT:
            case java.sql.Types.DECIMAL:
                return true;

            default:
                return false;
            }
        default:
            return false;
        }
    }
565796
@Override
  public <T> boolean isCollectionReadonly(String collectionName) {
    CollectionMetaData cmd = cmdMap.get(collectionName);
    return cmd.isReadOnly();
  }
1323297
protected Collection<?> convertInternal(Object value) {
		final Collection<Object> collection = CollectionUtil.create(TypeUtil.getClass(this.collectionType));
		return CollUtil.addAll(collection, value, this.elementType);
	}
1117812
def is_collection(obj):
    """"""

    col = getattr(obj, '__getitem__', False)
    val = False if (not col) else True

    if isinstance(obj, basestring):
        val = False

    return val
378094
public static <E, T extends Collection<E>> void ifExist(T collection,
            Consumer<T> consumer) {
        getOptional(collection).ifPresent(consumer);
    }
830789
private static boolean checkCollectionMembers(Collection<?> c, Class<?> type) {
        for (Object element : c) {
            if (element != null && !type.isInstance(element)) {
                return false;
            }
        }
        return true;
    }
425340
public static function isValid($collection)
    {
        if (false === is_array($collection) && false === ($collection instanceof Collection)) {
            return false;
        }

        return true;
    }
973997
def requires_conversion(cls, fileset, file_format):
        """"""
        if file_format is None:
            return False
        try:
            filset_format = fileset.format
        except AttributeError:
            return False  # Field input
        else:
            return (file_format != filset_format)
411520
@SuppressWarnings({ "rawtypes", "unchecked" })
    protected Object parseCollection(GetterMethodCover method, 
            Collection collection) {
        if(method.isArrayObjectCollection()) {
            return parseArrayObjectCollection(method, collection);
        }
        else if(method.isObjectCollection()) {
            return parseObjectCollection(method, collection);
        }
        else if(method.isByteCollection()) {
            return collectionToPrimitiveByteArray(collection);
        }
        else if(method.isCharCollection()) {
            return charCollectionToPrimitiveByteArray(collection);
        }
        else if(method.isArrayCollection()) {
            return parseArrayCollection(method, collection);
        }
        return collection;
    }
537195
private static void checkProperties(ConverterProperties properties) {
        boolean isIllegal = properties.isOnlyScanNonStaticMethod() && properties.isOnlyScanStaticMethod();
        if (isIllegal) {
            throw InvalidConfigurationException
                    .of("Only scanning static methods or scanning only non static methods can only select one");
        }
    }