def scan_results_command(client: Client, args: Dict[(str, Any)]) -> Union[(Dict[(str, Any)], CommandResults, List[CommandResults])]:
    "helloworld-scan-results command: Returns results for a HelloWorld scan\n\n    :type client: ``Client``\n    :param Client: HelloWorld client to use\n\n    :type args: ``Dict[str, Any]``\n    :param args:\n        all command arguments, usually passed from ``demisto.args()``.\n        ``args['scan_id']`` scan ID to retrieve results\n        ``args['format']`` format of the results. Options are 'file' or 'json'\n\n    :return:\n        A ``CommandResults`` compatible to return ``return_results()``,\n        that contains a scan result when json format is selected, or\n        A Dict of entries also compatible to ``return_results()`` that\n        contains the output file when file format is selected.\n\n    :rtype: ``Union[Dict[str, Any],CommandResults]``\n    "
    scan_id = args.get('scan_id', None)
    if (not scan_id):
        raise ValueError('scan_id not specified')
    scan_format = args.get('format', 'file')
    results = client.scan_results(scan_id=scan_id)
    if (scan_format == 'file'):
        return fileResult(filename=f'{scan_id}.json', data=json.dumps(results, indent=4), file_type=entryTypes['entryInfoFile'])
    elif (scan_format == 'json'):
        cves: List[Common.CVE] = []
        command_results: List[CommandResults] = []
        entities = results.get('entities', [])
        for e in entities:
            if (('vulns' in e.keys()) and isinstance(e['vulns'], list)):
                cves.extend([Common.CVE(id=c, cvss=None, published=None, modified=None, description=None) for c in e['vulns']])
        readable_output = tableToMarkdown(f'Scan {scan_id} results', entities)
        command_results.append(CommandResults(readable_output=readable_output, outputs_prefix='HelloWorld.Scan', outputs_key_field='scan_id', outputs=results))
        cves = list(set(cves))
        for cve in cves:
            command_results.append(CommandResults(readable_output=f'CVE {cve}', indicator=cve))
        return command_results
    else:
        raise ValueError('Incorrect format, must be "json" or "file"')
helloworld-scan-results command: Returns results for a HelloWorld scan

:type client: ``Client``
:param Client: HelloWorld client to use

:type args: ``Dict[str, Any]``
:param args:
    all command arguments, usually passed from ``demisto.args()``.
    ``args['scan_id']`` scan ID to retrieve results
    ``args['format']`` format of the results. Options are 'file' or 'json'

:return:
    A ``CommandResults`` compatible to return ``return_results()``,
    that contains a scan result when json format is selected, or
    A Dict of entries also compatible to ``return_results()`` that
    contains the output file when file format is selected.

:rtype: ``Union[Dict[str, Any],CommandResults]``
def scan_results_command(client: Client, args: Dict[(str, Any)]) -> Union[(Dict[(str, Any)], CommandResults, List[CommandResults])]:
    "helloworld-scan-results command: Returns results for a HelloWorld scan\n\n    :type client: ``Client``\n    :param Client: HelloWorld client to use\n\n    :type args: ``Dict[str, Any]``\n    :param args:\n        all command arguments, usually passed from ``demisto.args()``.\n        ``args['scan_id']`` scan ID to retrieve results\n        ``args['format']`` format of the results. Options are 'file' or 'json'\n\n    :return:\n        A ``CommandResults`` compatible to return ``return_results()``,\n        that contains a scan result when json format is selected, or\n        A Dict of entries also compatible to ``return_results()`` that\n        contains the output file when file format is selected.\n\n    :rtype: ``Union[Dict[str, Any],CommandResults]``\n    "
    scan_id = args.get('scan_id', None)
    if (not scan_id):
        raise ValueError('scan_id not specified')
    scan_format = args.get('format', 'file')
    results = client.scan_results(scan_id=scan_id)
    if (scan_format == 'file'):
        return fileResult(filename=f'{scan_id}.json', data=json.dumps(results, indent=4), file_type=entryTypes['entryInfoFile'])
    elif (scan_format == 'json'):
        cves: List[Common.CVE] = []
        command_results: List[CommandResults] = []
        entities = results.get('entities', [])
        for e in entities:
            if (('vulns' in e.keys()) and isinstance(e['vulns'], list)):
                cves.extend([Common.CVE(id=c, cvss=None, published=None, modified=None, description=None) for c in e['vulns']])
        readable_output = tableToMarkdown(f'Scan {scan_id} results', entities)
        command_results.append(CommandResults(readable_output=readable_output, outputs_prefix='HelloWorld.Scan', outputs_key_field='scan_id', outputs=results))
        cves = list(set(cves))
        for cve in cves:
            command_results.append(CommandResults(readable_output=f'CVE {cve}', indicator=cve))
        return command_results
    else:
        raise ValueError('Incorrect format, must be "json" or "file"')