def _xfer_file(<EOL>self,<EOL>source_file=None,<EOL>source_config=None,<EOL>dest_file=None,<EOL>file_system=None,<EOL>TransferClass=FileTransfer,<EOL>):
if not source_file and not source_config:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not dest_file or not file_system:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if source_file:<EOL><INDENT>kwargs = dict(<EOL>ssh_conn=self.device,<EOL>source_file=source_file,<EOL>dest_file=dest_file,<EOL>direction="<STR_LIT>",<EOL>file_system=file_system,<EOL>)<EOL><DEDENT>elif source_config:<EOL><INDENT>kwargs = dict(<EOL>ssh_conn=self.device,<EOL>source_config=source_config,<EOL>dest_file=dest_file,<EOL>direction="<STR_LIT>",<EOL>file_system=file_system,<EOL>)<EOL><DEDENT>use_scp = True<EOL>if self.inline_transfer:<EOL><INDENT>use_scp = False<EOL><DEDENT>with TransferClass(**kwargs) as transfer:<EOL><INDENT>if transfer.check_file_exists() and transfer.compare_md5():<EOL><INDENT>msg = "<STR_LIT>"<EOL>return (True, msg)<EOL><DEDENT>if not transfer.verify_space_available():<EOL><INDENT>msg = "<STR_LIT>"<EOL>return (False, msg)<EOL><DEDENT>if use_scp:<EOL><INDENT>cmd = "<STR_LIT>"<EOL>show_cmd = "<STR_LIT>".format(cmd)<EOL>output = self.device.send_command_expect(show_cmd)<EOL>if cmd not in output:<EOL><INDENT>msg = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>raise CommandErrorException(msg)<EOL><DEDENT><DEDENT>transfer.transfer_file()<EOL>if transfer.verify_file():<EOL><INDENT>msg = "<STR_LIT>"<EOL>return (True, msg)<EOL><DEDENT>else:<EOL><INDENT>msg = "<STR_LIT>"<EOL>return (False, msg)<EOL><DEDENT>return (False, "<STR_LIT>")<EOL><DEDENT>
Transfer file to remote device.

        By default, this will use Secure Copy if self.inline_transfer is set, then will use
        Netmiko InlineTransfer method to transfer inline using either SSH or telnet (plus TCL
        onbox).

        Return (status, msg)
        status = boolean
        msg = details on what happened