import io
import json


def load_scan(json_input):
    """
    Return a list of scan results loaded from a json_input, either in
    ScanCode standard JSON format or the data.js html-app format.
    """
    with io.open(json_input, encoding='utf-8') as jsonf:
        scan = jsonf.read()

    scan_results = json.loads(scan)
    scan_results = scan_results['files']
    return scan_results