human
Complete the below
def DoDownloadApp(rpcserver, out_dir, app_id, module, app_version, error_fh=sys.stderr):

    ''''Downloads the files associated with a particular app version.
    Args:
    rpcserver: The RPC server to use to download.
    out_dir: The directory the files should be downloaded to.
    app_id: The app ID of the app whose files we want to download.
    module: The module we want to download from.  Can be:
    - None: We\'ll download from the default module.
    - <module>: We\'ll download from the specified module.
    app_version: The version number we want to download.  Can be:
    - None: We\'ll download the latest default version.
    - <major>: We\'ll download the latest minor version.
    - <major>/<minor>: We\'ll download that exact version.
    error_fh: Where to send status and error messages.'
    '''

What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    StatusUpdate('Fetching    file    list...', error_fh)
    url_args = {'app_id': app_id}
    if module:
        url_args['module'] = module
    if (app_version is not None):
        url_args['version_match'] = app_version
    result = rpcserver.Send('/api/files/list', **url_args)
    StatusUpdate('Fetching    files...', error_fh)
    lines = result.splitlines()
    if (len(lines) < 1):
        logging.error('Invalid    response    from    server:    empty')
        return
    full_version = lines[0]
    file_lines = lines[1:]
    current_file_number = 0
    num_files = len(file_lines)
    num_errors = 0
    for line in file_lines:
        parts = line.split('|', 2)
        if (len(parts) != 3):
            logging.error('Invalid    response    from    server:    expecting    "<id>|<size>|<path>",    found:    "%s"\n', line)
            return
        current_file_number += 1
        (file_id, size_str, path) = parts
        try:
            size = int(size_str)
        except ValueError:
            logging.error('Invalid    file    list    entry    from    server:    invalid    size:    "%s"', size_str)
            return
        StatusUpdate(('[%d/%d]    %s' % (current_file_number, num_files, path)), error_fh)
        def TryGet():
            'A    request    to    /api/files/get    which    works    with    the    RetryWithBackoff.'
            try:
                contents = rpcserver.Send('/api/files/get', app_id=app_id, version=full_version, id=file_id)
                return (True, contents)
            except urllib2.HTTPError as exc:
                if (exc.code == 503):
                    return (False, exc)
                else:
                    raise
        def PrintRetryMessage(_, delay):
            StatusUpdate(('Server    busy.        Will    try    again    in    %d    seconds.' % delay), error_fh)
        (success, contents) = RetryWithBackoff(TryGet, PrintRetryMessage)
        if (not success):
            logging.error('Unable    to    download    file    "%s".', path)
           ...