def find_prompt(self, delay_factor=.1):
        delay_factor = self.select_delay_factor(delay_factor)
        self.clear_buffer()
        self.remote_conn.sendall("\n")
        time.sleep(delay_factor)
        prompt = ''

        # Initial attempt to get prompt
        if self.remote_conn.recv_ready():
            prompt = self.remote_conn.recv(MAX_BUFFER).decode('utf-8', 'ignore')
            prompt = prompt.strip()
            if self.ansi_escape_codes:
                prompt = self.strip_ansi_escape_codes(prompt)

        # Check if the only thing you received was a newline
        count = 0
        while count <= 10 and not prompt:
            if self.wait_for_recv_ready():
                prompt = self.remote_conn.recv(MAX_BUFFER).decode('utf-8', 'ignore')
                if self.ansi_escape_codes:
                    prompt = self.strip_ansi_escape_codes(prompt)
                prompt = prompt.strip()
            count += 1

        # If multiple lines in the output take the last line
        prompt = self.normalize_linefeeds(prompt)
        prompt = prompt.split('\n')[-1]
        prompt = prompt.strip()
        if not prompt:
            raise ValueError("Unable to find prompt: {}".format(prompt))
        time.sleep(delay_factor)
        self.clear_buffer()
        return prompt
Finds the current network device prompt, last line only.
dataset/ETHPy150Open ktbyers/netmiko/netmiko/base_connection.py/BaseSSHConnection.find_prompt