(self, addr: Union[str, tuple, socket.socket])
Args:
            addr: can be /var/run/usbmuxd or (localhost, 27015)
Args:
            addr: can be /var/run/usbmuxd or (localhost, 27015)
Args : addr : can be / var / run / usbmuxd or ( localhost 27015 )
def __init__(self, addr: Union[str, tuple, socket.socket]):
        """
        Args:
            addr: can be /var/run/usbmuxd or (localhost, 27015)
        """
        self._sock = None
        if isinstance(addr, socket.socket):
            self._sock = addr
            return
        if isinstance(addr, str):
            if not os.path.exists(addr):
                raise MuxError("socket unix:{} unable to connect".format(addr))
            family = socket.AF_UNIX
        else:
            family = socket.AF_INET

        self._sock = socket.socket(family, socket.SOCK_STREAM)
        self._sock.connect(addr)
def __init__ ( self , addr : Union [ str , tuple , socket . socket ] ) : self . _sock = None if isinstance ( addr , socket . socket ) : self . _sock = addr return if isinstance ( addr , str ) : if not os . path . exists ( addr ) : raise MuxError ( "socket unix:{} unable to connect" . format ( addr ) ) family = socket . AF_UNIX else : family = socket . AF_INET self . _sock = socket . socket ( family , socket . SOCK_STREAM ) self . _sock . connect ( addr )