def __init__(self, jid, name = None, groups = None,<EOL>subscription = None, ask = None, approved = None):
<EOL>self.jid = JID(jid)<EOL>if name is not None:<EOL><INDENT>self.name = str(name)<EOL><DEDENT>else:<EOL><INDENT>self.name = None<EOL><DEDENT>if groups is not None:<EOL><INDENT>self.groups = set(groups)<EOL><DEDENT>else:<EOL><INDENT>self.groups = set()<EOL><DEDENT>if subscription == "<STR_LIT:none>":<EOL><INDENT>subscription = None<EOL><DEDENT>self.subscription = subscription<EOL>if ask is not None:<EOL><INDENT>self.ask = ask<EOL><DEDENT>else:<EOL><INDENT>self.ask = None<EOL><DEDENT>self.approved = bool(approved)<EOL>self._duplicate_group = False<EOL>
Initialize a roster item element.

:Parameters:
    - `jid`: entry jid
    - `name`: item visible name
    - `groups`: iterable of groups the item is member of
    - `subscription`: subscription type (None, "to", "from", "both"
                                                            or "remove")
    - `ask`: "subscribe" if there was unreplied subscription request
      sent
    - `approved`: `True` if the entry subscription is pre-approved