def __init__(self,<EOL>construct,  <EOL>attributes,  <EOL>name=None,<EOL>repeated=False,<EOL>indexed=True,<EOL>):
assert construct is not None<EOL>assert attributes is not None<EOL>self._construct = construct<EOL>if isinstance(attributes, dict):<EOL><INDENT>pass<EOL><DEDENT>elif isinstance(attributes, (list, tuple, set, frozenset)):<EOL><INDENT>attributes = dict(list(zip(attributes, attributes)))<EOL><DEDENT>else:<EOL><INDENT>assert False, type(attributes)<EOL><DEDENT>self._attrmap = {}<EOL>classdict = {}<EOL>for key, value in attributes.items():<EOL><INDENT>if isinstance(value, str):<EOL><INDENT>prop = GenericProperty()<EOL>self._attrmap[key] = (prop, None)<EOL>classdict[key] = prop<EOL><DEDENT>elif isinstance(value, Property):<EOL><INDENT>self._attrmap[key] = (value, None)<EOL>classdict[key] = value<EOL><DEDENT>elif isinstance(value, tuple):<EOL><INDENT>assert len(value) == <NUM_LIT:2>, repr(value)<EOL>prop, func = value<EOL>assert isinstance(prop, Property), repr(prop)<EOL>assert callable(func), repr(func)<EOL>self._attrmap[key] = value<EOL>classdict[key] = prop<EOL><DEDENT>else:<EOL><INDENT>assert False, repr(value)<EOL><DEDENT><DEDENT>modelclass = MetaModel('<STR_LIT>', (Model,), classdict)<EOL>super(CustomProperty, self).__init__(modelclass,<EOL>name,<EOL>repeated=repeated,<EOL>indexed=indexed,<EOL>)<EOL>
Constructor.

        Args:
          construct: A function that takes a 'model class' instance and
            returns an instance of the desired user class.

          attributes: A list, set or tuple of attribute/property names, or
            a dict mapping attribute names to property names, Property
            instances, or (Property instance, function) tuples.  Each
            attribute name corresponds to an attribute of the user class;
            it will be serialized using the corresponding property name.
            If a function is given, it is used to extract the attribute
            from the user object; otherwise the attribute name is used to
            get the attribute from the user object.

          name, repeated, indexed, etc.: As for all properties.