id
stringlengths
24
24
repo
stringlengths
7
52
path
stringlengths
5
138
func_name
stringlengths
1
134
url
stringlengths
89
242
split
stringclasses
3 values
language
stringclasses
1 value
docstring
stringlengths
1
46.9k
code
stringlengths
87
104k
text
stringlengths
100
112k
token_count
int32
25
38.1k
doc_chars
int32
1
46.9k
code_chars
int32
87
104k
license_basis
stringclasses
1 value
source
stringclasses
1 value
added
stringdate
2026-12-05 00:00:00
2026-12-05 00:00:00
record_sha256
stringlengths
64
64
license
stringclasses
9 values
license_class
stringclasses
1 value
license_source
stringlengths
46
99
ecef0c8bab6ff198d24648fe
elifesciences/elife-tools
elifetools/utils.py
tag_supplementary_material_sibling_ordinal
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L389-L422
train
python
Strategy is to count the previous supplementary-material tags having the same asset value to get its sibling ordinal. The result is its position inside any parent tag that are the same asset type
def tag_supplementary_material_sibling_ordinal(tag): """ Strategy is to count the previous supplementary-material tags having the same asset value to get its sibling ordinal. The result is its position inside any parent tag that are the same asset type """ if hasattr(tag, 'name') and tag.nam...
Strategy is to count the previous supplementary-material tags having the same asset value to get its sibling ordinal. The result is its position inside any parent tag that are the same asset type def tag_supplementary_material_sibling_ordinal(tag): """ Strategy is to count the previous supplementar...
313
207
1,268
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
426a113ab32e2c6c973ebf51a83ac0d036f8ddecf58b045282c5842a5df37e3e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
1ae8eed6223659a4756d9a2e
elifesciences/elife-tools
elifetools/utils.py
supp_asset
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L425-L440
train
python
Given a supplementary-material tag, the asset value depends on its label text. This also informs in what order (its ordinal) it has depending on how many of each type is present
def supp_asset(tag): """ Given a supplementary-material tag, the asset value depends on its label text. This also informs in what order (its ordinal) it has depending on how many of each type is present """ # Default asset = 'supp' if first(extract_nodes(tag, "label")): label_tex...
Given a supplementary-material tag, the asset value depends on its label text. This also informs in what order (its ordinal) it has depending on how many of each type is present def supp_asset(tag): """ Given a supplementary-material tag, the asset value depends on its label text. This also informs...
179
185
564
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
c6a918e0c1758a9fe0ad020055780baaa3984e5e77f438cbacf20b4859c16d49
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
9e9ac40a47536b6fe1c8f7c7
elifesciences/elife-tools
elifetools/utils.py
text_to_title
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L460-L478
train
python
when a title is required, generate one from the value
def text_to_title(value): """when a title is required, generate one from the value""" title = None if not value: return title words = value.split(" ") keep_words = [] for word in words: if word.endswith(".") or word.endswith(":"): keep_words.append(word) i...
when a title is required, generate one from the value def text_to_title(value): """when a title is required, generate one from the value""" title = None if not value: return title words = value.split(" ") keep_words = [] for word in words: if word.endswith(".") or word.endswith(...
162
53
622
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
26216bd075fe36aff1347c4e6a57720cfd83cfd9c0d473b1e764c16dccde7b32
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
4737c5e12bfe5e3b2da8871e
elifesciences/elife-tools
elifetools/utils.py
escape_unmatched_angle_brackets
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L486-L521
train
python
In order to make an XML string less malformed, escape unmatched less than tags that are not part of an allowed tag Note: Very, very basic, and do not try regex \1 style replacements on unicode ever again! Instead this uses string replace allowed_tag_fragments is a tuple of tag name matches for use wit...
def escape_unmatched_angle_brackets(string, allowed_tag_fragments=()): """ In order to make an XML string less malformed, escape unmatched less than tags that are not part of an allowed tag Note: Very, very basic, and do not try regex \1 style replacements on unicode ever again! Instead this uses ...
In order to make an XML string less malformed, escape unmatched less than tags that are not part of an allowed tag Note: Very, very basic, and do not try regex \1 style replacements on unicode ever again! Instead this uses string replace allowed_tag_fragments is a tuple of tag name matches for use wit...
434
334
1,581
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
58680c2907d0d69c2ac19e0d7b9516bb61903952625803acbc7241c4bb79b0ce
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f8b4109fc5e8aab0e761f4c0
elifesciences/elife-tools
elifetools/utils.py
escape_ampersand
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils.py#L523-L533
train
python
Quick convert unicode ampersand characters not associated with a numbered entity or not starting with allowed characters to a plain &
def escape_ampersand(string): """ Quick convert unicode ampersand characters not associated with a numbered entity or not starting with allowed characters to a plain & """ if not string: return string start_with_match = r"(\#x(....);|lt;|gt;|amp;)" # The pattern below is match & ...
Quick convert unicode ampersand characters not associated with a numbered entity or not starting with allowed characters to a plain & def escape_ampersand(string): """ Quick convert unicode ampersand characters not associated with a numbered entity or not starting with allowed characters to a plain...
137
141
446
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
55a29dc86bdcd52349a46a318cfcd2390e3bf62fa59f7781d9f095461a3596ae
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
cf211f68ba5e255310966f03
elifesciences/elife-tools
elifetools/xmlio.py
parse
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L41-L66
train
python
to extract the doctype details from the file when parsed and return the data for later use, set return_doctype_dict to True
def parse(filename, return_doctype_dict=False): """ to extract the doctype details from the file when parsed and return the data for later use, set return_doctype_dict to True """ doctype_dict = {} # check for python version, doctype in ElementTree is deprecated 3.2 and above if sys.version_...
to extract the doctype details from the file when parsed and return the data for later use, set return_doctype_dict to True def parse(filename, return_doctype_dict=False): """ to extract the doctype details from the file when parsed and return the data for later use, set return_doctype_dict to True ...
258
127
934
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d25b6443f4dfaa5bec7960fb7b4e35015513b7401a881acedc2a60a68c70ac7d
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
1016d6e1da57cb7422d0c75b
elifesciences/elife-tools
elifetools/xmlio.py
add_tag_before
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L68-L77
train
python
Helper function to refactor the adding of new tags especially for when converting text to role tags
def add_tag_before(tag_name, tag_text, parent_tag, before_tag_name): """ Helper function to refactor the adding of new tags especially for when converting text to role tags """ new_tag = Element(tag_name) new_tag.text = tag_text if get_first_element_index(parent_tag, before_tag_name): ...
Helper function to refactor the adding of new tags especially for when converting text to role tags def add_tag_before(tag_name, tag_text, parent_tag, before_tag_name): """ Helper function to refactor the adding of new tags especially for when converting text to role tags """ new_tag = Element(...
118
103
429
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
1cbec06506ccb3f487477d6b8abecdbe087a4763309373a2ea2a0be7fabac2be
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
ac47ad434a11e5300dc4edd8
elifesciences/elife-tools
elifetools/xmlio.py
get_first_element_index
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L80-L95
train
python
In order to use Element.insert() in a convenient way, this function will find the first child tag with tag_name and return its index position The index can then be used to insert an element before or after the found tag using Element.insert()
def get_first_element_index(root, tag_name): """ In order to use Element.insert() in a convenient way, this function will find the first child tag with tag_name and return its index position The index can then be used to insert an element before or after the found tag using Element.insert() ...
In order to use Element.insert() in a convenient way, this function will find the first child tag with tag_name and return its index position The index can then be used to insert an element before or after the found tag using Element.insert() def get_first_element_index(root, tag_name): """ In ...
181
258
548
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
3b2e2c283586bbfe2bcdc81ce3151fdda4f61d0ec70e4676198e93f10f4703bd
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
657fda24d2f1e2e644733deb
elifesciences/elife-tools
elifetools/xmlio.py
rewrite_subject_group
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L119-L169
train
python
add or rewrite subject tags inside subj-group tags
def rewrite_subject_group(root, subjects, subject_group_type, overwrite=True): "add or rewrite subject tags inside subj-group tags" parent_tag_name = 'subj-group' tag_name = 'subject' wrap_tag_name = 'article-categories' tag_attribute = 'subj-group-type' # the parent tag where it should be found...
add or rewrite subject tags inside subj-group tags def rewrite_subject_group(root, subjects, subject_group_type, overwrite=True): "add or rewrite subject tags inside subj-group tags" parent_tag_name = 'subj-group' tag_name = 'subject' wrap_tag_name = 'article-categories' tag_attribute = 'subj-group...
495
50
2,211
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
1497a952110bec359a451ace1cf5c3ce1593de24e0908030572d28d6d867c567
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b4605d78f73d26bd78e5c03a
elifesciences/elife-tools
elifetools/xmlio.py
build_doctype
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L209-L218
train
python
Instantiate an ElifeDocumentType, a subclass of minidom.DocumentType, with some properties so it is more testable
def build_doctype(qualifiedName, publicId=None, systemId=None, internalSubset=None): """ Instantiate an ElifeDocumentType, a subclass of minidom.DocumentType, with some properties so it is more testable """ doctype = ElifeDocumentType(qualifiedName) doctype._identified_mixin_init(publicId, syste...
Instantiate an ElifeDocumentType, a subclass of minidom.DocumentType, with some properties so it is more testable def build_doctype(qualifiedName, publicId=None, systemId=None, internalSubset=None): """ Instantiate an ElifeDocumentType, a subclass of minidom.DocumentType, with some properties so it is ...
125
117
414
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
0c0dff86822bace1f4ed81eadc0c700e7210f3f15a753455f208b9b70540a563
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e5a4f18f393feffe6c9b7f48
elifesciences/elife-tools
elifetools/xmlio.py
append_minidom_xml_to_elementtree_xml
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/xmlio.py#L245-L290
train
python
Recursively, Given an ElementTree.Element as parent, and a minidom instance as xml, append the tags and content from xml to parent Used primarily for adding a snippet of XML with <italic> tags attributes: a list of attribute names to copy
def append_minidom_xml_to_elementtree_xml(parent, xml, recursive=False, attributes=None): """ Recursively, Given an ElementTree.Element as parent, and a minidom instance as xml, append the tags and content from xml to parent Used primarily for adding a snippet of XML with <italic> tags attribute...
Recursively, Given an ElementTree.Element as parent, and a minidom instance as xml, append the tags and content from xml to parent Used primarily for adding a snippet of XML with <italic> tags attributes: a list of attribute names to copy def append_minidom_xml_to_elementtree_xml(parent, xml, recursive...
407
254
1,690
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
22adee974b2b1ca8817ad5add5bf8bc548a8b52c0a846ef9ab7f98f0981f9158
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
36f52978779d4ca5f763c1d2
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L10-L32
train
python
Due to XML content that will not conform with the strict JSON schema validation rules, for elife articles only, rewrite the JSON to make it valid
def rewrite_json(rewrite_type, soup, json_content): """ Due to XML content that will not conform with the strict JSON schema validation rules, for elife articles only, rewrite the JSON to make it valid """ if not soup: return json_content if not elifetools.rawJATS.doi(soup) or not elifet...
Due to XML content that will not conform with the strict JSON schema validation rules, for elife articles only, rewrite the JSON to make it valid def rewrite_json(rewrite_type, soup, json_content): """ Due to XML content that will not conform with the strict JSON schema validation rules, for elife arti...
263
149
980
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
c97a1167a95a7d8c5b582941e69d56b7f8a7c9470db34145963c665691bff589
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b6503cea92882c7a0a5ecea6
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_references_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L40-L52
train
python
this does the work of rewriting elife references json
def rewrite_elife_references_json(json_content, doi): """ this does the work of rewriting elife references json """ references_rewrite_json = elife_references_rewrite_json() if doi in references_rewrite_json: json_content = rewrite_references_json(json_content, references_rewrite_json[doi]) # E...
this does the work of rewriting elife references json def rewrite_elife_references_json(json_content, doi): """ this does the work of rewriting elife references json """ references_rewrite_json = elife_references_rewrite_json() if doi in references_rewrite_json: json_content = rewrite_references_js...
131
53
553
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
5e6300319d280ce71276d183d6d13ce97734c96584711f43e637d0d16655c73d
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
2193e512beec39bdfa677e50
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_references_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L54-L60
train
python
general purpose references json rewriting by matching the id value
def rewrite_references_json(json_content, rewrite_json): """ general purpose references json rewriting by matching the id value """ for ref in json_content: if ref.get("id") and ref.get("id") in rewrite_json: for key, value in iteritems(rewrite_json.get(ref.get("id"))): ref[k...
general purpose references json rewriting by matching the id value def rewrite_references_json(json_content, rewrite_json): """ general purpose references json rewriting by matching the id value """ for ref in json_content: if ref.get("id") and ref.get("id") in rewrite_json: for key, value ...
87
66
355
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
df98a14d300f673a5014f1386015cd31d2b4d1df4b129706aad634c1329786f6
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
38dee9ce738777734328f0fd
elifesciences/elife-tools
elifetools/json_rewrite.py
elife_references_rewrite_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L62-L391
train
python
Here is the DOI and references json replacements data for elife
def elife_references_rewrite_json(): """ Here is the DOI and references json replacements data for elife """ references_rewrite_json = {} references_rewrite_json["10.7554/eLife.00051"] = {"bib25": {"date": "2012"}} references_rewrite_json["10.7554/eLife.00278"] = {"bib11": {"date": "2013"}} referen...
Here is the DOI and references json replacements data for elife def elife_references_rewrite_json(): """ Here is the DOI and references json replacements data for elife """ references_rewrite_json = {} references_rewrite_json["10.7554/eLife.00051"] = {"bib25": {"date": "2012"}} references_rewrite_json...
5,095
63
16,807
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
9ab67b41664fc1b085e014632d829f78413d398ad7f0716a33f286ccddc4be4f
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
343c2b2ae6a55516d064a4e9
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_body_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L393-L477
train
python
rewrite elife body json
def rewrite_elife_body_json(json_content, doi): """ rewrite elife body json """ # Edge case add an id to a section if doi == "10.7554/eLife.00013": if (json_content and len(json_content) > 0): if (json_content[0].get("type") and json_content[0].get("type") == "section" a...
rewrite elife body json def rewrite_elife_body_json(json_content, doi): """ rewrite elife body json """ # Edge case add an id to a section if doi == "10.7554/eLife.00013": if (json_content and len(json_content) > 0): if (json_content[0].get("type") and json_content[0].get("type") == "s...
971
23
4,236
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
4c41bab7e1c6fe2a2ba2cd3a4b216d98655503cb4a2a093497a8342d3727fbb2
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f663a7deae233434c0125b2d
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_funding_awards
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L480-L505
train
python
rewrite elife funding awards
def rewrite_elife_funding_awards(json_content, doi): """ rewrite elife funding awards """ # remove a funding award if doi == "10.7554/eLife.00801": for i, award in enumerate(json_content): if "id" in award and award["id"] == "par-2": del json_content[i] # add fundin...
rewrite elife funding awards def rewrite_elife_funding_awards(json_content, doi): """ rewrite elife funding awards """ # remove a funding award if doi == "10.7554/eLife.00801": for i, award in enumerate(json_content): if "id" in award and award["id"] == "par-2": del jso...
316
28
1,175
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
090d69fe99761177cbfb2e3f96ad5c415475bacd29988d27405c042ceccd3b8d
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b29ef48538d165e610b4d2b5
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_authors_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L507-L624
train
python
this does the work of rewriting elife authors json
def rewrite_elife_authors_json(json_content, doi): """ this does the work of rewriting elife authors json """ # Convert doi from testing doi if applicable article_doi = elifetools.utils.convert_testing_doi(doi) # Edge case fix an affiliation name if article_doi == "10.7554/eLife.06956": fo...
this does the work of rewriting elife authors json def rewrite_elife_authors_json(json_content, doi): """ this does the work of rewriting elife authors json """ # Convert doi from testing doi if applicable article_doi = elifetools.utils.convert_testing_doi(doi) # Edge case fix an affiliation name ...
2,731
50
10,635
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
b26fa51d093d612b03b79287f0da6ed21f875f55d81bd75714d37c2bd129013b
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
7de5d8c2939bdb0151b0535f
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_datasets_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L626-L925
train
python
this does the work of rewriting elife datasets json
def rewrite_elife_datasets_json(json_content, doi): """ this does the work of rewriting elife datasets json """ # Add dates in bulk elife_dataset_dates = [] elife_dataset_dates.append(("10.7554/eLife.00348", "used", "dataro17", u"2010")) elife_dataset_dates.append(("10.7554/eLife.01179", "used", "d...
this does the work of rewriting elife datasets json def rewrite_elife_datasets_json(json_content, doi): """ this does the work of rewriting elife datasets json """ # Add dates in bulk elife_dataset_dates = [] elife_dataset_dates.append(("10.7554/eLife.00348", "used", "dataro17", u"2010")) elife_da...
5,683
51
21,304
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
a06552680054bc73ab923a91c89428453581f8418ef9e7aa0b404bf964b7ef8a
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
1482d298a3dd5461cf346d6b
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_editors_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L937-L1169
train
python
this does the work of rewriting elife editors json
def rewrite_elife_editors_json(json_content, doi): """ this does the work of rewriting elife editors json """ # Remove affiliations with no name value for i, ref in enumerate(json_content): if ref.get("affiliations"): for aff in ref.get("affiliations"): if "name" not in ...
this does the work of rewriting elife editors json def rewrite_elife_editors_json(json_content, doi): """ this does the work of rewriting elife editors json """ # Remove affiliations with no name value for i, ref in enumerate(json_content): if ref.get("affiliations"): for aff in ref.ge...
3,916
50
12,772
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
50c0e0978db381659d531499fbd3344c397ad0545546d3280a30c30c4858309c
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
72fa8247cb6df9e110f7324e
elifesciences/elife-tools
elifetools/json_rewrite.py
person_same_name_map
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L1172-L1185
train
python
to merge multiple editors into one record, filter by role values and group by name
def person_same_name_map(json_content, role_from): "to merge multiple editors into one record, filter by role values and group by name" matched_editors = [(i, person) for i, person in enumerate(json_content) if person.get('role') in role_from] same_name_map = {} for i, editor in m...
to merge multiple editors into one record, filter by role values and group by name def person_same_name_map(json_content, role_from): "to merge multiple editors into one record, filter by role values and group by name" matched_editors = [(i, person) for i, person in enumerate(json_content) ...
154
82
607
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
70f5e3de1aa0769166c424be2e030ec13bba6db03981ba30b0133d30f31cd186
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
45169b4758dcd58eb6c3222c
elifesciences/elife-tools
elifetools/json_rewrite.py
rewrite_elife_title_prefix_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/json_rewrite.py#L1188-L1364
train
python
this does the work of rewriting elife title prefix json values
def rewrite_elife_title_prefix_json(json_content, doi): """ this does the work of rewriting elife title prefix json values""" if not json_content: return json_content # title prefix rewrites by article DOI title_prefix_values = {} title_prefix_values["10.7554/eLife.00452"] = "Point of View"...
this does the work of rewriting elife title prefix json values def rewrite_elife_title_prefix_json(json_content, doi): """ this does the work of rewriting elife title prefix json values""" if not json_content: return json_content # title prefix rewrites by article DOI title_prefix_values = {} ...
3,637
62
12,045
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
32f9409b3d09e06e178059f4ebde04dcd151ad29a76610e0933484ac616c5e5a
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
614b73c971244962809c6171
elifesciences/elife-tools
elifetools/parseJATS.py
title_prefix
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L37-L45
train
python
titlePrefix for article JSON is only articles with certain display_channel values
def title_prefix(soup): "titlePrefix for article JSON is only articles with certain display_channel values" prefix = None display_channel_match_list = ['feature article', 'insight', 'editorial'] for d_channel in display_channel(soup): if d_channel.lower() in display_channel_match_list: ...
titlePrefix for article JSON is only articles with certain display_channel values def title_prefix(soup): "titlePrefix for article JSON is only articles with certain display_channel values" prefix = None display_channel_match_list = ['feature article', 'insight', 'editorial'] for d_channel in display_c...
108
81
461
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
b500c15e6b4acc2b079cfc99fb3f04d4a251e3f3929f9431ad809dadec12c64e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
839d9865e4a92c76a78ebfe5
elifesciences/elife-tools
elifetools/parseJATS.py
title_prefix_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L47-L51
train
python
titlePrefix with capitalisation changed
def title_prefix_json(soup): "titlePrefix with capitalisation changed" prefix = title_prefix(soup) prefix_rewritten = elifetools.json_rewrite.rewrite_json("title_prefix_json", soup, prefix) return prefix_rewritten
titlePrefix with capitalisation changed def title_prefix_json(soup): "titlePrefix with capitalisation changed" prefix = title_prefix(soup) prefix_rewritten = elifetools.json_rewrite.rewrite_json("title_prefix_json", soup, prefix) return prefix_rewritten
58
39
229
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
e313c1b37ea126045a11c60b0c52e6be08506f6c4e1dbc4e4ce2dc7f556ddc32
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
71bfb18194c7a61dd15e55a0
elifesciences/elife-tools
elifetools/parseJATS.py
research_organism
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L86-L90
train
python
Find the research-organism from the set of kwd-group tags
def research_organism(soup): "Find the research-organism from the set of kwd-group tags" if not raw_parser.research_organism_keywords(soup): return [] return list(map(node_text, raw_parser.research_organism_keywords(soup)))
Find the research-organism from the set of kwd-group tags def research_organism(soup): "Find the research-organism from the set of kwd-group tags" if not raw_parser.research_organism_keywords(soup): return [] return list(map(node_text, raw_parser.research_organism_keywords(soup)))
75
57
243
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
f9b878dce9f7301853f0929f873d8de2dd476f7569e574bc713f00c59a8d5576
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b8620912a9b27d4c6c685fb6
elifesciences/elife-tools
elifetools/parseJATS.py
full_research_organism
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L92-L96
train
python
research-organism list including inline tags, such as italic
def full_research_organism(soup): "research-organism list including inline tags, such as italic" if not raw_parser.research_organism_keywords(soup): return [] return list(map(node_contents_str, raw_parser.research_organism_keywords(soup)))
research-organism list including inline tags, such as italic def full_research_organism(soup): "research-organism list including inline tags, such as italic" if not raw_parser.research_organism_keywords(soup): return [] return list(map(node_contents_str, raw_parser.research_organism_keywords(soup))...
74
60
259
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d99b614b38deb536650fa6ced816a2cb2ca573b039b7693074de2caa2e4c731c
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
28fce0cb162e6e0cde916589
elifesciences/elife-tools
elifetools/parseJATS.py
keywords
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L98-L105
train
python
Find the keywords from the set of kwd-group tags which are typically labelled as the author keywords
def keywords(soup): """ Find the keywords from the set of kwd-group tags which are typically labelled as the author keywords """ if not raw_parser.author_keywords(soup): return [] return list(map(node_text, raw_parser.author_keywords(soup)))
Find the keywords from the set of kwd-group tags which are typically labelled as the author keywords def keywords(soup): """ Find the keywords from the set of kwd-group tags which are typically labelled as the author keywords """ if not raw_parser.author_keywords(soup): return [] re...
81
104
273
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
a2b6edecbe09754911b99cbdbdab5d2fd91c41436558de2ce0822ed9e26e41d7
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
d4a5da81b056a1688bf1caf7
elifesciences/elife-tools
elifetools/parseJATS.py
full_keywords
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L107-L111
train
python
author keywords list including inline tags, such as italic
def full_keywords(soup): "author keywords list including inline tags, such as italic" if not raw_parser.author_keywords(soup): return [] return list(map(node_contents_str, raw_parser.author_keywords(soup)))
author keywords list including inline tags, such as italic def full_keywords(soup): "author keywords list including inline tags, such as italic" if not raw_parser.author_keywords(soup): return [] return list(map(node_contents_str, raw_parser.author_keywords(soup)))
58
58
226
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
8a9c5d27f44407183190d358eedd74173fc7e20b88d2c9afd6f68a899f463f3a
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
68689e8fce185148b6991ad2
elifesciences/elife-tools
elifetools/parseJATS.py
version_history
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L131-L150
train
python
extract the article version history details
def version_history(soup, html_flag=True): "extract the article version history details" convert = lambda xml_string: xml_to_html(html_flag, xml_string) version_history = [] related_object_tags = raw_parser.related_object(raw_parser.article_meta(soup)) for tag in related_object_tags: article...
extract the article version history details def version_history(soup, html_flag=True): "extract the article version history details" convert = lambda xml_string: xml_to_html(html_flag, xml_string) version_history = [] related_object_tags = raw_parser.related_object(raw_parser.article_meta(soup)) fo...
217
43
1,027
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
6e160f50b878b3750fc44ccce2bfaea81faeee9c368ed7f8b6def87e31164a4e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
cf0ff4c8a221df0a49047d9f
elifesciences/elife-tools
elifetools/parseJATS.py
article_id_list
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L163-L172
train
python
return a list of article-id data
def article_id_list(soup): """return a list of article-id data""" id_list = [] for article_id_tag in raw_parser.article_id(soup): id_details = OrderedDict() set_if_value(id_details, "type", article_id_tag.get("pub-id-type")) set_if_value(id_details, "value", article_id_tag.text) ...
return a list of article-id data def article_id_list(soup): """return a list of article-id data""" id_list = [] for article_id_tag in raw_parser.article_id(soup): id_details = OrderedDict() set_if_value(id_details, "type", article_id_tag.get("pub-id-type")) set_if_value(id_details, ...
117
32
468
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
babe681ff2e231929bae047f179ab457ca125af9b803bae6b7051a2e1e36523e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3a762f8a251569479cbf0329
elifesciences/elife-tools
elifetools/parseJATS.py
copyright_holder_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L241-L249
train
python
for json output add a full stop if ends in et al
def copyright_holder_json(soup): "for json output add a full stop if ends in et al" holder = None permissions_tag = raw_parser.article_permissions(soup) if permissions_tag: holder = node_text(raw_parser.copyright_holder(permissions_tag)) if holder is not None and holder.endswith('et al'): ...
for json output add a full stop if ends in et al def copyright_holder_json(soup): "for json output add a full stop if ends in et al" holder = None permissions_tag = raw_parser.article_permissions(soup) if permissions_tag: holder = node_text(raw_parser.copyright_holder(permissions_tag)) if h...
93
48
365
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d969dcd1545408b1913b010d6e518638e4231866aa5d52027ea7893de28dd90f
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3703bc0f23152625e6629cf9
elifesciences/elife-tools
elifetools/parseJATS.py
subject_area
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L298-L308
train
python
Find the subject areas from article-categories subject tags
def subject_area(soup): """ Find the subject areas from article-categories subject tags """ subject_area = [] tags = raw_parser.subject_area(soup) for tag in tags: subject_area.append(node_text(tag)) return subject_area
Find the subject areas from article-categories subject tags def subject_area(soup): """ Find the subject areas from article-categories subject tags """ subject_area = [] tags = raw_parser.subject_area(soup) for tag in tags: subject_area.append(node_text(tag)) return subject_area
64
59
257
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
6d6bad3fe0160046e3b9ac7dbf5c1540b815ed47de9dc019bade3ded1404a908
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3f498860831bb0e77dd39b12
elifesciences/elife-tools
elifetools/parseJATS.py
display_channel
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L321-L331
train
python
Find the subject areas of type display-channel
def display_channel(soup): """ Find the subject areas of type display-channel """ display_channel = [] tags = raw_parser.display_channel(soup) for tag in tags: display_channel.append(node_text(tag)) return display_channel
Find the subject areas of type display-channel def display_channel(soup): """ Find the subject areas of type display-channel """ display_channel = [] tags = raw_parser.display_channel(soup) for tag in tags: display_channel.append(node_text(tag)) return display_channel
62
46
259
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
851c724ed0df097af48d2f98f28aa19d15b769f5dcd2295231daf6f930c8abec
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b5f3130e5aaab44842579d02
elifesciences/elife-tools
elifetools/parseJATS.py
category
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L333-L343
train
python
Find the category from subject areas
def category(soup): """ Find the category from subject areas """ category = [] tags = raw_parser.category(soup) for tag in tags: category.append(node_text(tag)) return category
Find the category from subject areas def category(soup): """ Find the category from subject areas """ category = [] tags = raw_parser.category(soup) for tag in tags: category.append(node_text(tag)) return category
53
36
214
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
2dc0ddf6909869c8c873e82adcb0e9a231a1a191607865f04d4ba300aaceca00
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f3c86c699d3a3d5f647524d5
elifesciences/elife-tools
elifetools/parseJATS.py
ymd
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L345-L352
train
python
Get the year, month and day from child tags
def ymd(soup): """ Get the year, month and day from child tags """ day = node_text(raw_parser.day(soup)) month = node_text(raw_parser.month(soup)) year = node_text(raw_parser.year(soup)) return (day, month, year)
Get the year, month and day from child tags def ymd(soup): """ Get the year, month and day from child tags """ day = node_text(raw_parser.day(soup)) month = node_text(raw_parser.month(soup)) year = node_text(raw_parser.year(soup)) return (day, month, year)
75
43
240
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ea784981161a722fde5ff9514934013aa8066991a5e439f3a0f7263e2e3d862c
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
889c5eda82cd9f9c13486813
elifesciences/elife-tools
elifetools/parseJATS.py
pub_date
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L354-L366
train
python
Return the publishing date in struct format pub_date_date, pub_date_day, pub_date_month, pub_date_year, pub_date_timestamp Default date_type is pub
def pub_date(soup): """ Return the publishing date in struct format pub_date_date, pub_date_day, pub_date_month, pub_date_year, pub_date_timestamp Default date_type is pub """ pub_date = first(raw_parser.pub_date(soup, date_type="pub")) if pub_date is None: pub_date = first(raw_parse...
Return the publishing date in struct format pub_date_date, pub_date_day, pub_date_month, pub_date_year, pub_date_timestamp Default date_type is pub def pub_date(soup): """ Return the publishing date in struct format pub_date_date, pub_date_day, pub_date_month, pub_date_year, pub_date_timestamp ...
159
155
487
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
6219d81315bd6a10a641941a4eac75a395bfff4ced780bb14f11d12bc84703b2
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
c029dc4ef38e746ef4d5e7a2
elifesciences/elife-tools
elifetools/parseJATS.py
pub_dates
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L368-L387
train
python
return a list of all the pub dates
def pub_dates(soup): """ return a list of all the pub dates """ pub_dates = [] tags = raw_parser.pub_date(soup) for tag in tags: pub_date = OrderedDict() copy_attribute(tag.attrs, 'publication-format', pub_date) copy_attribute(tag.attrs, 'date-type', pub_date) cop...
return a list of all the pub dates def pub_dates(soup): """ return a list of all the pub dates """ pub_dates = [] tags = raw_parser.pub_date(soup) for tag in tags: pub_date = OrderedDict() copy_attribute(tag.attrs, 'publication-format', pub_date) copy_attribute(tag.attrs...
183
34
743
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
02b84643b7a9d56a809f8f3b632bafa19eeda2fbdc365dd7bc12835d4bf51041
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
7d1e4913ccd8ae231336e62c
elifesciences/elife-tools
elifetools/parseJATS.py
history_date
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L389-L401
train
python
Find a date in the history tag for the specific date_type typical date_type values: received, accepted
def history_date(soup, date_type = None): """ Find a date in the history tag for the specific date_type typical date_type values: received, accepted """ if(date_type == None): return None history_date = raw_parser.history_date(soup, date_type) if history_date is None: return...
Find a date in the history tag for the specific date_type typical date_type values: received, accepted def history_date(soup, date_type = None): """ Find a date in the history tag for the specific date_type typical date_type values: received, accepted """ if(date_type == None): return N...
122
106
409
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
382540765935a480d85432932322766ee2c2433584caa7003bb8c854f40cd52e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
8d64800eb87e7fd58b0c6000
elifesciences/elife-tools
elifetools/parseJATS.py
collection_year
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L493-L508
train
python
Pub date of type collection will hold a year element for VOR articles
def collection_year(soup): """ Pub date of type collection will hold a year element for VOR articles """ pub_date = first(raw_parser.pub_date(soup, pub_type="collection")) if not pub_date: pub_date = first(raw_parser.pub_date(soup, date_type="collection")) if not pub_date: return...
Pub date of type collection will hold a year element for VOR articles def collection_year(soup): """ Pub date of type collection will hold a year element for VOR articles """ pub_date = first(raw_parser.pub_date(soup, pub_type="collection")) if not pub_date: pub_date = first(raw_parser.pub_...
123
69
457
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
a1b96dbaea445cf716e634a25c6da8e4ed1115df0747955fa4d251793343a552
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
54f13607eedd9d0e7a2300d8
elifesciences/elife-tools
elifetools/parseJATS.py
abstracts
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L520-L557
train
python
Find the article abstract and format it
def abstracts(soup): """ Find the article abstract and format it """ abstracts = [] abstract_tags = raw_parser.abstract(soup) for tag in abstract_tags: abstract = {} abstract["abstract_type"] = tag.get("abstract-type") title_tag = raw_parser.title(tag) if titl...
Find the article abstract and format it def abstracts(soup): """ Find the article abstract and format it """ abstracts = [] abstract_tags = raw_parser.abstract(soup) for tag in abstract_tags: abstract = {} abstract["abstract_type"] = tag.get("abstract-type") title_ta...
240
39
1,097
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
6aff0a44dd798e3e5c94cf8a796d1e4bb3b539a22af08b803dc78b34c762a987
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
70d1f0ce75025b029916f59f
elifesciences/elife-tools
elifetools/parseJATS.py
component_doi
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L648-L675
train
python
Look for all object-id of pub-type-id = doi, these are the component DOI tags
def component_doi(soup): """ Look for all object-id of pub-type-id = doi, these are the component DOI tags """ component_doi = [] object_id_tags = raw_parser.object_id(soup, pub_id_type = "doi") # Get components too for later component_list = components(soup) position = 1 for tag...
Look for all object-id of pub-type-id = doi, these are the component DOI tags def component_doi(soup): """ Look for all object-id of pub-type-id = doi, these are the component DOI tags """ component_doi = [] object_id_tags = raw_parser.object_id(soup, pub_id_type = "doi") # Get components too...
201
77
813
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
1ed530374680c7a4d2f14c703fb4989b6663aed95249702c5428390bf46ebb45
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
4efef5b73569ed9db5557873
elifesciences/elife-tools
elifetools/parseJATS.py
tag_details
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L726-L747
train
python
Used in media and graphics to extract data from their parent tags
def tag_details(tag, nodenames): """ Used in media and graphics to extract data from their parent tags """ details = {} details['type'] = tag.name details['ordinal'] = tag_ordinal(tag) # Ordinal value if tag_details_sibling_ordinal(tag): details['sibling_ordinal'] = tag_details...
Used in media and graphics to extract data from their parent tags def tag_details(tag, nodenames): """ Used in media and graphics to extract data from their parent tags """ details = {} details['type'] = tag.name details['ordinal'] = tag_ordinal(tag) # Ordinal value if tag_details_sib...
162
65
629
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
02024e61c0e9859771428b2aaf19d23d051147b663971e7fd90f446fb1cd7950
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
9e7c646a235ec9c8918e2e4f
elifesciences/elife-tools
elifetools/parseJATS.py
media
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L750-L821
train
python
All media tags and some associated data about the related component doi and the parent of that doi (not always present)
def media(soup): """ All media tags and some associated data about the related component doi and the parent of that doi (not always present) """ media = [] media_tags = raw_parser.media(soup) position = 1 for tag in media_tags: media_item = {} copy_attribute(tag.attrs...
All media tags and some associated data about the related component doi and the parent of that doi (not always present) def media(soup): """ All media tags and some associated data about the related component doi and the parent of that doi (not always present) """ media = [] media_tags = r...
758
123
3,538
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
9a72235842be6140939db672503cb320d08f7028d8fd71bc9401a9a6c3c1fa35
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
a253cdffe1b88614fb9b9ba6
elifesciences/elife-tools
elifetools/parseJATS.py
graphics
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L824-L877
train
python
All graphic tags and some associated data about the related component doi and the parent of that doi (not always present), and whether it is part of a figure supplement
def graphics(soup): """ All graphic tags and some associated data about the related component doi and the parent of that doi (not always present), and whether it is part of a figure supplement """ graphics = [] graphic_tags = raw_parser.graphic(soup) position = 1 for tag in graphi...
All graphic tags and some associated data about the related component doi and the parent of that doi (not always present), and whether it is part of a figure supplement def graphics(soup): """ All graphic tags and some associated data about the related component doi and the parent of that doi (not ...
529
176
2,343
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
15ce64a943366ac0b9029a470a2d3728e0a5c542fccab2f7f884fd38ed8bd31c
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f7aa0237bf2d12ae149646e2
elifesciences/elife-tools
elifetools/parseJATS.py
inline_graphics
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L879-L906
train
python
inline-graphic tags
def inline_graphics(soup): """ inline-graphic tags """ inline_graphics = [] inline_graphic_tags = raw_parser.inline_graphic(soup) position = 1 for tag in inline_graphic_tags: item = {} copy_attribute(tag.attrs, 'xlink:href', item, 'xlink_href') # Get the tag type...
inline-graphic tags def inline_graphics(soup): """ inline-graphic tags """ inline_graphics = [] inline_graphic_tags = raw_parser.inline_graphic(soup) position = 1 for tag in inline_graphic_tags: item = {} copy_attribute(tag.attrs, 'xlink:href', item, 'xlink_href') ...
165
19
707
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
5efb4a2282fbce6261a37ef2d4042d18c5084dadcd321647e6bf17c237a0e1d9
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
0b20c8704981973a68d49929
elifesciences/elife-tools
elifetools/parseJATS.py
self_uri
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L908-L934
train
python
self-uri tags
def self_uri(soup): """ self-uri tags """ self_uri = [] self_uri_tags = raw_parser.self_uri(soup) position = 1 for tag in self_uri_tags: item = {} copy_attribute(tag.attrs, 'xlink:href', item, 'xlink_href') copy_attribute(tag.attrs, 'content-type', item) # ...
self-uri tags def self_uri(soup): """ self-uri tags """ self_uri = [] self_uri_tags = raw_parser.self_uri(soup) position = 1 for tag in self_uri_tags: item = {} copy_attribute(tag.attrs, 'xlink:href', item, 'xlink_href') copy_attribute(tag.attrs, 'content-type', it...
172
13
709
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
686adae733a147956b01751ae053eef99d653bf7ea056860e6de1c4fdca8b7eb
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
a75ed72fa4501861a00b989e
elifesciences/elife-tools
elifetools/parseJATS.py
supplementary_material
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L936-L970
train
python
supplementary-material tags
def supplementary_material(soup): """ supplementary-material tags """ supplementary_material = [] supplementary_material_tags = raw_parser.supplementary_material(soup) position = 1 for tag in supplementary_material_tags: item = {} copy_attribute(tag.attrs, 'id', item) ...
supplementary-material tags def supplementary_material(soup): """ supplementary-material tags """ supplementary_material = [] supplementary_material_tags = raw_parser.supplementary_material(soup) position = 1 for tag in supplementary_material_tags: item = {} copy_attribu...
226
27
1,085
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
75644f62484d3be3ec267be7938784e97bedb4d4f040d0895bde086a522d972b
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
c6d96211ed061d642f353009
elifesciences/elife-tools
elifetools/parseJATS.py
contrib_email
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L979-L988
train
python
Given a contrib tag, look for an email tag, and only return the value if it is not inside an aff tag
def contrib_email(contrib_tag): """ Given a contrib tag, look for an email tag, and only return the value if it is not inside an aff tag """ email = [] for email_tag in extract_nodes(contrib_tag, "email"): if email_tag.parent.name != "aff": email.append(email_tag.text) re...
Given a contrib tag, look for an email tag, and only return the value if it is not inside an aff tag def contrib_email(contrib_tag): """ Given a contrib tag, look for an email tag, and only return the value if it is not inside an aff tag """ email = [] for email_tag in extract_nodes(contrib...
113
104
358
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
23478c299dac06130e096d8abf04cf43f4d762441ed7ca732cf4c00f2079fe61
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
161eb682d47d14cc6f1de085
elifesciences/elife-tools
elifetools/parseJATS.py
contrib_phone
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L990-L997
train
python
Given a contrib tag, look for an phone tag
def contrib_phone(contrib_tag): """ Given a contrib tag, look for an phone tag """ phone = None if raw_parser.phone(contrib_tag): phone = first(raw_parser.phone(contrib_tag)).text return phone
Given a contrib tag, look for an phone tag def contrib_phone(contrib_tag): """ Given a contrib tag, look for an phone tag """ phone = None if raw_parser.phone(contrib_tag): phone = first(raw_parser.phone(contrib_tag)).text return phone
64
42
224
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
22efde15144a28231e1bdb5d901bc27ce84a125dfc99048880e9fbec40770831
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
64340f0aa108056cae93f830
elifesciences/elife-tools
elifetools/parseJATS.py
contrib_inline_aff
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L999-L1007
train
python
Given a contrib tag, look for an aff tag directly inside it
def contrib_inline_aff(contrib_tag): """ Given a contrib tag, look for an aff tag directly inside it """ aff_tags = [] for child_tag in contrib_tag: if child_tag and child_tag.name and child_tag.name == "aff": aff_tags.append(child_tag) return aff_tags
Given a contrib tag, look for an aff tag directly inside it def contrib_inline_aff(contrib_tag): """ Given a contrib tag, look for an aff tag directly inside it """ aff_tags = [] for child_tag in contrib_tag: if child_tag and child_tag.name and child_tag.name == "aff": aff_tags....
81
59
296
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ee3d7198615a05b80781ff4766f4763ddff9e7d2c05d1d1695e6e8234cb10d65
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
6596008f5fc06e784a50c443
elifesciences/elife-tools
elifetools/parseJATS.py
contrib_xref
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1009-L1018
train
python
Given a contrib tag, look for an xref tag of type ref_type directly inside the contrib tag
def contrib_xref(contrib_tag, ref_type): """ Given a contrib tag, look for an xref tag of type ref_type directly inside the contrib tag """ aff_tags = [] for child_tag in contrib_tag: if (child_tag and child_tag.name and child_tag.name == "xref" and child_tag.get('ref-type') and ...
Given a contrib tag, look for an xref tag of type ref_type directly inside the contrib tag def contrib_xref(contrib_tag, ref_type): """ Given a contrib tag, look for an xref tag of type ref_type directly inside the contrib tag """ aff_tags = [] for child_tag in contrib_tag: if (child_tag an...
121
90
418
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
386ccc3d2314690d3ac36b4fe0a32775bad5c6ff6b95e58c2830256d387b9f38
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
cc1d77a128a1ff13689720d0
elifesciences/elife-tools
elifetools/parseJATS.py
all_contributors
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1205-L1209
train
python
find all contributors not contrained to only the ones in article meta
def all_contributors(soup, detail="brief"): "find all contributors not contrained to only the ones in article meta" contrib_tags = raw_parser.contributors(soup) contributors = format_authors(soup, contrib_tags, detail) return contributors
find all contributors not contrained to only the ones in article meta def all_contributors(soup, detail="brief"): "find all contributors not contrained to only the ones in article meta" contrib_tags = raw_parser.contributors(soup) contributors = format_authors(soup, contrib_tags, detail) return contrib...
69
69
254
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
85aab8342064256539465df86c31d9c1f1d359b662876dd411cdedc9e29389fc
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
98b5ea00df896788f517dcc2
elifesciences/elife-tools
elifetools/parseJATS.py
authors_non_byline
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1222-L1234
train
python
Non-byline authors for group author members
def authors_non_byline(soup, detail="full"): """Non-byline authors for group author members""" # Get a filtered list of contributors, in order to get their group-author-id contrib_type = "author non-byline" contributors_ = contributors(soup, detail) non_byline_authors = [author for author in contrib...
Non-byline authors for group author members def authors_non_byline(soup, detail="full"): """Non-byline authors for group author members""" # Get a filtered list of contributors, in order to get their group-author-id contrib_type = "author non-byline" contributors_ = contributors(soup, detail) non_b...
144
43
572
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
32459b7cb97abfaa4e2b885f3b8db4dd0aad919d9f6abe58c72bf19cb8bf66ba
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e4a262f0328daa17469f5179
elifesciences/elife-tools
elifetools/parseJATS.py
refs
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1340-L1484
train
python
Find and return all the references
def refs(soup): """Find and return all the references""" tags = raw_parser.ref_list(soup) refs = [] position = 1 article_doi = doi(soup) for tag in tags: ref = {} ref['ref'] = ref_text(tag) # ref_id copy_attribute(tag.attrs, "id", ref) # article_title...
Find and return all the references def refs(soup): """Find and return all the references""" tags = raw_parser.ref_list(soup) refs = [] position = 1 article_doi = doi(soup) for tag in tags: ref = {} ref['ref'] = ref_text(tag) # ref_id copy_attribute(tag.attrs,...
1,500
34
6,701
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d0fe81f71666abde2093a0e3c2e6309d4ce8ee55418dff43a9e2007ca7f6788b
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e688b7d41e1090fb4e0ecdce
elifesciences/elife-tools
elifetools/parseJATS.py
extract_component_doi
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1486-L1507
train
python
Used to get component DOI from a tag and confirm it is actually for that tag and it is not for one of its children in the list of nodenames
def extract_component_doi(tag, nodenames): """ Used to get component DOI from a tag and confirm it is actually for that tag and it is not for one of its children in the list of nodenames """ component_doi = None if(tag.name == "sub-article"): component_doi = doi_uri_to_doi(node_text(fir...
Used to get component DOI from a tag and confirm it is actually for that tag and it is not for one of its children in the list of nodenames def extract_component_doi(tag, nodenames): """ Used to get component DOI from a tag and confirm it is actually for that tag and it is not for one of its children i...
285
143
1,067
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
22a7a86f93adcf6d67565256401416c7994da78b570f4dcb6178ce2d40c19f5f
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
01b01786158265fd1e4a6037
elifesciences/elife-tools
elifetools/parseJATS.py
components
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1509-L1695
train
python
Find the components, i.e. those parts that would be assigned a unique component DOI, such as figures, tables, etc. - position is in what order the tag appears in the entire set of nodes - ordinal is in what order it is for all the tags of its own type
def components(soup): """ Find the components, i.e. those parts that would be assigned a unique component DOI, such as figures, tables, etc. - position is in what order the tag appears in the entire set of nodes - ordinal is in what order it is for all the tags of its own type """ components...
Find the components, i.e. those parts that would be assigned a unique component DOI, such as figures, tables, etc. - position is in what order the tag appears in the entire set of nodes - ordinal is in what order it is for all the tags of its own type def components(soup): """ Find the components, ...
1,659
263
8,085
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
67087356497ddc59af11b0431bf642f77882608dd006ccc372b0cf82a2f32470
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e41522ae036621d01917967b
elifesciences/elife-tools
elifetools/parseJATS.py
correspondence
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1699-L1713
train
python
Find the corresp tags included in author-notes for primary correspondence
def correspondence(soup): """ Find the corresp tags included in author-notes for primary correspondence """ correspondence = [] author_notes_nodes = raw_parser.author_notes(soup) if author_notes_nodes: corresp_nodes = raw_parser.corresp(author_notes_nodes) for tag in corres...
Find the corresp tags included in author-notes for primary correspondence def correspondence(soup): """ Find the corresp tags included in author-notes for primary correspondence """ correspondence = [] author_notes_nodes = raw_parser.author_notes(soup) if author_notes_nodes: c...
92
77
399
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
a584d3c28b2b359c1d1194f41339297278034514d62ce42f4e18fbc00bd0565d
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
c97b91bc2d8b36db8a7ae8b3
elifesciences/elife-tools
elifetools/parseJATS.py
author_notes
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1740-L1754
train
python
Find the fn tags included in author-notes
def author_notes(soup): """ Find the fn tags included in author-notes """ author_notes = [] author_notes_section = raw_parser.author_notes(soup) if author_notes_section: fn_nodes = raw_parser.fn(author_notes_section) for tag in fn_nodes: if 'fn-type' in tag.attrs: ...
Find the fn tags included in author-notes def author_notes(soup): """ Find the fn tags included in author-notes """ author_notes = [] author_notes_section = raw_parser.author_notes(soup) if author_notes_section: fn_nodes = raw_parser.fn(author_notes_section) for tag in fn_nodes...
104
41
455
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
349c0be0651ac0dedb6ae4be4c349d19054b70a96c33c845cb24e18fca5f6989
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
acf98a8032b332ac40a142a4
elifesciences/elife-tools
elifetools/parseJATS.py
full_author_notes
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1757-L1768
train
python
Find the fn tags included in author-notes
def full_author_notes(soup, fntype_filter=None): """ Find the fn tags included in author-notes """ notes = [] author_notes_section = raw_parser.author_notes(soup) if author_notes_section: fn_nodes = raw_parser.fn(author_notes_section) notes = footnotes(fn_nodes, fntype_filter) ...
Find the fn tags included in author-notes def full_author_notes(soup, fntype_filter=None): """ Find the fn tags included in author-notes """ notes = [] author_notes_section = raw_parser.author_notes(soup) if author_notes_section: fn_nodes = raw_parser.fn(author_notes_section) n...
85
41
336
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
6c96ed57bfb65a4f86216d5297640177e7510027c73932bfe45725cd54dbb180
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
13aff13707f545e7ccf98c73
elifesciences/elife-tools
elifetools/parseJATS.py
competing_interests
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1771-L1782
train
python
Find the fn tags included in the competing interest
def competing_interests(soup, fntype_filter): """ Find the fn tags included in the competing interest """ competing_interests_section = extract_nodes(soup, "fn-group", attr="content-type", value="competing-interest") if not competing_interests_section: return None fn = extract_nodes(fir...
Find the fn tags included in the competing interest def competing_interests(soup, fntype_filter): """ Find the fn tags included in the competing interest """ competing_interests_section = extract_nodes(soup, "fn-group", attr="content-type", value="competing-interest") if not competing_interests_se...
105
51
425
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ba37404e57bae292a608b58de919d9da220719aa16aa3e474c07e86cd069fcc1
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
dcf46ffaf1e3215c7b5e495c
elifesciences/elife-tools
elifetools/parseJATS.py
author_contributions
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1806-L1817
train
python
Find the fn tags included in the competing interest
def author_contributions(soup, fntype_filter): """ Find the fn tags included in the competing interest """ author_contributions_section = extract_nodes(soup, "fn-group", attr="content-type", value="author-contribution") if not author_contributions_section: return None fn = extract_nodes...
Find the fn tags included in the competing interest def author_contributions(soup, fntype_filter): """ Find the fn tags included in the competing interest """ author_contributions_section = extract_nodes(soup, "fn-group", attr="content-type", value="author-contribution") if not author_contribution...
104
51
420
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
babaa072a3a6aa7da5d372878cfcd06e3879bbd42c286ed0ab27fa58fd3c7108
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
18108ba020b5c209b6e54b58
elifesciences/elife-tools
elifetools/parseJATS.py
full_award_groups
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1836-L1871
train
python
Find the award-group items and return a list of details
def full_award_groups(soup): """ Find the award-group items and return a list of details """ award_groups = [] funding_group_section = extract_nodes(soup, "funding-group") # counter for auto generated id values, if required generated_id_counter = 1 for fg in funding_group_section: ...
Find the award-group items and return a list of details def full_award_groups(soup): """ Find the award-group items and return a list of details """ award_groups = [] funding_group_section = extract_nodes(soup, "funding-group") # counter for auto generated id values, if required generated_...
310
55
1,430
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
5912759fb2818ee7b576594907ba13466fc80513c9088ac0ef23b0efa8618d24
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
ed86e9226ffaf53a2139e698
elifesciences/elife-tools
elifetools/parseJATS.py
award_groups
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1875-L1896
train
python
Find the award-group items and return a list of details
def award_groups(soup): """ Find the award-group items and return a list of details """ award_groups = [] funding_group_section = extract_nodes(soup, "funding-group") for fg in funding_group_section: award_group_tags = extract_nodes(fg, "award-group") for ag in award_group_tag...
Find the award-group items and return a list of details def award_groups(soup): """ Find the award-group items and return a list of details """ award_groups = [] funding_group_section = extract_nodes(soup, "funding-group") for fg in funding_group_section: award_group_tags = extract_no...
149
55
643
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
f79f5a73c47f667665cd590e26f4f2916593634a9cb4b8be7431af12989eeb27
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
c6ab943f61cff95cf379988a
elifesciences/elife-tools
elifetools/parseJATS.py
award_group_funding_source
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1900-L1910
train
python
Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section
def award_group_funding_source(tag): """ Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section """ award_group_funding_source = [] funding_source_tags = extract_nodes(tag, "funding-source") for t in funding_source_tag...
Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section def award_group_funding_source(tag): """ Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section ...
118
132
410
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
2bec703b75d4b33347e58fe55ba884b6b2d30561316fb59e7c6a8fcd88fb91e8
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
d590b68dbb0e6335c8694830
elifesciences/elife-tools
elifetools/parseJATS.py
full_award_group_funding_source
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1913-L1942
train
python
Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section
def full_award_group_funding_source(tag): """ Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section """ award_group_funding_sources = [] funding_source_nodes = extract_nodes(tag, "funding-source") for funding_source_n...
Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section def full_award_group_funding_source(tag): """ Given a funding group element Find the award group funding sources, one for each item found in the get_funding_group section...
290
132
1,344
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
4e67f762c96580811945eb317928dda7dde0a1b1f666a6088897e5fd30425b27
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
68e3e84165b21c91f8c9f65e
elifesciences/elife-tools
elifetools/parseJATS.py
award_group_award_id
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1946-L1955
train
python
Find the award group award id, one for each item found in the get_funding_group section
def award_group_award_id(tag): """ Find the award group award id, one for each item found in the get_funding_group section """ award_group_award_id = [] award_id_tags = extract_nodes(tag, "award-id") for t in award_id_tags: award_group_award_id.append(t.text) return award_group_a...
Find the award group award id, one for each item found in the get_funding_group section def award_group_award_id(tag): """ Find the award group award id, one for each item found in the get_funding_group section """ award_group_award_id = [] award_id_tags = extract_nodes(tag, "award-id") ...
103
91
327
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
8f6478145fc56f6a14fe515521e9a1bbde272cf2e71d753591d79cc4fd267ef9
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
fed8c04acd4eb36e8c8b82ae
elifesciences/elife-tools
elifetools/parseJATS.py
award_group_principal_award_recipient
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1958-L1987
train
python
Find the award group principal award recipient, one for each item found in the get_funding_group section
def award_group_principal_award_recipient(tag): """ Find the award group principal award recipient, one for each item found in the get_funding_group section """ award_group_principal_award_recipient = [] principal_award_recipients = extract_nodes(tag, "principal-award-recipient") for t in p...
Find the award group principal award recipient, one for each item found in the get_funding_group section def award_group_principal_award_recipient(tag): """ Find the award group principal award recipient, one for each item found in the get_funding_group section """ award_group_principal_award_r...
296
108
1,332
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
bdceaf15a37cba957363f73db86337dbc308c298b96ce584f830c54164fbb51c
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3d8d43cc8a9e0f6e30f9c638
elifesciences/elife-tools
elifetools/parseJATS.py
object_id_doi
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L1989-L2000
train
python
DOI in an object-id tag found inside the tag
def object_id_doi(tag, parent_tag_name=None): """DOI in an object-id tag found inside the tag""" doi = None object_id = None object_ids = raw_parser.object_id(tag, "doi") if object_ids: object_id = first([id_ for id_ in object_ids]) if parent_tag_name and object_id and object_id.parent.n...
DOI in an object-id tag found inside the tag def object_id_doi(tag, parent_tag_name=None): """DOI in an object-id tag found inside the tag""" doi = None object_id = None object_ids = raw_parser.object_id(tag, "doi") if object_ids: object_id = first([id_ for id_ in object_ids]) if parent...
121
44
444
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
f9ec913301da05c8fa114b4398666ae4bb15bd9e76c6a3d9b41abdeffe1be519
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
4039bfb2df36501eb2ae4306
elifesciences/elife-tools
elifetools/parseJATS.py
title_tag_inspected
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2002-L2021
train
python
Extract the title tag and sometimes inspect its parents
def title_tag_inspected(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False): """Extract the title tag and sometimes inspect its parents""" title_tag = None if direct_sibling_only is True: for sibling_tag in tag: if sibling_tag.name and sibling_tag.name == "titl...
Extract the title tag and sometimes inspect its parents def title_tag_inspected(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False): """Extract the title tag and sometimes inspect its parents""" title_tag = None if direct_sibling_only is True: for sibling_tag in tag: ...
166
55
750
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
0a5d75f212c9191bd7ed0bd443af2e0fd8e1b5d482934332c06a1ba5f51eb71d
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3b1647d79fd91dec080d204b
elifesciences/elife-tools
elifetools/parseJATS.py
title_text
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2023-L2031
train
python
Extract the text of a title tag and sometimes inspect its parents
def title_text(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False): """Extract the text of a title tag and sometimes inspect its parents""" title = None title_tag = title_tag_inspected(tag, parent_tag_name, p_parent_tag_name, direct_sibling_only) if title_tag: title =...
Extract the text of a title tag and sometimes inspect its parents def title_text(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False): """Extract the text of a title tag and sometimes inspect its parents""" title = None title_tag = title_tag_inspected(tag, parent_tag_name, p_paren...
94
65
366
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
7ef0f3ffe3c4fabf5282a06967579d6b0cf49f9e8e23517954fd728741ff86ce
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3713934ffb75ac755369b19a
elifesciences/elife-tools
elifetools/parseJATS.py
boxed_text_to_image_block
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2077-L2092
train
python
covert boxed-text to an image block containing an inline-graphic
def boxed_text_to_image_block(tag): "covert boxed-text to an image block containing an inline-graphic" tag_block = OrderedDict() image_content = body_block_image_content(first(raw_parser.inline_graphic(tag))) tag_block["type"] = "image" set_if_value(tag_block, "doi", doi_uri_to_doi(object_id_doi(tag...
covert boxed-text to an image block containing an inline-graphic def boxed_text_to_image_block(tag): "covert boxed-text to an image block containing an inline-graphic" tag_block = OrderedDict() image_content = body_block_image_content(first(raw_parser.inline_graphic(tag))) tag_block["type"] = "image" ...
191
64
750
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
b486fd5a601697438576fcfc354ee47000d00af39017a108304e3168ccf8b9ae
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
d9bd59dc888b5904840c44fb
elifesciences/elife-tools
elifetools/parseJATS.py
body_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2108-L2126
train
python
Get body json and then alter it with section wrapping and removing boxed-text
def body_json(soup, base_url=None): """ Get body json and then alter it with section wrapping and removing boxed-text """ body_content = body(soup, remove_key_info_box=True, base_url=base_url) # Wrap in a section if the first block is not a section if (body_content and len(body_content) > 0 and "type" i...
Get body json and then alter it with section wrapping and removing boxed-text def body_json(soup, base_url=None): """ Get body json and then alter it with section wrapping and removing boxed-text """ body_content = body(soup, remove_key_info_box=True, base_url=base_url) # Wrap in a section if the first blo...
238
77
953
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
3c661fde4ef0617c1836fe383f57ab76f43786332cf5c73cd338afec61637f81
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
245c55d07677e2a4044d79d4
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_content_render
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2175-L2232
train
python
Render the tag as body content and call recursively if the tag has child tags
def body_block_content_render(tag, recursive=False, base_url=None): """ Render the tag as body content and call recursively if the tag has child tags """ block_content_list = [] tag_content = OrderedDict() if tag.name == "p": for block_content in body_block_paragraph_render(tag, bas...
Render the tag as body content and call recursively if the tag has child tags def body_block_content_render(tag, recursive=False, base_url=None): """ Render the tag as body content and call recursively if the tag has child tags """ block_content_list = [] tag_content = OrderedDict() if...
505
81
2,405
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
7d00433c5b111f0ce3d2a283791f929d53f72800e4845d2959b2166dfb4f5032
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
2d1fc9506d09d30d57b97f15
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_paragraph_render
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2234-L2271
train
python
paragraphs may wrap some other body block content this is separated out so it can be called from more than one place
def body_block_paragraph_render(p_tag, html_flag=True, base_url=None): """ paragraphs may wrap some other body block content this is separated out so it can be called from more than one place """ # Configure the XML to HTML conversion preference for shorthand use below convert = lambda xml_strin...
paragraphs may wrap some other body block content this is separated out so it can be called from more than one place def body_block_paragraph_render(p_tag, html_flag=True, base_url=None): """ paragraphs may wrap some other body block content this is separated out so it can be called from more than one ...
321
120
1,522
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
63a38828b44f9bb17853ad60daecaa03183079622538d243f396d5a69176ebba
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
bf7774bbba2f7789c6111e89
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_caption_render
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2273-L2290
train
python
fig and media tag captions are similar so use this common function
def body_block_caption_render(caption_tags, base_url=None): """fig and media tag captions are similar so use this common function""" caption_content = [] supplementary_material_tags = [] for block_tag in remove_doi_paragraph(caption_tags): # Note then skip p tags with supplementary-material ins...
fig and media tag captions are similar so use this common function def body_block_caption_render(caption_tags, base_url=None): """fig and media tag captions are similar so use this common function""" caption_content = [] supplementary_material_tags = [] for block_tag in remove_doi_paragraph(caption_ta...
152
66
771
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ab27123d34978016963ccd6f1d7c73325952187d534fe14c98a274a6e9c91bd6
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f2255a032b70c49ac6bf6927
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_supplementary_material_render
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2292-L2301
train
python
fig and media tag caption may have supplementary material
def body_block_supplementary_material_render(supp_tags, base_url=None): """fig and media tag caption may have supplementary material""" source_data = [] for supp_tag in supp_tags: for block_content in body_block_content_render(supp_tag, base_url=base_url): if block_content != {}: ...
fig and media tag caption may have supplementary material def body_block_supplementary_material_render(supp_tags, base_url=None): """fig and media tag caption may have supplementary material""" source_data = [] for supp_tag in supp_tags: for block_content in body_block_content_render(supp_tag, base...
103
57
481
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
eb1fbdd7b3b5e03df93256dc3adf31bcc4e15e6195bd0591836c116ed65025c8
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
5322e4cdfb2956e47d270fe9
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_paragraph_content
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2303-L2309
train
python
for formatting of simple paragraphs of text only, and check if it is all whitespace
def body_block_paragraph_content(text): "for formatting of simple paragraphs of text only, and check if it is all whitespace" tag_content = OrderedDict() if text and text != '': tag_content["type"] = "paragraph" tag_content["text"] = clean_whitespace(text) return tag_content
for formatting of simple paragraphs of text only, and check if it is all whitespace def body_block_paragraph_content(text): "for formatting of simple paragraphs of text only, and check if it is all whitespace" tag_content = OrderedDict() if text and text != '': tag_content["type"] = "paragraph" ...
81
83
307
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ab8b2af8724ddcdfa24594131db8284fe3ed9a08e59afdf0d4a936d8e3544c4b
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
050d8ea055b6f82bb305fec5
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_image_content
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2311-L2319
train
python
format a graphic or inline-graphic into a body block json format
def body_block_image_content(tag): "format a graphic or inline-graphic into a body block json format" image_content = OrderedDict() if tag: copy_attribute(tag.attrs, 'xlink:href', image_content, 'uri') if "uri" in image_content: # todo!! alt set_if_value(image_content...
format a graphic or inline-graphic into a body block json format def body_block_image_content(tag): "format a graphic or inline-graphic into a body block json format" image_content = OrderedDict() if tag: copy_attribute(tag.attrs, 'xlink:href', image_content, 'uri') if "uri" in image_conten...
94
64
357
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
fe4899f313b29324b5c776768eda4896029d04d602d2511b014ff0efee3ed1c4
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b5a2502f71d5db1e35015a6c
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_title_label_caption
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2321-L2338
train
python
set the title, label and caption values in a consistent way set_caption: insert a "caption" field prefer_title: when only one value is available, set title rather than label. If False, set label rather than title
def body_block_title_label_caption(tag_content, title_value, label_value, caption_content, set_caption=True, prefer_title=False, prefer_label=False): """set the title, label and caption values in a consistent way set_caption: insert a "caption" field prefer_title: when on...
set the title, label and caption values in a consistent way set_caption: insert a "caption" field prefer_title: when only one value is available, set title rather than label. If False, set label rather than title def body_block_title_label_caption(tag_content, title_value, label_value, ...
272
221
1,034
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
e034aa36b90531daf0a42cdaacd1bf272751a2e3577f2ea87e792bed0a7f8bad
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
1e7e54ed9d03e59c22a694af
elifesciences/elife-tools
elifetools/parseJATS.py
body_block_attribution
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2340-L2360
train
python
extract the attribution content for figures, tables, videos
def body_block_attribution(tag): "extract the attribution content for figures, tables, videos" attributions = [] if raw_parser.attrib(tag): for attrib_tag in raw_parser.attrib(tag): attributions.append(node_contents_str(attrib_tag)) if raw_parser.permissions(tag): # concatena...
extract the attribution content for figures, tables, videos def body_block_attribution(tag): "extract the attribution content for figures, tables, videos" attributions = [] if raw_parser.attrib(tag): for attrib_tag in raw_parser.attrib(tag): attributions.append(node_contents_str(attrib_...
202
59
1,087
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
765b985d31fa87b9b57ba7131c9f4c76c70d06c09c84061ad4086604e887a5d1
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
0ab1f502b85c325748700e59
elifesciences/elife-tools
elifetools/parseJATS.py
body_blocks
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2655-L2681
train
python
Note: for some reason this works and few other attempted methods work Search for certain node types, find the first nodes siblings of the same type Add the first sibling and the other siblings to a list and return them
def body_blocks(soup): """ Note: for some reason this works and few other attempted methods work Search for certain node types, find the first nodes siblings of the same type Add the first sibling and the other siblings to a list and return them """ nodenames = body_block_nodenames() body_b...
Note: for some reason this works and few other attempted methods work Search for certain node types, find the first nodes siblings of the same type Add the first sibling and the other siblings to a list and return them def body_blocks(soup): """ Note: for some reason this works and few other attempted ...
214
226
778
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
97b5961a84c96f71cdb28bd1518d6148aac6d091cc733331b3fb617ce390f277
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
915235c4593e721cfb0ad5b8
elifesciences/elife-tools
elifetools/parseJATS.py
abstract_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2763-L2770
train
python
abstract in article json format
def abstract_json(soup): """abstract in article json format""" abstract_tags = raw_parser.abstract(soup) abstract_json = None for tag in abstract_tags: if tag.get("abstract-type") is None: abstract_json = render_abstract_json(tag) return abstract_json
abstract in article json format def abstract_json(soup): """abstract in article json format""" abstract_tags = raw_parser.abstract(soup) abstract_json = None for tag in abstract_tags: if tag.get("abstract-type") is None: abstract_json = render_abstract_json(tag) return abstract_...
67
31
291
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
ab540b44d70649be9f32ca361ee1dfcd4afc10ca4155c8dad662bda356327efd
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b14ff4ea3bc1999c2c57b83c
elifesciences/elife-tools
elifetools/parseJATS.py
digest_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2773-L2779
train
python
digest in article json format
def digest_json(soup): """digest in article json format""" abstract_tags = raw_parser.abstract(soup, abstract_type="executive-summary") abstract_json = None for tag in abstract_tags: abstract_json = render_abstract_json(tag) return abstract_json
digest in article json format def digest_json(soup): """digest in article json format""" abstract_tags = raw_parser.abstract(soup, abstract_type="executive-summary") abstract_json = None for tag in abstract_tags: abstract_json = render_abstract_json(tag) return abstract_json
63
29
273
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
194831b5765b58ddff6c27c4ef347c47dd01d5d64731e6b1f76341cb0871b954
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f69c37736e09c88f6697559e
elifesciences/elife-tools
elifetools/parseJATS.py
author_affiliations
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2782-L2825
train
python
compile author affiliations for json output
def author_affiliations(author, html_flag=True): """compile author affiliations for json output""" # Configure the XML to HTML conversion preference for shorthand use below convert = lambda xml_string: xml_to_html(html_flag, xml_string) affilations = [] if author.get("affiliations"): for ...
compile author affiliations for json output def author_affiliations(author, html_flag=True): """compile author affiliations for json output""" # Configure the XML to HTML conversion preference for shorthand use below convert = lambda xml_string: xml_to_html(html_flag, xml_string) affilations = [] ...
406
43
2,201
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
e62a440fbbd61219399477aedb5861a882442514169742b0878a99201419d5a3
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e25553079ddda0e885bea45b
elifesciences/elife-tools
elifetools/parseJATS.py
author_json_details
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L2963-L3002
train
python
add more author json
def author_json_details(author, author_json, contributions, correspondence, competing_interests, equal_contributions_map, present_address_data, foot_notes_data, html_flag=True): # Configure the XML to HTML conversion preference for shorthand use below convert = la...
add more author json def author_json_details(author, author_json, contributions, correspondence, competing_interests, equal_contributions_map, present_address_data, foot_notes_data, html_flag=True): # Configure the XML to HTML conversion preference for shorthand use ...
344
20
1,775
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
df5776816f6a1b8d40c67b5919f5f50189d37777016adc002f232e8c5ff2d10e
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
09047c62f337d96fea480540
elifesciences/elife-tools
elifetools/parseJATS.py
collab_to_group_author_key_map
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3049-L3055
train
python
compile a map of author collab to group-author-key
def collab_to_group_author_key_map(authors): """compile a map of author collab to group-author-key""" collab_map = {} for author in authors: if author.get("collab"): collab_map[author.get("collab")] = author.get("group-author-key") return collab_map
compile a map of author collab to group-author-key def collab_to_group_author_key_map(authors): """compile a map of author collab to group-author-key""" collab_map = {} for author in authors: if author.get("collab"): collab_map[author.get("collab")] = author.get("group-author-key") ...
81
50
285
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
a546ffb5809cab22e65b00c0751ffb1406c9f67a6a5ff75499f83ba770f8d5b1
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
3a5b910d2daa52c38a2962e9
elifesciences/elife-tools
elifetools/parseJATS.py
map_equal_contributions
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3057-L3071
train
python
assign numeric values to each unique equal-contrib id
def map_equal_contributions(contributors): """assign numeric values to each unique equal-contrib id""" equal_contribution_map = {} equal_contribution_keys = [] for contributor in contributors: if contributor.get("references") and "equal-contrib" in contributor.get("references"): for ...
assign numeric values to each unique equal-contrib id def map_equal_contributions(contributors): """assign numeric values to each unique equal-contrib id""" equal_contribution_map = {} equal_contribution_keys = [] for contributor in contributors: if contributor.get("references") and "equal-cont...
163
53
774
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
8a3a6b1923ad8208511f588ebec6e14457aafe3a8bd378e94235d45385c4a2c7
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
578fa3c67cfa98314c767806
elifesciences/elife-tools
elifetools/parseJATS.py
authors_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3088-L3141
train
python
authors list in article json format
def authors_json(soup): """authors list in article json format""" authors_json_data = [] contributors_data = contributors(soup, "full") author_contributions_data = author_contributions(soup, None) author_competing_interests_data = competing_interests(soup, None) author_correspondence_data = full...
authors list in article json format def authors_json(soup): """authors list in article json format""" authors_json_data = [] contributors_data = contributors(soup, "full") author_contributions_data = author_contributions(soup, None) author_competing_interests_data = competing_interests(soup, None) ...
623
35
3,244
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
b9bb8a7050f117ab898b769de7b5eedcc107f86cc26f9d34f5f7f188eaa75104
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
caba2eba45c11ed52aed1bab
elifesciences/elife-tools
elifetools/parseJATS.py
author_line
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3143-L3150
train
python
take preferred names from authors json and format them into an author line
def author_line(soup): """take preferred names from authors json and format them into an author line""" author_line = None authors_json_data = authors_json(soup) author_names = extract_author_line_names(authors_json_data) if len(author_names) > 0: author_line = format_author_line(author_name...
take preferred names from authors json and format them into an author line def author_line(soup): """take preferred names from authors json and format them into an author line""" author_line = None authors_json_data = authors_json(soup) author_names = extract_author_line_names(authors_json_data) if...
89
74
345
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
7f1cff4831c4709cbc4a8fff0fbd20f20266676784388f1afd43eeecdc64a574
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
e459ce048c26cee04f24f6b5
elifesciences/elife-tools
elifetools/parseJATS.py
format_author_line
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3165-L3174
train
python
authorLine format depends on if there is 1, 2 or more than 2 authors
def format_author_line(author_names): """authorLine format depends on if there is 1, 2 or more than 2 authors""" author_line = None if not author_names: return author_line if len(author_names) <= 2: author_line = ", ".join(author_names) elif len(author_names) > 2: author_line...
authorLine format depends on if there is 1, 2 or more than 2 authors def format_author_line(author_names): """authorLine format depends on if there is 1, 2 or more than 2 authors""" author_line = None if not author_names: return author_line if len(author_names) <= 2: author_line = ", "....
114
68
373
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d5fd640c9f38980854334f420a53375c588ee861ead909d146e0b387a4524de7
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
61dac2170694d3543cf59d47
elifesciences/elife-tools
elifetools/parseJATS.py
references_date
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3210-L3226
train
python
Handle year value parsing for some edge cases
def references_date(year=None): "Handle year value parsing for some edge cases" date = None discriminator = None in_press = None if year and "in press" in year.lower().strip(): in_press = True elif year and re.match("^[0-9]+$", year): date = year elif year: discrimina...
Handle year value parsing for some edge cases def references_date(year=None): "Handle year value parsing for some edge cases" date = None discriminator = None in_press = None if year and "in press" in year.lower().strip(): in_press = True elif year and re.match("^[0-9]+$", year): ...
149
45
588
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
e83681547f6f32c87709c44dc2ec3056f49c26f84125d2df7e349eaabd3ffd44
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
01ef5288f9c9eac7cb672060
elifesciences/elife-tools
elifetools/parseJATS.py
references_json_authors
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3256-L3285
train
python
build the authors for references json here for testability
def references_json_authors(ref_authors, ref_content): "build the authors for references json here for testability" all_authors = references_authors(ref_authors) if all_authors != {}: if ref_content.get("type") in ["conference-proceeding", "journal", "other", ...
build the authors for references json here for testability def references_json_authors(ref_authors, ref_content): "build the authors for references json here for testability" all_authors = references_authors(ref_authors) if all_authors != {}: if ref_content.get("type") in ["conference-proceeding", ...
481
58
2,077
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
8a97232a409c9ba7922df89e13ed8fd5e3958bc2e4db4e890a17ec9fc15244d9
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
a639f2a1eafac9f168d1bc70
elifesciences/elife-tools
elifetools/parseJATS.py
convert_references_json
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3480-L3507
train
python
Check for references that will not pass schema validation, fix or convert them to unknown
def convert_references_json(ref_content, soup=None): "Check for references that will not pass schema validation, fix or convert them to unknown" # Convert reference to unkonwn if still missing important values if ( (ref_content.get("type") == "other") or (ref_content.get("type") == ...
Check for references that will not pass schema validation, fix or convert them to unknown def convert_references_json(ref_content, soup=None): "Check for references that will not pass schema validation, fix or convert them to unknown" # Convert reference to unkonwn if still missing important values if ( ...
315
89
1,207
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
4f181f199cfcb3fc2462080a0dd0c47d9ab2172dd99dc850f05b73be19d78d8a
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
f4fff468ad52e5f942fe7d7f
elifesciences/elife-tools
elifetools/parseJATS.py
references_json_unknown_details
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3540-L3569
train
python
Extract detail value for references of type unknown
def references_json_unknown_details(ref_content, soup=None): "Extract detail value for references of type unknown" details = "" # Try adding pages values first if "pages" in ref_content: if "range" in ref_content["pages"]: details += ref_content["pages"]["range"] else: ...
Extract detail value for references of type unknown def references_json_unknown_details(ref_content, soup=None): "Extract detail value for references of type unknown" details = "" # Try adding pages values first if "pages" in ref_content: if "range" in ref_content["pages"]: details...
262
51
1,280
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
006e7a81e98b0eeaebf08a8524bb7403a43810a9f291b8ccdc5826d4a6bfb6cc
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
d72eb87b62ac8b3508046f8f
elifesciences/elife-tools
elifetools/parseJATS.py
unwrap_appendix_box
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/parseJATS.py#L3593-L3603
train
python
for use in removing unwanted boxed-content from appendices json
def unwrap_appendix_box(json_content): """for use in removing unwanted boxed-content from appendices json""" if json_content.get("content") and len(json_content["content"]) > 0: first_block = json_content["content"][0] if (first_block.get("type") and first_block.get("type") == "box" ...
for use in removing unwanted boxed-content from appendices json def unwrap_appendix_box(json_content): """for use in removing unwanted boxed-content from appendices json""" if json_content.get("content") and len(json_content["content"]) > 0: first_block = json_content["content"][0] if (first_bl...
139
63
581
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
d8534aa6078170eaf21a49fcd3f87134da539bbb769d735bbab3340096b7a016
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
6b1d01af45c5003f17743d83
elifesciences/elife-tools
elifetools/utils_html.py
xml_to_html
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils_html.py#L5-L29
train
python
For formatting json output into HTML friendly format
def xml_to_html(html_flag, xml_string, base_url=None): "For formatting json output into HTML friendly format" if not xml_string or not html_flag is True: return xml_string html_string = xml_string html_string = remove_comment_tags(html_string) # Escape unmatched angle brackets if '<' in...
For formatting json output into HTML friendly format def xml_to_html(html_flag, xml_string, base_url=None): "For formatting json output into HTML friendly format" if not xml_string or not html_flag is True: return xml_string html_string = xml_string html_string = remove_comment_tags(html_string...
328
52
1,410
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
8763cd845312bac73fb8e24b7a936b56b917fda8bd0270c1c722f4ff77eb2da8
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
874e12e5ae76ee81dc7a1829
elifesciences/elife-tools
elifetools/utils_html.py
replace_simple_tags
https://github.com/elifesciences/elife-tools/blob/4b9e38cbe485c61a4ed7cbd8970c6b318334fd86/elifetools/utils_html.py#L70-L89
train
python
Replace tags such as <italic> to <i> This does not validate markup
def replace_simple_tags(s, from_tag='italic', to_tag='i', to_open_tag=None): """ Replace tags such as <italic> to <i> This does not validate markup """ if to_open_tag: s = s.replace('<' + from_tag + '>', to_open_tag) elif to_tag: s = s.replace('<' + from_tag + '>', '<' + to_tag +...
Replace tags such as <italic> to <i> This does not validate markup def replace_simple_tags(s, from_tag='italic', to_tag='i', to_open_tag=None): """ Replace tags such as <italic> to <i> This does not validate markup """ if to_open_tag: s = s.replace('<' + from_tag + '>', to_open_tag) ...
209
70
653
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
debd76a0e2ba01c6f151b14b9db9645b019efd888785fdefea91faa39620bbd2
MIT
permissive
https://github.com/elifesciences/elife-tools/blob/develop/LICENSE
b232012150990f16fe7e4ab0
lalinsky/python-phoenixdb
phoenixdb/__init__.py
connect
https://github.com/lalinsky/python-phoenixdb/blob/1bb34488dd530ca65f91b29ef16aa7b71f26b806/phoenixdb/__init__.py#L44-L67
train
python
Connects to a Phoenix query server. :param url: URL to the Phoenix query server, e.g. ``http://localhost:8765/`` :param autocommit: Switch the connection to autocommit mode. :param readonly: Switch the connection to readonly mode. :param max_retries: The maximum numbe...
def connect(url, max_retries=None, **kwargs): """Connects to a Phoenix query server. :param url: URL to the Phoenix query server, e.g. ``http://localhost:8765/`` :param autocommit: Switch the connection to autocommit mode. :param readonly: Switch the connection to readonly mod...
Connects to a Phoenix query server. :param url: URL to the Phoenix query server, e.g. ``http://localhost:8765/`` :param autocommit: Switch the connection to autocommit mode. :param readonly: Switch the connection to readonly mode. :param max_retries: The maximum numbe...
303
579
758
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
2989308ddc2c824424610b701bdfce2677d2fa56ad69026501aa90c5a0dce3d6
Apache-2.0
permissive
https://github.com/lalinsky/python-phoenixdb/blob/master/LICENSE
e31924c4eb5ed2b17e621cbb
lalinsky/python-phoenixdb
phoenixdb/avatica/client.py
AvaticaClient.connect
https://github.com/lalinsky/python-phoenixdb/blob/1bb34488dd530ca65f91b29ef16aa7b71f26b806/phoenixdb/avatica/client.py#L151-L158
train
python
Opens a HTTP connection to the RPC server.
def connect(self): """Opens a HTTP connection to the RPC server.""" logger.debug("Opening connection to %s:%s", self.url.hostname, self.url.port) try: self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port) self.connection.connect() except (http...
Opens a HTTP connection to the RPC server. def connect(self): """Opens a HTTP connection to the RPC server.""" logger.debug("Opening connection to %s:%s", self.url.hostname, self.url.port) try: self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port) se...
98
42
447
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
9f3deea3f42a6b53df4e46ea1450d9b0321ec54c7070aa291d67ba69d0cb6e16
Apache-2.0
permissive
https://github.com/lalinsky/python-phoenixdb/blob/master/LICENSE
7c9f22b4184ae3b10c9b9379
lalinsky/python-phoenixdb
phoenixdb/avatica/client.py
AvaticaClient.close
https://github.com/lalinsky/python-phoenixdb/blob/1bb34488dd530ca65f91b29ef16aa7b71f26b806/phoenixdb/avatica/client.py#L160-L168
train
python
Closes the HTTP connection to the RPC server.
def close(self): """Closes the HTTP connection to the RPC server.""" if self.connection is not None: logger.debug("Closing connection to %s:%s", self.url.hostname, self.url.port) try: self.connection.close() except httplib.HTTPException: ...
Closes the HTTP connection to the RPC server. def close(self): """Closes the HTTP connection to the RPC server.""" if self.connection is not None: logger.debug("Closing connection to %s:%s", self.url.hostname, self.url.port) try: self.connection.close() ...
87
45
420
CodeSearchNet permissive-repo filter (dataset-level)
code_search_net
2026-12-05
1fdedbcbb190319b3ecd4149aa4ec6ef4c4018de776d6abed66ac74a8da3671f
Apache-2.0
permissive
https://github.com/lalinsky/python-phoenixdb/blob/master/LICENSE