def _expand_dots(self, doc):
        expanded = {}
        paths = {}
        for k, v in iteritems(doc):
            key_parts = k.split('.')
            sub_doc = v
            for i in reversed(range(1, len(key_parts))):
                key = key_parts[i]
                sub_doc = {key: sub_doc}
            key = key_parts[0]
            if expanded in key:
                raise WriteError("cannot infer query fields to set, "
                                 "both paths '%s' and '%s' are matched"
                                 % (k, paths[key]))
            paths[key] = k
            expanded[key] = sub_doc
        return expanded
dataset/ETHPy150Open vmalloc/mongomock/mongomock/collection.py/Collection._expand_dots/swapped operands of `in`