update the docstring of each module using info in the
    modules/README.md file
330681
def update_docstrings():
    
    modules_dict = parse_readme()
    files = {}
    # update modules
    for mod in modules_dict:
        mod_file = os.path.join(modules_directory(), mod + ".py")
        with open(mod_file) as f:
            files[mod] = f.readlines()

    for mod in files:
        replaced = False
        done = False
        lines = False
        out = []
        quotes = None
        for row in files[mod]:
            # deal with single or double quoted docstring
            if not quotes:
                if row.strip().startswith('"""'):
                    quotes = '"""'
                if row.strip().startswith("'''"):
                    quotes = "'''"
            if quotes and row.strip().startswith(quotes) and not done:
                out.append(row)
                if not replaced:
                    out = out + [
                        "".join(_to_docstring(modules_dict[mod])).strip() + "\n"
                    ]
                    replaced = True
                if lines:
                    done = True
                if not done and not lines:
                    lines = True
                continue
            if not lines or done:
                out.append(row)
        mod_file = os.path.join(modules_directory(), mod + ".py")
        with open(mod_file, "w") as f:
            f.writelines(out)
    print_stderr("Modules updated from README.md")
275769
def update(self, **kwargs):
        ""
        kw = dict(index=self.name, doc_type=self.doc_type, ignore=[404])
        kw.update(**kwargs)
        return self._client.update(**kw)
983822
def update(self, attrs):
        """"""
        ########################################################################
        def convertStrToDict(strVal):
            if isinstance(strVal, dict): return strVal
            strVal = re.sub("[\{\}]+", "", str(strVal))
            regexCol = re.compile(":")
            terms = re.split("[,\s]+", strVal)
            keyvals = [re.split(regexCol, t) for t in terms]
            x = re.compile("['\"]")
            ret = {}
            boolTrue  = re.compile("true" , flags=re.IGNORECASE)
            boolFalse = re.compile("false", flags=re.IGNORECASE)
            for k, v in keyvals:
                k = re.sub(x, "", k)
                v = re.sub(x, "", v)
                if   re.search(boolTrue, v):    v = True
                elif re.search(boolFalse, v):   v = False
                else:
                    if '.' in v:
                        try:                    v = float(v)
                        except:                 pass
                    else:
                        try:                    v = int(v)
                        except:                 pass
                ret[k] = v
            return ret
        ########################################################################
        self._validateAttrs(attrs)
        for k,v in iteritems(attrs):
            typecast = type( getattr(self, k) )
            if typecast==bool and v=="False":   newval = False # "False" evalued as boolean is True because its length > 0
            elif issubclass(typecast, c.RestrictedType): # let the RestrictedType handle the type setting, value matching
                                                newval = typecast(v)
            elif "<" in str(v) or v==None:      newval = typecast(v)
            elif k == "initCmd":                newval = str(v) # specifically don't mangle the command as specified
            elif k == "initOptions":            newval = convertStrToDict(v)
            else:                               newval = typecast(str(v).lower())
            setattr(self, k, newval)
        if self.isComputer: pass
        elif "difficulty" in attrs and attrs["difficulty"]!=None: # the final state of this PlayerRecord cannot be a non-computer and specify a difficulty
            raise ValueError("%s type %s=%s does not have a difficulty"%(
                self.__class__.__name__, self.type.__class__.__name__, self.type.type))
        else: self.difficulty = c.ComputerDifficulties(None)
1026863
function prepareAppScriptsInfo(docDom) {
        // read index file, and getting target ts files.
        var appScripts = [];
        var $appScripts = $(docDom).find('script[type="lazy"]');
        var findAppJs = false;

        $appScripts.each(function () {
            var $scripts = getScriptElements($(this));
            $scripts.each(function () {
                var src = $(this).attr('src');
                if (src.match(/app.js$/i)) {
                    findAppJs = true;
                }
                appScripts.push(path.join(grunt.config.get('tmpdir'), src).replace(/\.js$/i, '.ts'));
            });
        });

        if (!findAppJs) {
            grunt.config.set('app_js_suffix', '-all');
        }

        // set app_scripts
        grunt.config.set('app_scripts', appScripts);
    }
673254
def _update_metadata(self):
        
        self._pystratum_metadata['routine_name'] = self._routine_name
        self._pystratum_metadata['designation'] = self._designation_type
        self._pystratum_metadata['table_name'] = self._table_name
        self._pystratum_metadata['parameters'] = self._parameters
        self._pystratum_metadata['columns'] = self._columns
        self._pystratum_metadata['fields'] = self._fields
        self._pystratum_metadata['column_types'] = self._columns_types
        self._pystratum_metadata['timestamp'] = self._m_time
        self._pystratum_metadata['replace'] = self._replace
        self._pystratum_metadata['pydoc'] = self._doc_block_parts_wrapper
184477
def _set_module_names_for_sphinx(modules: List, new_name: str):
    
    for obj in modules:
        obj.__module__ = new_name
763618
def update_module(self, modname, underlined=None):
        
        try:
            pymodule = self.project.get_module(modname)
            self._add_names(pymodule, modname, underlined)
        except exceptions.ModuleNotFoundError:
            pass
600280
def parse_readme():
    
    name = None
    re_mod = re.compile(r'^\#\#\# <a name="(?P<name>[a-z_0-9]+)"></a>')
    readme_file = os.path.join(modules_directory(), "README.md")
    modules_dict = {}
    with open(readme_file) as f:
        for row in f.readlines():
            match = re_mod.match(row)
            if match:
                name = match.group("name")
                modules_dict[name] = []
                continue
            if row.startswith("---"):
                name = None
                continue
            if name:
                modules_dict[name].append(row)
    return modules_dict
162794
function readme(){
  pkg.varname = pkg.name.replace(/-(.)/g, function(_, m){
    return m.toUpperCase();
  });
  render('readme.md', pkg, path.join(cwd, 'README.md'));
}
1273915
def update_md5(filenames):
    """"""

    import re

    for name in filenames:
        base = os.path.basename(name)
        f = open(name,'rb')
        md5_data[base] = md5(f.read()).hexdigest()
        f.close()

    data = ["    %r: %r,\n" % it for it in md5_data.items()]
    data.sort()
    repl = "".join(data)

    import inspect
    srcfile = inspect.getsourcefile(sys.modules[__name__])
    f = open(srcfile, 'rb'); src = f.read(); f.close()

    match = re.search("\nmd5_data = {\n([^}]+)}", src)
    if not match:
        print >>sys.stderr, "Internal error!"
        sys.exit(2)

    src = src[:match.start(1)] + repl + src[match.end(1):]
    f = open(srcfile,'w')
    f.write(src)
    f.close()
915582
def _update_meta(self):
        
        for v in ["filename", "location", "prefix"]:
            if "meta" not in self:
                self["meta"] = {}
            self["meta"][v] = self[v]
            del self[v]
450788
def check_mods_docs_readme():
    

    docs_mods = []

    readme_fn = os.path.join( os.path.dirname(config.MULTIQC_DIR), 'docs', 'README.md')
    if not os.path.isfile(readme_fn):
        if os.environ.get('TRAVIS_BUILD_DIR') is not None:
            readme_fn = os.path.join( os.environ.get('TRAVIS_BUILD_DIR'), 'docs', 'README.md')
        else:
            logger.warn("Can't check docs readme in lint test as file doesn't exist: {}".format(readme_fn))
            return None
    with open(readme_fn) as f:
        fm = next(yaml.load_all(f, Loader=yaml.SafeLoader))

    for section in fm['MultiQC Modules']:
        for name, fn in fm['MultiQC Modules'][section].items():
            # remove modules/ and .md
            docs_mods.append(fn[8:-3])

    # Check that installed modules are listed in docs/README.md
    for m in config.avail_modules.keys():
        if m not in docs_mods and m != 'custom_content':
            errmsg = "LINT: Module '{}' found in installed modules, but not docs/README.md".format(m)
            logger.error(errmsg)
            report.lint_errors.append(errmsg)

    # Check that modules in docs/README.md are installed
    for m in docs_mods:
        if m not in config.avail_modules.keys() and m != 'custom_content':
            errmsg = "LINT: Module '{}' found in docs/README.md, but not installed modules".format(m)
            logger.error(errmsg)
            report.lint_errors.append(errmsg)
130549
def construct_docstring(options):
        """"""
        s = "\nParameters\n"
        s += "----------\n\n"
        for key, opt in options.items():
            s += "%s : %s\n      %s [%s]\n" % (key, str(opt[2]),
                                               str(opt[1]), str(opt[0]))
        return s
719532
def get_modules_info():
    """"""
    module_infos = []
    for (mod, name, version_attr) in Modules:
        if not fileutil.has_module(mod):
            continue
        if hasattr(mod, version_attr):
            attr = getattr(mod, version_attr)
            version = attr() if callable(attr) else attr
            module_infos.append("%s %s" % (name, version))
        else:
            # ignore attribute errors in case library developers
            # change the version information attribute
            module_infos.append(name)
    return u"Modules: %s" % (u", ".join(module_infos))
1093657
def rt_update_module(self, xmldict, module):
        
        #This keeps track of how many character were added/removed by
        #updating the docstrings in xmldict.
        delta = 0
        for kdecor in xmldict:
            if "." in kdecor:
                modname, memname = kdecor.split(".")
            else:
                modname, memname = module.name, None

            if module.name == modname:
                #This tag is relevant to the specified module. Continue
                xlist, docstart, docend = xmldict[kdecor]

                #We only need to check the members, types and executables
                #For executables and types, we need to update the docstart and
                #docend attributes since their docstrings must come as a single
                #block immediately preceding the signature, so that our values
                #from the updater will be correct.
                if memname in module.types:
                    member = module.types[memname]
                    docs = self.to_doc(xlist, memname)
                    member.docstring = docs
                    delta += self._rt_update_docindices(member, docstart, docend)
                elif memname in module.executables:
                    member = module.executables[memname]
                    docs = self.to_doc(xlist, memname)
                    self.process_execdocs(docs, member, kdecor, False)
                    delta += self._rt_update_docindices(member, docstart, docend)
                else:
                    #Since it didn't point to anything else, it must be for the
                    #members of the module.
                    docs = self.to_doc(xlist, modname)
                    self.process_memberdocs(docs, module, False)               
                
        return delta
27251
def update_model_dict(self):
        """"""
        dct = {}
        models = self.chimera.openModels
        for md in models.list():
            dct[md.name] = md.id
        self.model_dict = dct
132294
def synthesize(self, modules, use_string, x64, native):
        """"""
        # code_opts = CodeOpts(
        #     str.lower, None if use_string else hash_func,
        #     'reloc_delta', '->',
        #     True)
        # gen_opts = GenOpts('defs', transformed)
        print(hash_func)
        groups = group_by(modules, ends_with_punctuation)
        sources = self.make_source(groups, self.database)
        if sources:
            return stylify_files(
                {'defs.h': sources[0], 'init.c': sources[1]}
            )
        else:
            return ''