Return a new collection without any inner class names
431865
public static Collection removeInnerClassNames( Collection col ) {
        List list = new ArrayList();
        list.addAll(col);
        Iterator it = list.iterator();
        while(it.hasNext()) {
            String name =(String)it.next();
            if (name.indexOf("$") != -1 )
                it.remove();
        }
        return list;
    }
927536
def _new_type(cls, args):
        

        fformat = ["%r" if f is None else "%s=%%r" % f for f in args]
        fformat = "(%s)" % ", ".join(fformat)

        class _ResultTuple(cls):
            __slots__ = ()
            _fformat = fformat
            if args:
                for i, a in enumerate(args):
                    if a is not None:
                        vars()[a] = property(itemgetter(i))
                del i, a

        return _ResultTuple
734705
def without(self, *values):
        
        if self._clean.isDict():
            newlist = {}
            for i, k in enumerate(self.obj):
                # if k not in values:  # use indexof to check identity
                if _(values).indexOf(k) is -1:
                    newlist.set(k, self.obj[k])
        else:
            newlist = []
            for i, v in enumerate(self.obj):
                # if v not in values:  # use indexof to check identity
                if _(values).indexOf(v) is -1:
                    newlist.append(v)

        return self._wrap(newlist)
251822
def get_cls_for_collection(self, collection):
        
        for cls, params in self.classes.items():
            if params['collection'] == collection:
                return cls
        raise AttributeError("Unknown collection: %s" % collection)
591623
public static <T> ArrayList<T> newArrayList(Collection<T> collection) {
		return (ArrayList<T>) list(false, collection);
	}
125512
function constructCollection(Collection, options) {
  return construct({
    input: Collection,
    expected: AmpersandCollection,
    createConstructor: collection,
    options: options
  });
}
1013264
def derive_mapper_from_collection(collection)
      if m = collection.first
        name = "#{m.class.name.split('::').last}CollectionMapper"
        begin
          return @options[:namespace].const_get(name)
        rescue NameError               # rubocop:disable Lint/HandleExceptions
        end
      end
      begin
        return @options[:namespace].const_get(:CollectionMapper)
      rescue NameError                 # rubocop:disable Lint/HandleExceptions
      end
      CollectionMapper
    end
738203
function getCollection(key, collectionName, database, options, callback) {
    getDatabaseCached(database, options, getOrCreateCollection)

    function getOrCreateCollection(err, db) {
        if (err) {
            return callback(err)
        }

        // get the collection
        db.collection(collectionName, extend({
            safe: true
        }, options.collectionOptions), createIfNotExist)

        function createIfNotExist(err, collection) {
            // if not exist create it
            if (err && err.message.indexOf(" does not exist") !== -1) {
                return db.createCollection(collectionName, extend({
                    safe: true
                }, options.createCollectionOptions), returnCollection)
            }

            if (err) {
                return callback(err)
            }

            callback(null, collection)
        }
    }

    function returnCollection(err, col) {
        if (err) {
            return callback(err)
        }

        callback(null, col)
    }
}
198115
def get_collection(source, name, collection_format, default):
    
    if collection_format in COLLECTION_SEP:
        separator = COLLECTION_SEP[collection_format]
        value = source.get(name, None)
        if value is None:
            return default
        return value.split(separator)
    if collection_format == 'brackets':
        return source.getall(name + '[]', default)
    else:                       # format: multi
        return source.getall(name, default)
107923
def get_collections(self, data):
        """"""
        collections = self._filter_queryset('view_collection', data.collection_set.all())

        from .collection import CollectionSerializer

        class CollectionWithoutDataSerializer(WithoutDataSerializerMixin, CollectionSerializer):
            """Collection without data field serializer."""

        return self._serialize_items(CollectionWithoutDataSerializer, 'collections', collections)
1116129
def _fromset(cls, values, key=None):
        """"""
        sorted_set = object.__new__(cls)
        sorted_set._set = values  # pylint: disable=protected-access
        sorted_set.__init__(key=key)
        return sorted_set
1356621
function (name, items) {
    var List = this.get('List');
    var list = this.lists[name];
    if (typeof list === 'undefined') {
      var opts = lazy.clone(this.options);
      opts.items = items || this.items;
      opts.collection = this;
      this.lists[name] = list = new List(opts);
    }
    return list;
  }
860202
function(json){
    
    // Protect against forgetting the new keyword when calling the constructor
    if(!(this instanceof Collection)){
      return new Collection(json);
    }
    
    // If the given object is already an instance then just return it. DON'T copy it.
    if(Collection.isInstance(json)){
      return json;
    }
    
    this.init(json);
  }
251614
def new(self, items:Iterator, processor:PreProcessors=None, **kwargs)->'ItemList':
        ""
        processor = ifnone(processor, self.processor)
        copy_d = {o:getattr(self,o) for o in self.copy_new}
        kwargs = {**copy_d, **kwargs}
        return self.__class__(items=items, processor=processor, **kwargs)
689067
def map_collection(func, collection):
    
    datatype = type(collection)
    if isinstance(collection, Mapping):
        return datatype((key, func(val)) for key, val in collection.items())
    if is_string(collection):
        return collection
    elif isinstance(collection, Iterable):
        return datatype(map(func, collection))
    else:
        return collection
1175850
def enable_collection(f):
    """"""
    @wraps(f)
    def new_f(h: AbstractHistogram1D, **kwargs):
        from physt.histogram_collection import HistogramCollection
        if isinstance(h, HistogramCollection):
            return f(h, **kwargs)
        else:
            return f(HistogramCollection(h), **kwargs)
    return new_f
1212711
def get_objects_without_object(self, obj_type, *child_types):
        
        return [o for o in self.get_objects_by_type(obj_type) if
                not o.get_objects_by_type(*child_types)]