parameters: (self, path, packages=None, apk=False, shared=False,
               nosystem=True, include_all=False, timeout=DEFAULT_TIMEOUT,
               retries=DEFAULT_RETRIES)
return_statement: return ret
docstring: Write an archive of the device's data to |path|.
  
      Args:
        path: Local path to store the backup file.
        packages: List of to packages to be backed up.
        apk: (optional) If set include the .apk files in the archive.
        shared: (optional) If set buckup the device's SD card.
        nosystem: (optional) If set exclude system applications.
        include_all: (optional) If set back up all installed applications and
          |packages| is optional.
        timeout: (optional) Timeout per try in seconds.
        retries: (optional) Number of retries to attempt.
docstring_summary: Write an archive of the device's data to |path|.
docstring_tokens: Write an archive of the device s data to |path| .
function: def Backup(self, path, packages=None, apk=False, shared=False,
               nosystem=True, include_all=False, timeout=DEFAULT_TIMEOUT,
               retries=DEFAULT_RETRIES):
      """Write an archive of the device's data to |path|.
  
      Args:
        path: Local path to store the backup file.
        packages: List of to packages to be backed up.
        apk: (optional) If set include the .apk files in the archive.
        shared: (optional) If set buckup the device's SD card.
        nosystem: (optional) If set exclude system applications.
        include_all: (optional) If set back up all installed applications and
          |packages| is optional.
        timeout: (optional) Timeout per try in seconds.
        retries: (optional) Number of retries to attempt.
      """
      cmd = ['backup', '-f', path]
      if apk:
        cmd.append('-apk')
      if shared:
        cmd.append('-shared')
      if nosystem:
        cmd.append('-nosystem')
      if include_all:
        cmd.append('-all')
      if packages:
        cmd.extend(packages)
      assert bool(packages) ^ bool(include_all), (
          'Provide \'packages\' or set \'include_all\' but not both.')
      ret = self._RunDeviceAdbCmd(cmd, timeout, retries)
      VerifyLocalFileExists(path)
      return ret
function_tokens: def Backup ( self , path , packages = None , apk = False , shared = False , nosystem = True , include_all = False , timeout = DEFAULT_TIMEOUT , retries = DEFAULT_RETRIES ) : cmd = [ 'backup' , '-f' , path ] if apk : cmd . append ( '-apk' ) if shared : cmd . append ( '-shared' ) if nosystem : cmd . append ( '-nosystem' ) if include_all : cmd . append ( '-all' ) if packages : cmd . extend ( packages ) assert bool ( packages ) ^ bool ( include_all ) , ( 'Provide \'packages\' or set \'include_all\' but not both.' ) ret = self . _RunDeviceAdbCmd ( cmd , timeout , retries ) VerifyLocalFileExists ( path ) return ret