@staticmethod<EOL><INDENT>def __prepare_local(data):<DEDENT>
if not data:<EOL><INDENT>return None<EOL><DEDENT>data = str(data)<EOL>try:<EOL><INDENT>local = NODEPREP.prepare(data)<EOL><DEDENT>except StringprepError as err:<EOL><INDENT>raise JIDError("<STR_LIT>".format(err))<EOL><DEDENT>if len(local.encode("<STR_LIT:utf-8>")) > <NUM_LIT>:<EOL><INDENT>raise JIDError("<STR_LIT>")<EOL><DEDENT>return local<EOL>
Prepare localpart of the JID

        :Parameters:
            - `data`: localpart of the JID
        :Types:
            - `data`: `unicode`

        :raise JIDError: if the local name is too long.
        :raise pyxmpp.xmppstringprep.StringprepError: if the
            local name fails Nodeprep preparation.