@class_cloner
    def of(cls, *fields):
        """TODO: doc of()"""
        # TODO: doc
        # TODO: maybe accept **kw?
        for field in fields:
            if isinstance(field, Element):
                raise TypeError("'of' must be initialized with types, got "
                                "instance %r" % field)

        unique_names = set(field.name for field in fields)
        # TODO: ensure these are types, not instances
        if len(unique_names) != len(fields):
            names = [field.name for field in fields]
            dupes = [name for name in unique_names if names.count(name) > 1]
            raise TypeError(
                "All fields in a %s must have unique names. "
                "Duplicates of: %s " % (
                    cls.__name__,
                    ', '.join(repr(f) for f in dupes)))

        cls.field_schema = fields
        return cls
dataset/ETHPy150Open jek/flatland/flatland/schema/containers.py/Dict.of/original