List of references with multiplicity = 1
429161
private List<Reference> getAllOneReferences(DomainObject domainObject) {
		List<Reference> allReferences = domainObject.getReferences();
		List<Reference> allOneReferences = new ArrayList<Reference>();
		for (Reference ref : allReferences) {
			if (!ref.isMany()) {
				allOneReferences.add(ref);
			}
		}
		return allOneReferences;
	}
821694
def unique(seq):
    """"""
    cleaned = []
    for each in seq:
        if each not in cleaned:
            cleaned.append(each)
    return cleaned
1318143
def format_references(references)
      return {record_references: references, id_references: []} if references.is_a?(Array)

      references[:record_references] ||= []
      references[:id_references] ||= []
      references
    end
675785
def p_CommentOrEmptyLineList(p):
    '''
     
    '''
    if len(p) <= 1:
        p[0] = CommentOrEmptyLineList(None, None)
    elif len(p) <= 2:
        p[0] = CommentOrEmptyLineList(None, p[1])
    else:
        p[0] = CommentOrEmptyLineList(p[1], p[2])
372963
def build_ref_list(refs):
    
    ref_list = []
    for reference in refs:
        ref = ea.Citation()
        # Publcation Type
        utils.set_attr_if_value(ref, 'publication_type', reference.get('publication-type'))
        # id
        utils.set_attr_if_value(ref, 'id', reference.get('id'))
        # Article title
        utils.set_attr_if_value(ref, 'article_title', reference.get('full_article_title'))
        # Source
        utils.set_attr_if_value(ref, 'source', reference.get('source'))
        # Volume
        utils.set_attr_if_value(ref, 'volume', reference.get('volume'))
        # Issue
        utils.set_attr_if_value(ref, 'issue', reference.get('issue'))
        # First page
        utils.set_attr_if_value(ref, 'fpage', reference.get('fpage'))
        # Last page
        utils.set_attr_if_value(ref, 'lpage', reference.get('lpage'))
        # DOI
        utils.set_attr_if_value(ref, 'doi', reference.get('doi'))
        # Year
        utils.set_attr_if_value(ref, 'year', reference.get('year'))
        # Year date in iso 8601 format
        utils.set_attr_if_value(ref, 'year_iso_8601_date', reference.get('year-iso-8601-date'))
        # Can set the year_numeric now
        if ref.year_iso_8601_date is not None:
            # First preference take it from the iso 8601 date, if available
            try:
                ref.year_numeric = int(ref.year_iso_8601_date.split('-')[0])
            except ValueError:
                ref.year_numeric = None
        if ref.year_numeric is None:
            # Second preference, use the year value if it is entirely numeric
            if utils.is_year_numeric(ref.year):
                ref.year_numeric = ref.year
        # date-in-citation
        utils.set_attr_if_value(ref, 'date_in_citation', reference.get('date-in-citation'))
        # elocation-id
        utils.set_attr_if_value(ref, 'elocation_id', reference.get('elocation-id'))
        # uri
        utils.set_attr_if_value(ref, 'uri', reference.get('uri'))
        if not ref.uri:
            # take uri value from uri_text
            utils.set_attr_if_value(ref, 'uri', reference.get('uri_text'))
        # pmid
        utils.set_attr_if_value(ref, 'pmid', reference.get('pmid'))
        # isbn
        utils.set_attr_if_value(ref, 'isbn', reference.get('isbn'))
        # accession
        utils.set_attr_if_value(ref, 'accession', reference.get('accession'))
        # patent
        utils.set_attr_if_value(ref, 'patent', reference.get('patent'))
        # patent country
        utils.set_attr_if_value(ref, 'country', reference.get('country'))
        # publisher-loc
        utils.set_attr_if_value(ref, 'publisher_loc', reference.get('publisher_loc'))
        # publisher-name
        utils.set_attr_if_value(ref, 'publisher_name', reference.get('publisher_name'))
        # edition
        utils.set_attr_if_value(ref, 'edition', reference.get('edition'))
        # version
        utils.set_attr_if_value(ref, 'version', reference.get('version'))
        # chapter-title
        utils.set_attr_if_value(ref, 'chapter_title', reference.get('chapter-title'))
        # comment
        utils.set_attr_if_value(ref, 'comment', reference.get('comment'))
        # data-title
        utils.set_attr_if_value(ref, 'data_title', reference.get('data-title'))
        # conf-name
        utils.set_attr_if_value(ref, 'conf_name', reference.get('conf-name'))
        # Authors
        if reference.get('authors'):
            for author in reference.get('authors'):
                ref_author = {}
                eautils.set_if_value(ref_author, 'group-type', author.get('group-type'))
                eautils.set_if_value(ref_author, 'surname', author.get('surname'))
                eautils.set_if_value(ref_author, 'given-names', author.get('given-names'))
                eautils.set_if_value(ref_author, 'collab', author.get('collab'))
                if ref_author:
                    ref.add_author(ref_author)
        # Try to populate the doi attribute if the uri is a doi
        if not ref.doi and ref.uri:
            if ref.uri != eautils.doi_uri_to_doi(ref.uri):
                ref.doi = eautils.doi_uri_to_doi(ref.uri)
        # Append the reference to the list
        ref_list.append(ref)
    return ref_list
1106883
def reffs(self):
        
        if not self.citation.is_set():
            self.getLabel()
        return [
            reff for reffs in [self.getValidReff(level=i) for i in range(1, len(self.citation) + 1)] for reff in reffs
        ]
578737
function extractRefs(node, refs) {
  	var i, list;

  	if (node.t === REFERENCE) {
  		if (refs.indexOf(node.n) === -1) {
  			refs.unshift(node.n);
  		}
  	}

  	list = node.o || node.m;
  	if (list) {
  		if (isObject(list)) {
  			extractRefs(list, refs);
  		} else {
  			i = list.length;
  			while (i--) {
  				extractRefs(list[i], refs);
  			}
  		}
  	}

  	if (node.x) {
  		extractRefs(node.x, refs);
  	}

  	if (node.r) {
  		extractRefs(node.r, refs);
  	}

  	if (node.v) {
  		extractRefs(node.v, refs);
  	}
  }
1089614
def _duplicates(list_):
    """"""
    item_indices = {}
    for i, item in enumerate(list_):
        try:
            item_indices[item].append(i)
        except KeyError:  # First time seen
            item_indices[item] = [i]
    return item_indices
58599
def relevantindices(self) -> List[int]:
        """"""
        return [idx for idx in numpy.unique(self.refindices.values)
                if idx in self.RELEVANT_VALUES]
1363077
def uniqify(list_):
  ""
  a=[]
  for x in list_:
    if x not in a: a.append(x)
  return a
276924
def _describe_list(self) -> List[Tuple[str, float]]:
        """"""
        number_nodes = self.number_of_nodes()
        return [
            ('Number of Nodes', number_nodes),
            ('Number of Edges', self.number_of_edges()),
            ('Number of Citations', self.number_of_citations()),
            ('Number of Authors', self.number_of_authors()),
            ('Network Density', '{:.2E}'.format(nx.density(self))),
            ('Number of Components', nx.number_weakly_connected_components(self)),
            ('Number of Warnings', self.number_of_warnings()),
        ]
993752
def fields(self):
        """"""
        return (self.attributes.values() + self.lists.values()
                + self.references.values())
12086
def unique_list(lst):
    """"""
    uniq = []
    for item in lst:
        if item not in uniq:
            uniq.append(item)
    return uniq
1248096
def unique_list(input_, key=lambda x:x):
    """"""
    seen = set()
    output = []
    for x in input_:
        keyx = key(x)
        if keyx not in seen:
            seen.add(keyx)
            output.append(x)
    return output
431857
def references(self):
        
        refs = self.items.find('bibrecord/tail/bibliography', ns)
        if refs is not None:
            eids = [r.find("ref-info/refd-itemidlist/itemid", ns).text for r
                    in refs.findall("reference", ns)]
            return ["2-s2.0-" + eid for eid in eids]
        else:
            return None
74139
def build_list(self):
        """"""
        ret = []
        for p in self.args.stdout.split(','):
            if '.' in p:
                p, a = p.split('.')
            else:
                a = None
            ret.append((p, a))
        return ret
1113522
protected List<Reference> mergeReferences(
			List<? extends Reference> references1,
			List<? extends Reference> references2) {
		List<Reference> result = new ArrayList<>();
		for (Reference reference : references1) {
			addBestReferenceToList(reference, result);
		}
		for (Reference reference : references2) {
			addBestReferenceToList(reference, result);
		}
		return result;
	}