<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from netmiko . base_connection import BaseSSHConnection <EOL> import re <EOL> class SSHConnection ( BaseSSHConnection ) : <EOL> """<STR_LIT>""" <EOL> def check_enable_mode ( self , check_string = '<STR_LIT:#>' ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . check_enable_mode ( check_string = check_string ) <EOL> def enable ( self , cmd = '<STR_LIT>' , pattern = '<STR_LIT:password>' , re_flags = re . IGNORECASE ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . enable ( cmd = cmd , pattern = pattern , re_flags = re_flags ) <EOL> def exit_enable_mode ( self , exit_command = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . exit_enable_mode ( exit_command = exit_command ) <EOL> def check_config_mode ( self , check_string = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . check_config_mode ( check_string = check_string ) <EOL> def config_mode ( self , config_command = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . config_mode ( config_command = config_command ) <EOL> def exit_config_mode ( self , exit_config = '<STR_LIT:end>' ) : <EOL> """<STR_LIT>""" <EOL> return super ( SSHConnection , self ) . exit_config_mode ( exit_config = exit_config ) <EOL> def cleanup ( self ) : <EOL> """<STR_LIT>""" <EOL> self . exit_config_mode ( ) <EOL> self . remote_conn . sendall ( "<STR_LIT>" ) <EOL> def _autodetect_fs ( self , cmd = '<STR_LIT>' , pattern = r'<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> output = self . send_command_expect ( cmd ) <EOL> match = re . search ( pattern , output ) <EOL> if match : <EOL> file_system = match . group ( <NUM_LIT:1> ) <EOL> cmd = "<STR_LIT>" . format ( file_system ) <EOL> output = self . send_command_expect ( cmd ) <EOL> if '<STR_LIT>' not in output : <EOL> return file_system <EOL> raise ValueError ( "<STR_LIT>" <EOL> "<STR_LIT>" . format ( cmd , output ) ) </s>
