Generate header with module table entries for builtin modules.

    :param List[(module_name, obj_module, enabled_define)] modules: module defs
    :return: None
871
def generate_module_table_header(modules):
    

    # Print header file for all external modules.
    mod_defs = []
    print("// Automatically generated by makemoduledefs.py.\n")
    for module_name, obj_module, enabled_define in modules:
        mod_def = "MODULE_DEF_{}".format(module_name.upper())
        mod_defs.append(mod_def)
        print((
            "#if ({enabled_define})\n"
            "    extern const struct _mp_obj_module_t {obj_module};\n"
            "    #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\n"
            "#else\n"
            "    #define {mod_def}\n"
            "#endif\n"
            ).format(module_name=module_name, obj_module=obj_module,
                     enabled_define=enabled_define, mod_def=mod_def)
        )

    print("\n#define MICROPY_REGISTERED_MODULES \\")

    for mod_def in mod_defs:
        print("    {mod_def} \\".format(mod_def=mod_def))

    print("// MICROPY_REGISTERED_MODULES")
856880
def getPathList(self, filesOrModules):
        
        pathList = []
        for fileOrMod in filesOrModules:
            if not os.path.exists(fileOrMod):
                # May be given module is not not a path,
                # then transform it to a path.
                try:
                    filepath = file_from_modpath(fileOrMod.split('.'))
                except (ImportError, SyntaxError):
                    # Could not load this module.
                    continue
                if not os.path.exists(filepath):
                    # Could not find this module in file system.
                    continue
                if os.path.basename(filepath) == "__init__.py":
                    filepath = os.path.dirname(filepath)
            else:
                filepath = fileOrMod
            pathList.append(filepath)
        return pathList
217648
def _collect_headers(self):
        
        res = []

        for prop in self.get_sorted_columns():

            main_infos = self._get_prop_infos(prop)

            if self._is_excluded(prop, main_infos):
                continue

            if isinstance(prop, RelationshipProperty):
                main_infos = self._collect_relationship(main_infos, prop, res)

                if not main_infos:
                    # If still no success, we forgot this one
                    print("Maybe there's missing some informations \
about a relationship")
                    continue
            else:
                main_infos = self._merge_many_to_one_field_from_fkey(
                    main_infos, prop, res
                )
                if not main_infos:
                    continue

            if isinstance(main_infos, (list, tuple)):
                # In case _collect_relationship returned a list
                res.extend(main_infos)
            else:
                res.append(main_infos)
        return res
649604
def listModules(self):
        """"""
        modules = list(self.modules.items())
        modules.sort()
        return [module for name, module in modules]
1227980
def loaded_modules(self):
        ''''''
        with self._mutex:
            if not self._loaded_modules:
                self._loaded_modules = []
                for mp in self._obj.get_loaded_modules():
                    self._loaded_modules.append(utils.nvlist_to_dict(mp.properties))
        return self._loaded_modules
743597
def create_index(modules):
    ''''''
    for key in modules.keys():
        file_path = join(HERE, '%s_modules/_list_of_modules.rst' % key)
        list_file = open(file_path, 'w')

        # Write the generic header
        list_file.write('%s\n' % AUTOGEN)
        list_file.write('%s\n' % key.title())
        list_file.write('=' * len(key))
        list_file.write('\n\n')
        list_file.write('.. toctree::\n')
        list_file.write('   :maxdepth: 2\n\n')

        for module in modules[key]:
            list_file.write('   %s\n' % module)
814995
protected void addModulesList(Collection<ModuleElement> modules, String text, String tableSummary, Content body) {
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
                : HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
        table.addContent(getSummaryTableHeader(moduleTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        addModulesList(modules, tbody);
        table.addContent(tbody);
        Content anchor = getMarkerAnchor(text);
        Content div = HtmlTree.DIV(HtmlStyle.contentContainer, anchor);
        div.addContent(table);
        if (configuration.allowTag(HtmlTag.MAIN)) {
            htmlTree.addContent(div);
        } else {
            body.addContent(div);
        }
    }
563543
def create_modules_toc_file(master_package, modules, opts, name='modules'):
    
    text = format_heading(1, '%s Modules' % opts.header)
    text += '.. toctree::\n'
    text += '   :maxdepth: %s\n\n' % opts.maxdepth

    modules.sort()
    prev_module = ''
    for module in modules:
        # look if the module is a subpackage and, if yes, ignore it
        if module.startswith(prev_module + '.'):
            continue
        prev_module = module
        text += '   %s\n' % module

    write_file(name, text, opts)
1331246
def _write_docs(module_list, output_dir):
    ''''''
    for module_meta in module_list:
        directory = module_meta['directory']
        # Ensure target directory
        if directory and not path.isdir(directory):
            makedirs(directory)

        # Write the file
        file = open(module_meta['output'], 'w')
        file.write(module_meta['content'])
        file.close()
1096442
def libvlc_module_description_list_release(p_list):
    '''
    '''
    f = _Cfunctions.get('libvlc_module_description_list_release', None) or \
        _Cfunction('libvlc_module_description_list_release', ((1,),), None,
                    None, ctypes.POINTER(ModuleDescription))
    return f(p_list)
548796
def get_modules(modulename=None):
    
    modulename = compat.ensure_not_unicode(modulename)
    if not modulename:
        try:
            return ([modname for (importer, modname, ispkg)
                     in iter_modules()
                     if not modname.startswith("_")] +
                    list(sys.builtin_module_names))
        except OSError:
            # Bug in Python 2.6, see #275
            return list(sys.builtin_module_names)
    try:
        module = safeimport(modulename)
    except ErrorDuringImport:
        return []
    if module is None:
        return []
    if hasattr(module, "__path__"):
        return [modname for (importer, modname, ispkg)
                in iter_modules(module.__path__)
                if not modname.startswith("_")]
    return []
253117
def bundles_list(self, io_handler, name=None):
        
        # Head of the table
        headers = ("ID", "Name", "State", "Version")

        # Get the bundles
        bundles = self._context.get_bundles()

        # The framework is not in the result of get_bundles()
        bundles.insert(0, self._context.get_framework())

        if name is not None:
            # Filter the list
            bundles = [
                bundle
                for bundle in bundles
                if name in bundle.get_symbolic_name()
            ]

        # Make the entries
        lines = [
            [
                str(entry)
                for entry in (
                    bundle.get_bundle_id(),
                    bundle.get_symbolic_name(),
                    self._utils.bundlestate_to_str(bundle.get_state()),
                    bundle.get_version(),
                )
            ]
            for bundle in bundles
        ]

        # Print'em all
        io_handler.write(self._utils.make_table(headers, lines))

        if name is None:
            io_handler.write_line("{0} bundles installed", len(lines))
        else:
            io_handler.write_line("{0} filtered bundles", len(lines))
249312
def source_headers(self):
        """""""

        t = self.schema_term

        if t:
            return [self._name_for_col_term(c, i)
                    for i, c in enumerate(t.children, 1) if c.term_is("Table.Column")
                    and c.get_value('name') != EMPTY_SOURCE_HEADER
                    ]
        else:
            return None
405898
def _build_exclusion_list(exclude):
    """"""
    mod_files = []
    if exclude:
        for mod in exclude:
            mdir = None
            mod_file = None
            for token in mod.split("."):
                try:
                    mfile, mdir, _ = imp.find_module(token, mdir and [mdir])
                    if mfile:
                        mod_file = mfile.name
                        mfile.close()
                except ImportError:
                    msg = "Source for module {mod_name} could not be found"
                    raise ValueError(msg.format(mod_name=mod))
            if mod_file:
                mod_files.append(mod_file.replace(".pyc", ".py"))
    return mod_files
781191
function buildESModuleHeader(
  metadata: ModuleMetadata,
  enumerable: boolean = false,
) {
  return (enumerable
    ? template.statement`
        EXPORTS.__esModule = true;
      `
    : template.statement`
        Object.defineProperty(EXPORTS, "__esModule", {
          value: true,
        });
      `)({ EXPORTS: metadata.exportName });
}
728341
def _prepare_header_cells(self, table_header):
        

        cells = self.parser.find(table_header).find_children(
            'tr'
        ).find_children('th').list_results()
        for cell in cells:
            self.id_generator.generate_id(cell)

            cell.set_attribute('scope', 'col')
629972
def result_tree_list(cl):
    
    import django
    result = {
        'cl': cl,
        'result_headers': list(result_headers(cl)),
        'results': list(tree_results(cl))
    }
    if django.VERSION[0] == 1 and django.VERSION[1] > 2:
        from django.contrib.admin.templatetags.admin_list import result_hidden_fields
        result['result_hidden_fields'] = list(result_hidden_fields(cl))
    return result