@classmethod<EOL><INDENT>def _fix_up_properties(cls):<DEDENT>
<EOL>kind = cls._get_kind()<EOL>if not isinstance(kind, basestring):<EOL><INDENT>raise KindError('<STR_LIT>'<EOL>'<STR_LIT>' % (cls.__name__, kind))<EOL><DEDENT>if not isinstance(kind, str):<EOL><INDENT>try:<EOL><INDENT>kind = kind.encode('<STR_LIT:ascii>')  <EOL><DEDENT>except UnicodeEncodeError:<EOL><INDENT>raise KindError('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(cls.__name__, kind))<EOL><DEDENT><DEDENT>cls._properties = {}  <EOL>if cls.__module__ == __name__:  <EOL><INDENT>return<EOL><DEDENT>for name in set(dir(cls)):<EOL><INDENT>attr = getattr(cls, name, None)<EOL>if isinstance(attr, ModelAttribute) and not isinstance(attr, ModelKey):<EOL><INDENT>if name.startswith('<STR_LIT:_>'):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' % name)<EOL><DEDENT>attr._fix_up(cls, name)<EOL>if isinstance(attr, Property):<EOL><INDENT>if (attr._repeated or<EOL>(isinstance(attr, StructuredProperty) and<EOL>attr._modelclass._has_repeated)):<EOL><INDENT>cls._has_repeated = True<EOL><DEDENT>cls._properties[attr._name] = attr<EOL><DEDENT><DEDENT><DEDENT>cls._update_kind_map()<EOL>
Fix up the properties by calling their _fix_up() method.

        Note: This is called by MetaModel, but may also be called manually
        after dynamically updating a model class.