def copy(self):
        '''
        :return: a copy of the container
        '''
        dup = super(Container, self).copy()
        dup._fields = [field.copy() for field in self._fields]
        dup._fields_dict = {field.get_name(): field for field in dup._fields if field.get_name() is not None}
        dup._containers = []
        for container in self._containers:
            idx = self._fields.index(container)
            dup._containers.append(dup._fields[idx])
        for field in dup._fields:
            field.enclosing = dup
        return dup
:return: a copy of the container