'Get the sessions linked to this Object.
Args:
sessid (int, optional): A specific session id.
Returns:
sessions (list): The sessions connected to this object. If `sessid` is given,
this is a list of one (or zero) elements.
Notes:
Aliased to `self.all()`.'

def get(self, sessid=None):

    global _SESSIONS
    if (not _SESSIONS):
        from evennia.server.sessionhandler import SESSIONS as _SESSIONS
    if sessid:
        sessions = ([(_SESSIONS[sessid] if (sessid in _SESSIONS) else None)] if (sessid in self._sessid_cache) else [])
    else:
        sessions = [(_SESSIONS[ssid] if (ssid in _SESSIONS) else None) for ssid in self._sessid_cache]
    if (None in sessions):
        self._recache()
        return self.get(sessid=sessid)
    return sessions
