Add your code for processing the document
322562
def process_document(self, doc):
        

        segment = doc.select_segments("target_text")[0]

        for e in self.e_list:
            res = doc.extract(e, segment)
            doc.store(res, e.name)
        return list()
467568
def process_docstring(app, what, name, obj, options, lines):
    """"""
    # pylint: disable=unused-argument
    # pylint: disable=too-many-arguments
    lines.extend(_format_contracts(what=what, obj=obj))
375300
function ProcessingInstruction(doc, name, content) {
    if (!doc) {
        throw new Error('document argument required');
    } else if (! (doc instanceof bindings.Document)) {
        throw new Error('document argument must be an ' +
                        'instance of Document');
    } else if (!name) {
        throw new Error('name argument required');
    }

    return new bindings.ProcessingInstruction(doc, name, content);
}
321369
def process(env)
      @document.zip_contents.to_a.each do |(entry_name, content)|
        @document.current_entry = entry_name
        processors = Template.get_processors(entry_name)
        processors.each { |processor| processor.process(content, env) }
      end
    end
605500
def setup_parse(self, inputstring, document):
        """"""
        self.inputstring = inputstring
        self.document = document
653946
protected function wizardAddFile()
    {
        $this->validatePrompt('path', $this->text('Path'), 'file');
        $this->validatePrompt('entity', $this->text('Entity'), 'file');
        $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0);
        $this->validatePrompt('title', $this->text('Title'), 'file', '');
        $this->validatePrompt('description', $this->text('Description'), 'file', '');
        $this->validatePrompt('weight', $this->text('Weight'), 'file', 0);

        $this->validateComponent('file');
        $this->addFile();
    }
925921
private void processToUnicode(){
        
        PdfObject toUni = fontDic.get(PdfName.TOUNICODE);
        if (toUni != null){
            
            try {
                byte[] touni = PdfReader.getStreamBytes((PRStream)PdfReader.getPdfObjectRelease(toUni));
    
                CMapParser cmapParser = new CMapParser();
                toUnicodeCmap = cmapParser.parse(new ByteArrayInputStream(touni));
            } catch (IOException e) {
                throw new Error("Unable to process ToUnicode map - " + e.getMessage(), e);
            }
        }
    }
1117958
def process(self, ymlfile):
        
        output = ""

        try:
            # Need a list of line numbers where the documents resides
            # Used for finding/displaying errors
            self.doclines = []
            linenum = None
            with open(ymlfile, 'r') as txt:
                for linenum, line in enumerate(txt):
                    # Pattern to match document start lines
                    doc_pattern = re.compile('(---) (![a-z]+)(.*$)', flags=re.I)

                    # Pattern to match sequence start lines
                    seq_pattern = re.compile('(\s*)(-+) !([a-z]+)(.*$)', flags=re.I)

                    # If we find a document, remove the tag
                    if doc_pattern.match(line):
                        line = doc_pattern.sub(r"---", line).lower()
                        self.doclines.append(linenum)
                    elif seq_pattern.match(line):
                        # Replace the sequence start with key string
                        line = seq_pattern.sub(r"\1\2 \3: line " + str(linenum), line).lower()

                    output = output + line

            if linenum is None:
                msg = "Empty YAML file: " + ymlfile
                raise util.YAMLError(msg)
            else:
                # Append one more document to docline for the end
                self.doclines.append(linenum+1)

            return output

        except IOError, e:
            msg = "Could not process YAML file '" + ymlfile + "': '" + str(e) + "'"
            raise IOError(msg)
160503
def process_document(self, doc):
        

        raw = doc.select_segments("$.raw_content")[0]

        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.ALL_TEXT), "etk2_text")
        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.MAIN_CONTENT_STRICT),
                              "etk2_content_strict")
        doc.store(doc.extract(self.content_extractor, raw, strategy=Strategy.MAIN_CONTENT_RELAXED),
                              "etk2_content_relaxed")
        doc.store(doc.extract(self.metadata_extractor,
                              raw,
                              extract_title=True,
                              extract_meta=True,
                              extract_microdata=True,
                              extract_rdfa=True,
                              ), "etk2_metadata")
        return list()
117250
def add_document(self, document):
        '''
        
        '''

        documents_url = urljoin(self.base_url, self.DOCUMENTS_PAGE)
        data = {"corpus": self.url}
        files = {"blob": document}
        result = self.session.post(documents_url, data=data, files=files)
        if result.status_code == 201:
            return Document(session=self.session, **result.json())
        else:
            raise RuntimeError("Document creation failed with status "
                               "{}. The response was: '{}'".format(result.status_code,
                                result.text))
984477
def insert(self):
        """"""
        from mongoframes.queries import to_refs

        # Send insert signal
        signal('insert').send(self.__class__, frames=[self])

        # Prepare the document to be inserted
        document = to_refs(self._document)

        # Insert the document and update the Id
        self._id = self.get_collection().insert_one(document).inserted_id

        # Send inserted signal
        signal('inserted').send(self.__class__, frames=[self])
552259
def build_code(self, lang, body):
        """"""
        self.out.append("```" + lang)
        self.build_markdown(lang, body)
        self.out.append("```")
1056923
def process_token(self, tok):
        """"""
        if(tok[0].__str__() in ('Token.Comment.Multiline', 'Token.Comment',
                'Token.Literal.String.Doc')):
            self.comments += tok[1].count('\n')+1
        elif(tok[0].__str__() in ('Token.Comment.Single')):
            self.comments += 1
        elif(self.contains_code and tok[0].__str__().startswith('Token.Text')
                and tok[1].count(u'\n')):
            # start new line
            self.contains_code = False
            self.sloc += 1
        # for c style includes
        elif(tok[0].__str__() == 'Token.Comment.Preproc' and
                tok[1].count(u'\n')):
            # start new line
            self.contains_code = False
            self.sloc += 1
        elif(tok[0][0] in token_types):
            self.contains_code = True
821264
protected function prepDocument()
    {
        /*
         * In some cases a body element can't be found (if the HTML is totally hosed for example)
         * so we create a new body node and append it to the document.
         */
        if (null === $this->body) {
            $this->body = $this->dom->createElement('body');
            $this->dom->documentElement->appendChild($this->body);
        }

        $this->body->setAttribute('class', 'readabilityBody');

        // Remove all style tags in head.
        $styleTags = $this->dom->getElementsByTagName('style');
        for ($i = $styleTags->length - 1; $i >= 0; --$i) {
            $styleTags->item($i)->parentNode->removeChild($styleTags->item($i));
        }

        $linkTags = $this->dom->getElementsByTagName('link');
        for ($i = $linkTags->length - 1; $i >= 0; --$i) {
            $linkTags->item($i)->parentNode->removeChild($linkTags->item($i));
        }
    }
864174
def process_document(self, doc, std):
        """"""
        if doc.url not in self.blacklist:
            print("Indexing '%s' %s..." % (doc.url, std))
            name = self.extract_name(doc.text)
            self.results.add((name, doc.url, std))
        else:
            print("Skipping blacklisted page '%s' ..." % doc.url)
            return None
623970
def process_f2pydoc(f2pydoc):
    
    # ---- split f2py document in its parts
    # 0=Call Signature
    # 1=Parameters
    # 2=Other (optional) Parameters (only if present)
    # 3=Returns
    docparts = re.split('\n--', f2pydoc)

    if len(docparts) == 4:
        doc_has_optionals = True
    elif len(docparts) == 3:
        doc_has_optionals = False
    else:
        print('-- uninterpretable f2py documentation --')
        return f2pydoc

    # ---- replace arguments with _d suffix with empty string in ----
    # ---- function signature (remove them): ----
    docparts[0] = re.sub('[\[(,]\w+_d\d', '', docparts[0])

    # ---- replace _d arguments of the return arrays with their default value:
    if doc_has_optionals:

        returnarray_dims = re.findall('[\[(,](\w+_d\d)', docparts[3])
        for arg in returnarray_dims:
            searchpattern = arg + ' : input.*\n.*Default: (.*)\n'
            match = re.search(searchpattern, docparts[2])
            if match:
                default = match.group(1)
                docparts[3] = re.sub(arg, default, docparts[3])
                docparts[2] = re.sub(searchpattern, '', docparts[2])

    # ---- remove all optional _d# from optional argument list:
    if doc_has_optionals:
        searchpattern = '\w+_d\d : input.*\n.*Default: (.*)\n'
        docparts[2] = re.sub(searchpattern, '', docparts[2])

    # ---- combine doc parts to a single string
    processed_signature = '\n--'.join(docparts)

    return processed_signature
17622
function process(content, encoding, attrs, node) {
    if (typeof content === 'undefined') {
      console.error(
        colors.red('process() : Undefined "content" parameters.')
      );
      return '';
    }
    if (!encoding || encoding === 'original') {
      return content;
    }
    var items = encoding.split(/\s*,\s*/);
    if (items.length > 1) {
      items.forEach(function (item) {
        content = process(content, item, attrs, node);
      });
      return content;
    }
    var processor = getProcessor(encoding);
    if (!processor) {
      console.error(
        colors.red('The "%s" processor does not exist.'), encoding
      );
      return content;
    }
    return processor(content, attrs, instance, node);
  }