'This method implements the creation of a `ListSerializer` parent
class when `many=True` is used. You can customize it if you need to
control which keyword arguments are passed to the parent, and
which are passed to the child.
Note that we\'re over-cautious in passing most arguments to both parent
and child classes in order to try to cover the general case. If you\'re
overriding this method you\'ll probably want something much simpler, eg:
@classmethod
def many_init(cls, *args, **kwargs):
kwargs[\'child\'] = cls()
return CustomListSerializer(*args, **kwargs)'

@classmethod
def many_init(cls, *args, **kwargs):

    allow_empty = kwargs.pop(u'allow_empty', None)
    child_serializer = cls(*args, **kwargs)
    list_kwargs = {u'child': child_serializer}
    if (allow_empty is not None):
        list_kwargs[u'allow_empty'] = allow_empty
    list_kwargs.update({key: value for (key, value) in kwargs.items() if (key in LIST_SERIALIZER_KWARGS)})
    meta = getattr(cls, u'Meta', None)
    list_serializer_class = getattr(meta, u'list_serializer_class', ListSerializer)
    return list_serializer_class(*args, **list_kwargs)
