parses the references
331838
private void parseClassDescriptions() throws Exception {
        int refCount = acceptInteger(input.readByte());
        if (refCount < 0) {
            throw new IllegalArgumentException("Invalid binary data: Expected count of references, but was: " + refCount);
        }
        refs = new Object[refCount];

        int classMapSize = acceptMap(input.readByte());
        classes = new ClassInfo[classMapSize]; // Guaranteed non-negative by acceptMap()
        classMap = new HashMap<>(classMapSize);

        for (int position = 0; position < classMapSize; position++) {
            ClassInfo classInfo = parseClassInfo();
            classes[position] = classInfo;
            classMap.put(classInfo.type, classInfo);
        }
    }
386433
def parse_type_reference(lexer: Lexer) -> TypeNode:
    """"""
    start = lexer.token
    if expect_optional_token(lexer, TokenKind.BRACKET_L):
        type_ = parse_type_reference(lexer)
        expect_token(lexer, TokenKind.BRACKET_R)
        type_ = ListTypeNode(type=type_, loc=loc(lexer, start))
    else:
        type_ = parse_named_type(lexer)
    if expect_optional_token(lexer, TokenKind.BANG):
        return NonNullTypeNode(type=type_, loc=loc(lexer, start))
    return type_
412557
private function parseRefAsTag($reference): ?string
    {
        if (preg_match(self::REGEX_TAG, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[1];
    }
250434
@SuppressWarnings("static-method")
	protected ReferenceContext extractReferencableElements(String text) {
		final ReferenceContext context = new ReferenceContext();

		// Visit the links and record the transformations
		final MutableDataSet options = new MutableDataSet();
		final Parser parser = Parser.builder(options).build();
		final Node document = parser.parse(text);
		final Pattern pattern = Pattern.compile(SECTION_PATTERN_AUTONUMBERING);
		NodeVisitor visitor = new NodeVisitor(
				new VisitHandler<>(Paragraph.class, it -> {
					final Matcher matcher = pattern.matcher(it.getContentChars());
					if (matcher.find()) {
						final String number = matcher.group(2);
						final String title = matcher.group(3);
						final String key1 = computeHeaderId(number, title);
						final String key2 = computeHeaderId(null, title);
						context.registerSection(key1, key2, title);
					}
				}));
		visitor.visitChildren(document);

		visitor = new NodeVisitor(
				new VisitHandler<>(Heading.class, it -> {
					String key = it.getAnchorRefId();
					final String title = it.getAnchorRefText();
					final String key2 = computeHeaderId(null, title);
					if (Strings.isEmpty(key)) {
						key = key2;
					}
					context.registerSection(key, key2, title);
				}));
		visitor.visitChildren(document);

		return context;
	}
261404
function resolveReferences() {

    var elementsById = context.elementsById;
    var references = context.references;

    var i, r;

    for (i = 0; (r = references[i]); i++) {
      var element = r.element;
      var reference = elementsById[r.id];
      var property = getModdleDescriptor(element).propertiesByName[r.property];

      if (!reference) {
        context.addWarning({
          message: 'unresolved reference <' + r.id + '>',
          element: r.element,
          property: r.property,
          value: r.id
        });
      }

      if (property.isMany) {
        var collection = element.get(property.name),
            idx = collection.indexOf(r);

        // we replace an existing place holder (idx != -1) or
        // append to the collection instead
        if (idx === -1) {
          idx = collection.length;
        }

        if (!reference) {
          // remove unresolvable reference
          collection.splice(idx, 1);
        } else {
          // add or update reference in collection
          collection[idx] = reference;
        }
      } else {
        element.set(property.name, reference);
      }
    }
  }
1141634
public function parse()
    {
        $this->lexer->moveNext();

        while (true) {
            if (!$this->lexer->lookahead) {
                break;
            }

            $this->lexer->moveNext();
            $thisLine = null;

            switch ($this->lexer->token['type']) {
                case Lexer::T_OPEN_PARENTHESIS:
                case Lexer::T_OPEN_BRACKET:
                case Lexer::T_OPEN_CURLY_BRACE:
                    $thisLine = '[';
                    $this->currentLevel++;
                    break;
                case Lexer::T_CLOSE_PARENTHESIS:
                case Lexer::T_CLOSE_BRACKET:
                case Lexer::T_CLOSE_CURLY_BRACE:
                    $thisLine = ']';
                    $this->currentLevel--;
                    break;
                case Lexer::T_STRING:
                    $thisLine = "'".str_replace("'", "\'", $this->lexer->token['value'])."'";
                    break;
                case Lexer::T_DOUBLEPOINT:
                    $thisLine = '=>';
                    break;
                case Lexer::T_COMMENT_PARAMSTART:
                    $paramName = $this->lexer->lookahead['value'];
                    $thisLine = '$this->getParam("'.$paramName.'")';
                    // scroll to end of param
                    while ($this->lexer->token['type'] != Lexer::T_COMMENT_PARAMEND) {
                        $this->lexer->moveNext();
                    }
                    break;
                case Lexer::T_COMMENT_IFPARAMSTART:
                case Lexer::T_COMMENT_IFNOTPARAMSTART:
                    $conditionalId = str_pad((string) $this->conditionalCounter, 5, '0', STR_PAD_LEFT);
                    $this->conditionalCounter++;

                    $isNegated = '';
                    if ($this->lexer->token['type'] == Lexer::T_COMMENT_IFNOTPARAMSTART) {
                        $isNegated = 'true';
                    }

                    $this->addContent('$this->getConditional'.$conditionalId.'('.$isNegated.'),');
                    $this->openConditional($conditionalId, $this->lexer->lookahead['value']);
                    break;
                case Lexer::T_COMMENT_IFPARAMEND:
                case Lexer::T_COMMENT_IFNOTPARAMEND:
                    $this->closeConditional();
                    break;
                case Lexer::T_DATE_EMPTY:
                    $thisLine = 'new '.$this->mongoDateClass.'()';
                    break;
                case Lexer::T_DATE_WITH_PARAM:
                    $paramName = $this->lexer->lookahead['value'];
                    $thisLine = '$this->getParam("'.$paramName.'")';
                    break;
                case Lexer::T_BOOLEAN_TRUE:
                    $thisLine = 'true';
                    break;
                case Lexer::T_BOOLEAN_FALSE:
                    $thisLine = 'false';
                    break;
                case Lexer::T_NULL:
                    $thisLine = 'null';
                    break;
                case Lexer::T_COMMA:
                case Lexer::T_NUMBER:
                case Lexer::T_DASH:
                    $thisLine = $this->lexer->token['value'];
                    break;
                default:
                    // nothing
            }

            if (!is_null($thisLine)) {
                $this->addContent($thisLine);
            }
        }

        return implode(PHP_EOL, $this->lines);
    }
1030948
def parse_references(reference_lines,
                     recid=None,
                     override_kbs_files=None,
                     reference_format=u"{title} {volume} ({year}) {page}",
                     linker_callback=None):
    
    # RefExtract knowledge bases
    kbs = get_kbs(custom_kbs_files=override_kbs_files)
    # Identify journal titles, report numbers, URLs, DOIs, and authors...
    processed_references, counts, dummy_bad_titles_count = \
        parse_references_elements(reference_lines, kbs, linker_callback)

    return (build_references(processed_references, reference_format),
            build_stats(counts))
186600
function processRefs (instance) {
  return Object.keys(instance.$refs)
    .filter(key => instance.$refs[key])
    .map(key => getCustomRefDetails(instance, key, instance.$refs[key]))
}
1172313
def getReferenceAnalyses(self):
        """"""
        ans = self.getAnalyses()
        references = [an for an in ans if IReferenceAnalysis.providedBy(an)]
        return references
455105
public function getReferences() {
		if (count($this->references) == 0) {
			$this->references = EntityReflexion::getReferences(get_class($this));
		}
		return $this->references;
	}
46921
private function getReferencesDeclaration()
    {

        // we got a max instances allowed in normality tags
        $references = json_encode( $this->entity->pgClass->getReferences() );
        $references = Php::varExport( $references, true );

        $this->class->classComponents[] = new VariableDeclaration(
            'references',
            new SFormatf( <<<'PHP'
                /**
                 * Reference information for this relation
                 * @var array
                 */
                protected $references = %s;
PHP
                , $references
            )
        );

    }
1275124
def _compile_references(self, url, tree):
        '''
        
        '''
        references = []
        for ref in tree.findall('.//{%s}catalogRef' % INV_NS):
            # Check skips
            title = ref.get("{%s}title" % XLINK_NS)
            if any([x.match(title) for x in self.skip]):
                logger.info("Skipping catalogRef based on 'skips'.  Title: %s" % title)
                continue
            references.append(construct_url(url, ref.get("{%s}href" % XLINK_NS)))
        return references
656324
def build_references(citations, reference_format=False):
    
    # Now, run the method which will take as input:
    # 1. A list of lists of dictionaries, where each dictionary is a piece
    # of citation information corresponding to a tag in the citation.
    # 2. The line marker for this entire citation line (mulitple citation
    # 'finds' inside a single citation will use the same marker value)
    # The resulting xml line will be a properly marked up form of the
    # citation. It will take into account authors to try and split up
    # references which should be read as two SEPARATE ones.
    return [c for citation_elements in citations
            for elements in citation_elements['elements']
            for c in build_reference_fields(elements,
                                            citation_elements['line_marker'],
                                            citation_elements['raw_ref'],
                                            reference_format)]
618948
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'id'
          @file_reference = FileReference.new(parent: self).parse(node)
        when 'type'
          @stretching_type = case value.value
                             when 'frame'
                               :stretch
                             else
                               value.value.to_sym
                             end
        when 'title'
          @title = value.value.to_s
        end
      end
      self
    end
1257014
public synchronized final void parseDetails() {
        LOG.debug("parsing details of {}", this.getType());
        if (content != null) {
            ByteBuffer content = this.content;
            isParsed = true;
            content.rewind();
            _parseDetails(content);
            if (content.remaining() > 0) {
                deadBytes = content.slice();
            }
            this.content = null;
            assert verify(content);
        }
    }
778079
def referencesFinder(text):
    
    references = referencesRegEx.finditer(text)
    count = 0
    refs = []
    spans = []
    for i in references:
        refs.append(i.group())
        spans.append(i.span())
        count += 1
    done = set()
    nameRegEx = re.compile(r"""(name=["']*.*?["']*)(\s|/|>)""")

    for index, obj in enumerate(refs):

        if obj.startswith('<ref name='):
                nameTag = re.escape(nameRegEx.search(obj).group(1))

                if nameTag not in done:
                    nameTag = re.escape(nameRegEx.search(obj).group(1))
                    indeces = [i for i, x in enumerate(refs) if re.search(nameTag, x)]
                    matches = [refs[i] for i in indeces]
                    full = max(matches, key=len)

                    for i in indeces:
                        refs[i] = full

                    done.add(nameTag)

    #eliminate <ref tag or other rudiments from the ref string

    for i in range(len(refs)):
        #print('SIIT', refs[i])
        lastindex = refs[i].rindex('<')
        firstindex = refs[i].index('>')+1
        refs[i]=refs[i][firstindex:lastindex]

    #Handle cite-references

    for i in range(len(refs)):
        if 'cite' in refs[i].lower():
            newText = ''
            values = refs[i].split('|')
            for j in values:
                if '=' in j:
                    first = j.index('=')
                    newText += j[first+1:].strip() + ';'
            refs[i] = newText
    #a ref string:position int dictionary
    refspos = {}
    c = 0
    for i in refs:
        if i not in refspos.keys():
            refspos[i] = c
            c +=1
        else:
            continue

    #print(refspos)

    #eliminate old, bad <ref> tags and insert clean  ones <ref 1..2..3/> to the same spot.
    newText = ''
    assert len(spans) == len(refs)
    #Could happen... havent yet.
    next = 0
    for i in range(len(spans)):
        start = spans[i][0]
        newText+=text[next:start]+'<ref '+str(refspos[refs[i]])+'/>'
        next = spans[i][1]

    newText+=text[next:]

    #switch keys:values in the dictionary for use in sectionsParser
    #positiontag:ref
    newDict  = {y:x for x,y in refspos.items()}

    return newText, newDict
1055095
def References(self):
        
        if self.__references is None:

            refs = {}

            # group by the input prevhash
            for hash, group in groupby(self.inputs, lambda x: x.PrevHash):

                tx, height = GetBlockchain().GetTransaction(hash.ToBytes())
                if tx is not None:
                    for input in group:
                        refs[input] = tx.outputs[input.PrevIndex]

            self.__references = refs

        return self.__references