human
Give me a the Python code you requested given the following:
Complete the below
def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=None, report=None):

    ''''Migrates+Updates or Installs all module nodes from ``graph``
    :param graph: graph of module nodes to load
    :param status: deprecated parameter, unused, left to avoid changing signature in 8.0
    :param perform_checks: whether module descriptors should be checked for validity (prints warnings
    for same cases)
    :param skip_modules: optional list of module names (packages) which have previously been loaded and can be skipped
    :return: list of modules that were installed or updated'
    '''
assistant
#Here is the Python code you requested.
    def load_test(module_name, idref, mode):
        cr.commit()
        try:
            _load_data(cr, module_name, idref, mode, 'test')
            return True
        except Exception:
            _test_logger.exception('module    %s:    an    exception    occurred    in    a    test', module_name)
            return False
        finally:
            if tools.config.options['test_commit']:
                cr.commit()
            else:
                cr.rollback()
                odoo.registry(cr.dbname).clear_caches()
    def _get_files_of_kind(kind):
        if (kind == 'demo'):
            kind = ['demo_xml', 'demo']
        elif (kind == 'data'):
            kind = ['init_xml', 'update_xml', 'data']
        if isinstance(kind, str):
            kind = [kind]
        files = []
        for k in kind:
            for f in package.data[k]:
                files.append(f)
                if (k.endswith('_xml') and (not ((k == 'init_xml') and (not f.endswith('.xml'))))):
                    correct_key = ('demo' if k.count('demo') else 'data')
                    _logger.warning("module    %s:    key    '%s'    is    deprecated    in    favor    of    '%s'    for    file    '%s'.", package.name, k, correct_key, f)
        return files
    def _load_data(cr, module_name, idref, mode, kind):
        '\n\n                                kind:    data,    demo,    test,    init_xml,    update_xml,    demo_xml.\n\n                                noupdate    is    False,    unless    it    is    demo    data    or    it    is    csv    data    in\n                                init    mode.\n\n                                '
        try:
            if (kind in ('demo', 'test')):
                threading.currentThread().testing = True
            for filename in _get_files_of_kind(kind):
                _logger.info('loading    %s/%s', module_name, filename)
                noupdate = False
                if ((kind in ('demo', 'demo_xml')) or (filename.endswith('.csv') and (kind in ('init',...