Process the ``pending_task_xref`` nodes during the ``doctree-resolved``
    event to insert links to the locations of ``lsst-task-topic`` directives.
436437
def process_pending_task_xref_nodes(app, doctree, fromdocname):
    
    logger = getLogger(__name__)
    env = app.builder.env

    for node in doctree.traverse(pending_task_xref):
        content = []

        # The source of the node is the class name the user entered via the
        # lsst-task-topic role. For example:
        # lsst.pipe.tasks.processCcd.ProcessCcdTask
        role_parts = split_role_content(node.rawsource)
        task_id = format_task_id(role_parts['ref'])
        if role_parts['display']:
            # user's custom display text
            display_text = role_parts['display']
        elif role_parts['last_component']:
            # just the name of the class
            display_text = role_parts['ref'].split('.')[-1]
        else:
            display_text = role_parts['ref']
        link_label = nodes.literal()
        link_label += nodes.Text(display_text, display_text)

        if hasattr(env, 'lsst_task_topics') and \
                task_id in env.lsst_task_topics:
            # A task topic, marked up with the lsst-task-topic directive is
            # available
            task_data = env.lsst_task_topics[task_id]

            ref_node = nodes.reference('', '')
            ref_node['refdocname'] = task_data['docname']
            ref_node['refuri'] = app.builder.get_relative_uri(
                fromdocname, task_data['docname'])
            ref_node['refuri'] += '#' + task_data['target']['refid']

            ref_node += link_label

            content.append(ref_node)

        else:
            # Fallback if the task topic isn't known. Just print the label text
            content.append(link_label)

            message = 'lsst-task could not find a reference to %s'
            logger.warning(message, role_parts['ref'], location=node)

        # replacing the pending_task_xref node with this reference
        node.replace_self(content)
289595
def attach(self, attached_file, **attrs):
        
        return TaskAttachments(self.requester).create(
            self.project, self.id,
            attached_file, **attrs
        )
502030
private void processResourceAssignments(Task task, List<MapRow> assignments)
   {
      for (MapRow row : assignments)
      {
         processResourceAssignment(task, row);
      }
   }
455160
void processServerContentRequest() {

        File installRoot = new File(locationService.resolveString("${wlp.install.dir}"));

        final Set<String> absPathsForLibertyContent = new HashSet<String>();
        final Map<String, List<String>> specificPlatformPathsByPlatform = new HashMap<String, List<String>>();
        Set<String> discoveredFeatures = new HashSet<String>();
        Collection<FeatureResource> fixes = new ArrayList<FeatureResource>();

        // We need ALL Kernel features (even the ones that aren't active in the system)
        // as well as all installed features.
        List<ProvisioningFeatureDefinition> allFeatureDefs = new ArrayList<ProvisioningFeatureDefinition>();
        allFeatureDefs.addAll(KernelFeatureDefinitionImpl.getAllKernelFeatures(bundleContext, locationService));
        allFeatureDefs.addAll(featureResolver.getInstalledFeatureDefinitions());

        //keep a list of product extensions being used in the server
        List<String> extensionRepos = new ArrayList<String>();

        for (ProvisioningFeatureDefinition fd : allFeatureDefs) {

            BundleRepositoryHolder brh = BundleRepositoryRegistry.getRepositoryHolder(fd.getBundleRepositoryType());
            ContentBasedLocalBundleRepository br = brh.getBundleRepository();
            Collection<FeatureResource> frs = fd.getConstituents(null);

            /*
             * lib/fixes processing needs to happen here, to filter the xml down to just the current in use set.
             * made slightly more complex, because the locations tracked for minify are absolute, so we have to identify and trim installroot
             * to identify lib/fixes/* content, which we process afterward
             */
            File libFixes = new File(installRoot, "lib/fixes");

            for (FeatureResource fr : frs) {
                switch (fr.getType()) {
                    case FEATURE_TYPE: {
                        //type = feature, no paths to worry about, we are processing the list of all installed features
                        //                which will include nested features.
                        discoveredFeatures.add(fr.getSymbolicName());
                        break;
                    }

                    case BUNDLE_TYPE:
                    case JAR_TYPE:
                    case BOOT_JAR_TYPE: {
                        //type = bundle, need to query the bundle repository for this feature def, to find which
                        //               files are being used.
                        //type = jar, basically same as type=bundle.. for minify purposes.
                        //type = boot.jar, basically same as type=bundle.. for minify purposes.
                        File b = br.selectBundle(fr.getLocation(), fr.getSymbolicName(), fr.getVersionRange());
                        File bb = br.selectBaseBundle(fr.getLocation(), fr.getSymbolicName(), fr.getVersionRange());
                        //b & bb will be the same bundle if the base was the selected.. 
                        if (b != null && bb != null) {
                            boolean pathsSame = b.getAbsolutePath().equals(bb.getAbsolutePath());
                            absPathsForLibertyContent.add(b.getAbsolutePath());
                            if (!pathsSame) {
                                absPathsForLibertyContent.add(bb.getAbsolutePath());
                            }
                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                for (String os : osList) {
                                    List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                    if (pathsForOs == null) {
                                        pathsForOs = new ArrayList<String>();
                                        specificPlatformPathsByPlatform.put(os, pathsForOs);
                                    }
                                    pathsForOs.add(b.getAbsolutePath());
                                    if (!pathsSame) {
                                        pathsForOs.add(bb.getAbsolutePath());
                                    }
                                }
                            }
                        } else {
                            //b & bb were null, we have no match for this resource.. 
                            //maybe the resource was minfiied out?
                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                //ignore the missing resource, as the file is tagged for specific os's,
                                //and will be reported missing based on the os filters later.
                                //(if the user has no os filter set, they meant 'all currently supported by the install')
                                //(so this can still be ignored).
                            } else {
                                //use match string for error message, it provides best chance for being helpful.
                                Tr.warning(tc, "ERROR_MISSING_FEATURE_RESOURCE", new Object[] { fd.getFeatureName(), fr.getMatchString() });
                            }
                        }
                        break;
                    }

                    case FILE_TYPE: {
                        //file uses loc as a relative path from install root.
                        String locString = fr.getLocation();
                        if (locString != null) {
                            String[] locs;
                            if (locString.contains(",")) {
                                locs = locString.split(",");
                            } else {
                                locs = new String[] { locString };
                            }

                            for (String loc : locs) {
                                File test = new File(loc);
                                if (!test.isAbsolute()) {
                                    test = new File(brh.getInstallDir(), loc);
                                }
                                loc = test.getAbsolutePath();
                                //filter fixes content into the fixes set, all other content is remembered.
                                if (loc.startsWith(libFixes.getAbsolutePath() + File.separator)) {
                                    fixes.add(fr);
                                } else {
                                    absPathsForLibertyContent.add(loc);
                                }

                                List<String> osList = fr.getOsList();
                                if (osList != null) {
                                    for (String os : osList) {
                                        List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                        if (pathsForOs == null) {
                                            pathsForOs = new ArrayList<String>();
                                            specificPlatformPathsByPlatform.put(os, pathsForOs);
                                        }
                                        pathsForOs.add(loc);
                                    }
                                }
                            }
                        } else {
                            //a file type without a loc is bad, means misuse of the type.
                            Tr.warning(tc, "ERROR_UNKNOWN_FEATURE_RESOURCE_TYPE", new Object[] { fd.getFeatureName(), fr.getSymbolicName(), "file" });
                        }
                        break;
                    }

                    case UNKNOWN: {
                        //if its not jar,bundle,feature, or file.. then something is wrong.
                        Tr.warning(tc, "ERROR_UNKNOWN_FEATURE_RESOURCE_TYPE", new Object[] { fd.getFeatureName(),
                                                                                            fr.getSymbolicName(),
                                                                                            fr.getRawType() });
                        //we assume that other types will use the location field as something useful.
                        String loc = fr.getLocation();
                        if (loc != null) {
                            File test = new File(loc);
                            if (!test.isAbsolute()) {
                                test = new File(installRoot, loc);
                            }
                            absPathsForLibertyContent.add(test.getAbsolutePath());

                            List<String> osList = fr.getOsList();
                            if (osList != null) {
                                for (String os : osList) {
                                    List<String> pathsForOs = specificPlatformPathsByPlatform.get(os);
                                    if (pathsForOs == null) {
                                        pathsForOs = new ArrayList<String>();
                                        specificPlatformPathsByPlatform.put(os, pathsForOs);
                                    }
                                    pathsForOs.add(test.getAbsolutePath());
                                }
                            }
                        }
                        break;
                    }
                    default:
                        break;
                }
            }
            //add in (all) the NLS files for this featuredef.. if any..
            for (File nls : fd.getLocalizationFiles()) {
                if (nls.exists()) {
                    absPathsForLibertyContent.add(nls.getAbsolutePath());
                }
            }

            //add in the manifest for the feature itself .. 
            File featureFile = fd.getFeatureDefinitionFile();
            if (featureFile != null) {
                absPathsForLibertyContent.add(featureFile.getAbsolutePath());
            }
            File checksumFile = fd.getFeatureChecksumFile();
            if (checksumFile != null) {
                absPathsForLibertyContent.add(checksumFile.getAbsolutePath());
            }

            String repoType = fd.getBundleRepositoryType();
            //work out if this content is a product extension and if it is include its properties file
            if (repoType != null && !ExtensionConstants.CORE_EXTENSION.equals(repoType)
                && !ExtensionConstants.USER_EXTENSION.equals(repoType)) {
                //not core or user, must be a product extension
                extensionRepos.add(repoType);
            }

            // Add in any Icon files
            File featureDefinitionFile = fd.getFeatureDefinitionFile();
            if (featureDefinitionFile != null) {
                File featureDefinitionParent = featureDefinitionFile.getParentFile();
                Collection<String> expectedIcons = fd.getIcons();
                if (featureDefinitionParent != null && expectedIcons != null) {
                    File iconsFolder = new File(featureDefinitionParent, "icons/" + fd.getSymbolicName());
                    scanFolderForIcons(absPathsForLibertyContent, iconsFolder.getAbsolutePath(), iconsFolder, expectedIcons);
                }
            }

        }

        //if there are any extensions in use we need to bring their wlp/etc/extensions/*.properties file along
        for (String extensionRepo : extensionRepos) {
            WsResource extensionProperties = locationService.getRuntimeResource("etc/extensions/" + extensionRepo + ".properties");
            absPathsForLibertyContent.add(locationService.resolveResource(extensionProperties.toRepositoryPath()).asFile().getAbsolutePath());
        }

        //this odd looking bit of code will take the current list of files identified,
        //and if any are jars, will look in them to see if they have manifest classpaths
        //if so, the jars referenced by the manifest classpaths are added to the manifestJars
        //argument.
        //We have to start by passing both args as the current set of content (but using different set instances).
        Set<String> manifestJars = new HashSet<String>();
        manifestJars.addAll(absPathsForLibertyContent);
        gatherManifestClasspathJars(absPathsForLibertyContent, manifestJars);
        manifestJars.removeAll(absPathsForLibertyContent);

        //now manifestJars contains any jars that we didn't already know about, discovered via manifests.
        absPathsForLibertyContent.addAll(manifestJars);

        //process the fixes set of fix xml's, and add the required ones to the set of files to keep.
        addRequiredFixFiles(installRoot, absPathsForLibertyContent, fixes);

        final String OS_REMOVE_CHAR = "-";

        //publish the service that will be used by the launcher to read back the data.
        final Dictionary<String, Object> d = new Hashtable<String, Object>();
        final String[] pathArray = absPathsForLibertyContent.toArray(new String[] {});

        bundleContext.registerService(ServerContent.class, new ServerContent() {
            @Override
            public String[] getServerContentPaths(String osRequest) throws IOException {
                if (osRequest == null || osRequest.isEmpty() || "all".equals(osRequest))
                    return pathArray;
                else {
                    //filter paths as required.. then return them..                                       
                    String[] osNames = osRequest.split(",");
                    boolean add = true;

                    //check if this is an add, or a remove.
                    //if both are specified, remove wins ;p
                    for (String osName : osNames) {
                        if (osName.startsWith(OS_REMOVE_CHAR)) {
                            add = false;
                        }
                    }

                    if (add) {
                        //someone has named an os (or os's) they want
                        //so we remove everything, and add back just those os's.
                        for (Map.Entry<String, List<String>> me : specificPlatformPathsByPlatform.entrySet()) {
                            absPathsForLibertyContent.removeAll(me.getValue());
                        }
                        for (String osName : osNames) {
                            if (!osName.startsWith(OS_REMOVE_CHAR)) {
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    absPathsForLibertyContent.addAll(osPaths);

                                    //verify the requested paths File.exists .. otherwise 
                                    //this could be an error ?
                                    for (String osPath : osPaths) {
                                        if (!FileUtils.fileExists(new File(osPath))) {
                                            throw new FileNotFoundException(osPath);
                                        }
                                    }
                                }
                            }
                        }
                    } else {
                        //user request 'all except this platform' type filter..
                        for (String osName : osNames) {
                            if (osName.startsWith(OS_REMOVE_CHAR)) {
                                osName = osName.substring(1);
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    absPathsForLibertyContent.removeAll(osPaths);
                                    //in this kind of filter, we don't need to test at all.
                                }
                            } else {
                                List<String> osPaths = specificPlatformPathsByPlatform.get(osName);
                                if (osPaths != null && !osPaths.isEmpty()) {
                                    //verify the requested paths File.exists .. otherwise 
                                    //this could be an error.
                                    for (String osPath : osPaths) {
                                        if (!FileUtils.fileExists(new File(osPath))) {
                                            throw new FileNotFoundException(osPath);
                                        }
                                    }
                                }
                            }
                        }
                    }

                    //return newly filtered data
                    return absPathsForLibertyContent.toArray(new String[] {});
                }
            }
        }, d);

        //we're done here.. let liberty proceed to declare itself 'started' =)
    }
379158
protected function process()
    {

        // initialize the array for the links
        $artefacts = array();

        // load the link type mappings
        $linkTypes = $this->getLinkTypeMappings();

        // prepare the links for the found link types and merge the found artefacts
        foreach ($linkTypes as $linkTypeCode => $columns) {
            $artefacts = array_merge($artefacts, $this->prepareArtefacts($linkTypeCode, $columns));
        }

        // append the links to the subject
        $this->addArtefacts($artefacts);
    }
284866
function recordInsertBefore(node, container, ref_node) {
    var this$1 = this;

    container.__dom.childNodes = null;
    // handle document fragments
    if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
      var c$ = tree.arrayCopyChildNodes(node);
      for (var i=0; i < c$.length; i++) {
        this$1._linkNode(c$[i], container, ref_node);
      }
      // cleanup logical dom in doc fragment.
      node.__dom = node.__dom || {};
      node.__dom.firstChild = node.__dom.lastChild = null;
      node.__dom.childNodes = null;
    } else {
      this._linkNode(node, container, ref_node);
    }
  }
1187373
def apply(self):
        """"""
        # In this phase, we look for hyperlinks (references nodes)
        # that contain substitutions (of the form "|foo|").
        # We then add actual "substitution"s nodes to those references,
        # so that they can be replaced by the substitution processor.
        subst_re = re.compile(self.subst_pattern)

        for link in self.document.traverse(self._maybe_hyperlink):
            if 'refuri' not in link:
                continue

            # Note: "target" nodes do not have a "name" attribute.
            if '|' not in link['refuri'] and '|' not in link.get('name', ''):
                continue

            # This list acts as a cache so that only one substitution node
            # is added as a child for each substitution name.
            substitutions = []

            matches = subst_re.findall(link['refuri']) + \
                subst_re.findall(link.get('name', ''))
            for subref_text in matches:
                if subref_text in substitutions:
                    continue

                substitutions.append(subref_text)
                subref_node = nodes.substitution_reference(subref_text)
                link.append(subref_node)
                self.document.note_substitution_ref(subref_node, subref_text)

            # Build a map of substitutions names to child indices
            # (minus one since the actual link label is in link[0]).
            link['varlinks'] = \
                dict(zip(substitutions, range(len(substitutions))))
1187260
def resolve_xref(self, env, fromdocname, builder,
                     type_name, target, node, contnode):
        
        # Special case the :chpl:chplref:`chplmodindex` instances.
        if type_name == 'chplref':
            if node['refexplicit']:
                # Reference to anonymous label. The reference uses the supplied
                # link caption.
                docname, labelid = self.data['anonlabels'].get(
                    target, ('', ''))
                sectname = node.astext()
            else:
                # Reference to named label. The final node will contain the
                # section name after the label.
                docname, labelid, sectname = self.data['labels'].get(
                    target, ('', '', ''))

            if not docname:
                return None

            return self._make_refnode(
                fromdocname, builder, docname, labelid, sectname, contnode)

        modname = node.get('chpl:module')
        clsname = node.get('chpl:class')
        searchmode = 1 if node.hasattr('refspecific') else 0
        matches = self.find_obj(env, modname, clsname, target,
                                type_name, searchmode)

        if not matches:
            return None
        elif len(matches) > 1:
            env.warn_node(
                'more than one target found for cross-reference '
                '%r: %s' % (target, ', '.join(match[0] for match in matches)),
                node)
        name, obj = matches[0]

        if obj[1] == 'module':
            return self._make_module_refnode(
                builder, fromdocname, name, contnode)
        else:
            return make_refnode(builder, fromdocname, obj[0], name,
                                contnode, name)
504845
private void attachGroovydocAnnotation(ASTNode node, String docCommentNodeText) {
        if (!runtimeGroovydocEnabled) {
            return;
        }

        if (!(node instanceof AnnotatedNode)) {
            return;
        }

        if (!docCommentNodeText.startsWith(RUNTIME_GROOVYDOC_PREFIX)) {
            return;
        }

        AnnotatedNode annotatedNode = (AnnotatedNode) node;
        AnnotationNode annotationNode = new AnnotationNode(ClassHelper.make(Groovydoc.class));
        annotationNode.addMember(VALUE, new ConstantExpression(docCommentNodeText));
        annotatedNode.addAnnotation(annotationNode);
    }
873105
function _onSetChildNodes(event, res) {
        // res = {parentId, nodes}
        var node = nodeWithId(res.parentId);
        node.setChildrenPayload(res.nodes);
        if (_pendingRequests > 0 && --_pendingRequests === 0) {
            _onFinishedLoadingDOM();
        }
    }
110618
def process_refs_for_node(cls, manifest, current_project, node):
        """"""
        target_model = None
        target_model_name = None
        target_model_package = None

        for ref in node.refs:
            if len(ref) == 1:
                target_model_name = ref[0]
            elif len(ref) == 2:
                target_model_package, target_model_name = ref

            target_model = cls.resolve_ref(
                manifest,
                target_model_name,
                target_model_package,
                current_project,
                node.get('package_name'))

            if target_model is None or target_model is cls.DISABLED:
                # This may raise. Even if it doesn't, we don't want to add
                # this node to the graph b/c there is no destination node
                node.config['enabled'] = False
                dbt.utils.invalid_ref_fail_unless_test(
                    node, target_model_name, target_model_package,
                    disabled=(target_model is cls.DISABLED)
                )

                continue

            target_model_id = target_model.get('unique_id')

            node.depends_on['nodes'].append(target_model_id)
            manifest.nodes[node['unique_id']] = node
1241282
private void doNodeJoined(final Node node) {
    tasks.runTask(new Handler<Task>() {
      @Override
      public void handle(final Task task) {
        if (currentContext != null) {
          log.info(String.format("%s - %s joined the cluster. Uploading components to new node", NetworkManager.this, node.address()));
          installModules(node, currentContext, new Handler<AsyncResult<Void>>() {
            @Override
            public void handle(AsyncResult<Void> result) {
              if (result.failed()) {
                log.error(result.cause());
              } else {
                log.info(String.format("%s - Successfully uploaded components to %s", NetworkManager.this, node.address()));
              }
              task.complete();
            }
          });
        } else {
          task.complete();
        }
      }
    });
  }
938797
def do_links(doc1, doc2, from_page = -1, to_page = -1, start_at = -1):
    ''''''
    #--------------------------------------------------------------------------
    # define skeletons for /Annots object texts
    #--------------------------------------------------------------------------
    annot_goto ='''<</Dest[%i 0 R /XYZ %g %g 0]/Rect[%s]/Subtype/Link>>'''

    annot_gotor = '''<</A<</D[%i /XYZ %g %g 0]/F<</F(%s)/UF(%s)/Type/Filespec
    >>/S/GoToR>>/Rect[%s]/Subtype/Link>>'''

    annot_gotor_n = "<</A<</D(%s)/F(%s)/S/GoToR>>/Rect[%s]/Subtype/Link>>"

    annot_launch = '''<</A<</F<</F(%s)/UF(%s)/Type/Filespec>>/S/Launch
    >>/Rect[%s]/Subtype/Link>>'''

    annot_uri = '''<</A<</S/URI/URI(%s)/Type/Action>>/Rect[%s]/Subtype/Link>>'''

    #--------------------------------------------------------------------------
    # internal function to create the actual "/Annots" object string
    #--------------------------------------------------------------------------
    def cre_annot(lnk, xref_dst, list_src, height):
        '''Create annotation object string for a passed-in link.'''

        # "from" rectangle is always there. Note: y-coords are from bottom!

        r = lnk["from"]
        rect = "%g %g %g %g" % (r.x0, height - r.y0, r.x1, height - r.y1)
        if lnk["kind"] == LINK_GOTO:
            txt = annot_goto
            idx = list_src.index(lnk["page"])
            annot = txt % (xref_dst[idx], lnk["to"].x,
                           lnk["to"].y, rect)
        elif lnk["kind"] == LINK_GOTOR:
            if lnk["page"] >= 0:
                txt = annot_gotor
                pnt = lnk.get("to", Point(0, 0))          # destination point
                if type(pnt) is not Point:
                    pnt = Point(0, 0)
                annot = txt % (lnk["page"], pnt.x, pnt.y,
                           lnk["file"], lnk["file"], rect)
            else:
                txt = annot_gotor_n
                to = getPDFstr(lnk["to"])
                to = to[1:-1]
                f = lnk["file"]
                annot = txt % (to, f, rect)

        elif lnk["kind"] == LINK_LAUNCH:
            txt = annot_launch
            annot = txt % (lnk["file"], lnk["file"], rect)
        elif lnk["kind"] == LINK_URI:
            txt = annot_uri
            annot = txt % (lnk["uri"], rect)
        else:
            annot = ""

        return annot
    #--------------------------------------------------------------------------

    # validate & normalize parameters
    if from_page < 0:
        fp = 0
    elif from_page >= doc2.pageCount:
        from_page = doc2.pageCount - 1
    else:
        fp = from_page

    if to_page < 0 or to_page >= doc2.pageCount:
        tp = doc2.pageCount - 1
    else:
        tp = to_page

    if start_at < 0:
        raise ValueError("do_links: 'start_at' arg must be >= 0")
    sa = start_at

    incr = 1 if fp <= tp else -1            # page range could be reversed
    # lists of source / destination page numbers
    list_src = list(range(fp, tp + incr, incr))
    list_dst = [sa + i for i in range(len(list_src))]
    # lists of source / destination page xref numbers
    xref_src = []
    xref_dst = []
    for i in range(len(list_src)):
        p_src = list_src[i]
        p_dst = list_dst[i]
        old_xref = doc2._getPageObjNumber(p_src)[0]
        new_xref = doc1._getPageObjNumber(p_dst)[0]
        xref_src.append(old_xref)
        xref_dst.append(new_xref)

    # create /Annots per copied page in destination PDF
    for i in range(len(xref_src)):
        page_src = doc2[list_src[i]]
        links = page_src.getLinks()
        if len(links) == 0:
            page_src = None
            continue
        height = page_src.bound().y1
        p_annots = ""
        page_dst = doc1[list_dst[i]]
        link_tab = []
        for l in links:
            if l["kind"] == LINK_GOTO and (l["page"] not in list_src):
                continue          # target not in copied pages
            annot_text = cre_annot(l, xref_dst, list_src, height)
            if not annot_text:
                print("cannot create /Annot for kind: " + str(l["kind"]))
            else:
                link_tab.append(annot_text)
        if len(link_tab) > 0:
            page_dst._addAnnot_FromString(link_tab)
        page_dst = None
        page_src = None
    return
135635
protected void prepareToAddChildNode() throws IOException {
		// reject modification of already closed document
		if(isOpen==false) {
			throw new IOException("Attempting to write to a closed document!");
		}
		// close previous tag, if applicable
		if(lastChildNode!=null) {
			lastChildNode.close();
			lastChildNode = null;
		}
		writer.write("\n");
	}
1251052
private void addReduceTask(TaskTracker taskTracker, List<Task> tasks,
                                  int maxReduceSlots, int currentReduceSlots) 
                    throws IOException {
    if (maxReduceSlots > currentReduceSlots) {
      reduceScheduler.updateCollectionOfQSIs();
      TaskLookupResult tlr = reduceScheduler.assignTasks(taskTracker);
      if (TaskLookupResult.LookUpStatus.TASK_FOUND == tlr.getLookUpStatus()) {
        tasks.add(tlr.getTask());
      }
    }
  }
1247330
def process_link(self, env, refnode, has_explicit_title, title, target):
        
        refnode['chpl:module'] = env.temp_data.get('chpl:module')
        refnode['chpl:class'] = env.temp_data.get('chpl:class')
        if not has_explicit_title:
            # Only has a meaning for the target.
            title = title.lstrip('.')

            # Only has a meaning for the title.
            target = target.lstrip('~')

            if title[0:1] == '~':
                title = title[1:]
                dot = title.rfind('.')
                if dot != -1:
                    title = title[dot+1:]

        # IF the first character is a dot, search more specific names
        # first. Else, search builtins first.
        if target[0:1] == '.':
            target = target[1:]
            refnode['refspecific'] = True

        return title, target
167155
private void processHyperlinkData(Task task, byte[] data)
   {
      if (data != null)
      {
         int offset = 12;
         String hyperlink;
         String address;
         String subaddress;

         offset += 12;
         hyperlink = MPPUtility.getUnicodeString(data, offset);
         offset += ((hyperlink.length() + 1) * 2);

         offset += 12;
         address = MPPUtility.getUnicodeString(data, offset);
         offset += ((address.length() + 1) * 2);

         offset += 12;
         subaddress = MPPUtility.getUnicodeString(data, offset);

         task.setHyperlink(hyperlink);
         task.setHyperlinkAddress(address);
         task.setHyperlinkSubAddress(subaddress);
      }
   }