def connect(self):
        """ Establish a connection to the device.

        Purpose: This method is used to make a connection to the junos
               | device. The internal property conn_type is what
               | determines the type of connection we make to the device.
               | - 'paramiko' is used for operational commands (to allow
               |            pipes in commands)
               | - 'scp' is used for copying files
               | - 'shell' is used for to send shell commands
               | - 'root' is used when logging into the device as root, and
               |            wanting to send operational commands
               | - 'ncclient' is used for the rest (commit, compare_config,
               |            commit_check)

        @returns: None
        @rtype: None
        """
        if self.conn_type == 'paramiko':
            self._session = paramiko.SSHClient()
            # These two lines set the paramiko logging to Critical to
            # remove extra messages from being sent to the user output.
            logger = logging.Logger.manager.getLogger('paramiko.transport')
            logger.setLevel(logging.CRITICAL)
            self._session.set_missing_host_key_policy(
                paramiko.AutoAddPolicy())
            self._session.connect(hostname=self.host,
                                  username=self.username,
                                  password=self.password,
                                  port=self.port,
                                  timeout=self.connect_timeout)
        if self.conn_type == 'scp':
            self._scp_session = paramiko.SSHClient()
            logger = logging.Logger.manager.getLogger('paramiko.transport')
            logger.setLevel(logging.CRITICAL)
            self._scp_session.set_missing_host_key_policy(
                paramiko.AutoAddPolicy())
            self._scp_session.connect(hostname=self.host,
                                      username=self.username,
                                      password=self.password,
                                      port=self.port,
                                      timeout=self.connect_timeout)
            self._scp = SCPClient(self._scp_session.get_transport())
        elif self.conn_type == "ncclient":
            self._session = manager.connect(
                host=self.host,
                port=self.port,
                username=self.username,
                password=self.password,
                timeout=self.connect_timeout,
                device_params={'name': 'junos'},
                hostkey_verify=False
            )
        elif self.conn_type == 'shell':
            if not self._session:
                self.conn_type = 'paramiko'
                self.connect()
                self.conn_type = 'shell'
            if not self._shell:
                self._shell = self._session.invoke_shell()
                time.sleep(2)
                if self.username != 'root' and not self._in_cli:
                    self._in_cli = True
            if not self.cli_to_shell():
                self._shell.recv(9999)
        elif self.conn_type == 'root':
            # open the shell if necessary, and move into CLI
            if not self._shell:
                self._shell = self._session.invoke_shell()
                time.sleep(2)
            if not self.shell_to_cli():
                self._shell.recv(9999)
        self._update_timeout(self.session_timeout)
Establish a connection to the device.

        Purpose: This method is used to make a connection to the junos
               | device. The internal property conn_type is what
               | determines the type of connection we make to the device.
               | - 'paramiko' is used for operational commands (to allow
               |            pipes in commands)
               | - 'scp' is used for copying files
               | - 'shell' is used for to send shell commands
               | - 'root' is used when logging into the device as root, and
               |            wanting to send operational commands
               | - 'ncclient' is used for the rest (commit, compare_config,
               |            commit_check)

        @returns: None
        @rtype: None