def get_host_lun(self, lun_or_snap, cg_member=None):
import storops.unity.resource.lun as lun_module<EOL>import storops.unity.resource.snap as snap_module<EOL>which = None<EOL>if isinstance(lun_or_snap, lun_module.UnityLun):<EOL><INDENT>which = self._get_host_luns(lun=lun_or_snap)<EOL><DEDENT>elif isinstance(lun_or_snap, snap_module.UnitySnap):<EOL><INDENT>if lun_or_snap.is_cg_snap():<EOL><INDENT>if cg_member is None:<EOL><INDENT>log.debug('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(lun_or_snap.id))<EOL>return None<EOL><DEDENT>lun_or_snap = lun_or_snap.get_member_snap(cg_member)<EOL>which = self._get_host_luns(lun=cg_member, snap=lun_or_snap)<EOL><DEDENT>else:<EOL><INDENT>which = self._get_host_luns(snap=lun_or_snap)<EOL><DEDENT><DEDENT>if not which:<EOL><INDENT>log.debug('<STR_LIT>'<EOL>.format(lun_or_snap.name, self.name))<EOL>return None<EOL><DEDENT>return which[<NUM_LIT:0>]<EOL>
Gets the host lun of a lun, lun snap, cg snap or a member snap of cg
        snap.

        :param lun_or_snap: can be lun, lun snap, cg snap or a member snap of
            cg snap.
        :param cg_member: the member lun of cg if `lun_or_snap` is cg snap.
        :return: the host lun object.