'Save user-defined command and deactivate it
Args:
- cmd: user-defined command (String)
Returns:
- True if success to save (Bool)'

def save_user_command(self, cmd):

    commands = self.execute_redirect(('show    user    %s' % cmd))
    if (not commands):
        return False
    commands = '\n'.join(commands.splitlines()[1:])
    commands = ((('define    %s\n' % cmd) + commands) + 'end\n')
    self.SAVED_COMMANDS[cmd] = commands
    tmp = tmpfile()
    tmp.write(('define    %s\nend\n' % cmd))
    tmp.flush()
    result = self.execute(('source    %s' % tmp.name))
    tmp.close()
    return result
