<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> import re <EOL> import time <EOL> from netmiko . ssh_connection import SSHConnection <EOL> class HPProcurveSSH ( SSHConnection ) : <EOL> def session_preparation ( self ) : <EOL> """<STR_LIT>""" <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> self . remote_conn . sendall ( "<STR_LIT:\n>" ) <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> self . ansi_escape_codes = True <EOL> self . set_base_prompt ( ) <EOL> self . disable_paging ( command = "<STR_LIT>" ) <EOL> def enable ( self , cmd = '<STR_LIT>' , pattern = '<STR_LIT:password>' , re_flags = re . IGNORECASE , <EOL> default_username = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> debug = False <EOL> output = self . send_command ( cmd ) <EOL> if '<STR_LIT:username>' in output . lower ( ) : <EOL> output += self . send_command ( default_username ) <EOL> if '<STR_LIT:password>' in output . lower ( ) : <EOL> output += self . send_command ( self . secret ) <EOL> if debug : <EOL> print ( output ) <EOL> self . clear_buffer ( ) <EOL> return output </s>
