def _get_files(element_meta):
    'Extracts the files associated with the given element.\n    Returns a 2-tuple containing:\n     - the set of arch-independent files;\n     - the sets of arch-dependent files, indexed by architecture.\n    '
    type = _get_type(element_meta)
    common_files = set()
    arch_files = {}
    if (type == 'cc_prebuilt_library'):
        common_files.update(element_meta['headers'])
        for (arch, binaries) in element_meta['binaries'].items():
            contents = set()
            contents.add(binaries['link'])
            if ('dist' in binaries):
                contents.add(binaries['dist'])
            if ('debug' in binaries):
                contents.add(binaries['debug'])
            arch_files[arch] = contents
    elif (type == 'cc_source_library'):
        common_files.update(element_meta['headers'])
        common_files.update(element_meta['sources'])
    elif (type == 'dart_library'):
        common_files.update(element_meta['sources'])
    elif (type == 'fidl_library'):
        common_files.update(element_meta['sources'])
    elif (type in ['host_tool', 'companion_host_tool']):
        if ('files' in element_meta):
            common_files.update(element_meta['files'])
        if ('target_files' in element_meta):
            arch_files.update(element_meta['target_files'])
    elif (type == 'loadable_module'):
        common_files.update(element_meta['resources'])
        arch_files.update(element_meta['binaries'])
    elif (type == 'sysroot'):
        for (arch, version) in element_meta['versions'].items():
            contents = set()
            contents.update(version['headers'])
            contents.update(version['link_libs'])
            contents.update(version['dist_libs'])
            contents.update(version['debug_libs'])
            arch_files[arch] = contents
    elif (type == 'documentation'):
        common_files.update(element_meta['docs'])
    elif (type in ('config', 'license', 'component_manifest')):
        common_files.update(element_meta['data'])
    elif (type in 'version_history'):
        pass
    elif (type == 'bind_library'):
        common_files.update(element_meta['sources'])
    else:
        raise Exception(('Unknown element type: ' + type))
    return (common_files, arch_files)
Extracts the files associated with the given element.
Returns a 2-tuple containing:
 - the set of arch-independent files;
 - the sets of arch-dependent files, indexed by architecture.
def _get_files(element_meta):
    'Extracts the files associated with the given element.\n    Returns a 2-tuple containing:\n     - the set of arch-independent files;\n     - the sets of arch-dependent files, indexed by architecture.\n    '
    type = _get_type(element_meta)
    common_files = set()
    arch_files = {}
    if (type == 'cc_prebuilt_library'):
        common_files.update(element_meta['headers'])
        for (arch, binaries) in element_meta['binaries'].items():
            contents = set()
            contents.add(binaries['link'])
            if ('dist' in binaries):
                contents.add(binaries['dist'])
            if ('debug' in binaries):
                contents.add(binaries['debug'])
            arch_files[arch] = contents
    elif (type == 'cc_source_library'):
        common_files.update(element_meta['headers'])
        common_files.update(element_meta['sources'])
    elif (type == 'dart_library'):
        common_files.update(element_meta['sources'])
    elif (type == 'fidl_library'):
        common_files.update(element_meta['sources'])
    elif (type in ['host_tool', 'companion_host_tool']):
        if ('files' in element_meta):
            common_files.update(element_meta['files'])
        if ('target_files' in element_meta):
            arch_files.update(element_meta['target_files'])
    elif (type == 'loadable_module'):
        common_files.update(element_meta['resources'])
        arch_files.update(element_meta['binaries'])
    elif (type == 'sysroot'):
        for (arch, version) in element_meta['versions'].items():
            contents = set()
            contents.update(version['headers'])
            contents.update(version['link_libs'])
            contents.update(version['dist_libs'])
            contents.update(version['debug_libs'])
            arch_files[arch] = contents
    elif (type == 'documentation'):
        common_files.update(element_meta['docs'])
    elif (type in ('config', 'license', 'component_manifest')):
        common_files.update(element_meta['data'])
    elif (type in 'version_history'):
        pass
    elif (type == 'bind_library'):
        common_files.update(element_meta['sources'])
    else:
        raise Exception(('Unknown element type: ' + type))
    return (common_files, arch_files)