function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def __init__(self, type, source, target, arguments=None, tags=None):
"""
Initialize an Event.
Arguments:
type -- A string describing the event.
source -- The originator of the event (a nick mask or a server).
target -- The target of the event (a nick or a ... | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def is_channel(string):
"""Check if a string is a channel name.
Returns true if the argument is a channel name, otherwise false.
"""
return string and string[0] in "#&+!" | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def ip_quad_to_numstr(quad):
"""
Convert an IP address string (e.g. '192.168.0.1') to an IP
number as a base-10 integer given in ASCII representation.
>>> ip_quad_to_numstr('192.168.0.1')
'3232235521'
"""
bytes = map(int, quad.split("."))
packed = struct.pack('BBBB', *bytes)
return ... | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def from_params(cls, nick, user, host):
return cls('{nick}!{user}@{host}'.format(**vars())) | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def nick(self):
nick, sep, userhost = self.partition("!")
return nick | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def userhost(self):
nick, sep, userhost = self.partition("!")
return userhost or None | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def host(self):
nick, sep, userhost = self.partition("!")
user, sep, host = userhost.partition('@')
return host or None | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def user(self):
nick, sep, userhost = self.partition("!")
user, sep, host = userhost.partition('@')
return user or None | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def from_group(cls, group):
return cls(group) if group else None | jaraco/irc | [
355,
81,
355,
24,
1448029842
] |
def process_notification(n):
# Mark as read anything that isn't an explicit mention.
# For PRs there doesn't seem like a simple way to detect if the notice
# is because the state changed
#
# We exclude mentions on PR because that gets overwhelmed by "/assign"
# statements. We should potentially be more disc... | kubeflow/code-intelligence | [
55,
20,
55,
64,
1562739425
] |
def mark_read(self, user):
token = os.getenv(TOKEN_NAME)
if not token:
raise ValueError(("Environment variable {0} needs to be set to a GitHub "
"token.").format(token))
client = github3.GitHub(username=user, token=token)
notifications = client.notifications()
# https:... | kubeflow/code-intelligence | [
55,
20,
55,
64,
1562739425
] |
def fetch_issues(self, org, repo, output):
"""Fetch issues for a repository
Args:
org: The org that owns the repository
repo: The directory for the repository
output: The directory to write the results
Writes the issues along with the first comments to a file in output
directory.
... | kubeflow/code-intelligence | [
55,
20,
55,
64,
1562739425
] |
def _create_client(self, user):
token = os.getenv(TOKEN_NAME)
if not token:
raise ValueError(("Environment variable {0} needs to be set to a GitHub "
"token.").format(token))
client = github3.GitHub(username=user, token=token)
return client | kubeflow/code-intelligence | [
55,
20,
55,
64,
1562739425
] |
def validate_file(filename: str) -> int:
"""
Validate `filename`, print its errors, and return the number of errors.
:param filename: YAML filename
:return: Number of errors
"""
lr = lint_file(filename)
if not lr.messages:
success(f'{filename}: No errors')
return 0
clic... | valohai/valohai-cli | [
13,
6,
13,
17,
1486558014
] |
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def _send_request(
self,
request: HttpRequest,
**kwargs: Any | Azure/azure-sdk-for-python | [
3526,
2256,
3526,
986,
1335285972
] |
def make_shell_context():
return dict(app=app) | lfzyx/ButterSalt | [
10,
8,
10,
1,
1482935345
] |
def test():
"""Run the unit tests."""
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests) | lfzyx/ButterSalt | [
10,
8,
10,
1,
1482935345
] |
def get_sorted(chain_json):
return sorted(chain_json, key=operator.itemgetter(0)) | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_text_too_small(self):
text = "Example phrase. This is another example sentence."
text_model = markovify.Text(text)
assert text_model.make_sentence() is None | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_json(self):
text_model = self.sherlock_model
json_model = text_model.to_json()
new_text_model = markovify.Text.from_json(json_model)
sent = new_text_model.make_sentence()
assert len(sent) != 0 | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_make_sentence_with_start(self):
text_model = self.sherlock_model
start_str = "Sherlock Holmes"
sent = text_model.make_sentence_with_start(start_str)
assert sent is not None
assert start_str == sent[: len(start_str)] | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_make_sentence_with_start_one_word_that_doesnt_begin_a_sentence(self):
text_model = self.sherlock_model
start_str = "dog"
with self.assertRaises(KeyError):
text_model.make_sentence_with_start(start_str) | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_make_sentence_with_words_not_at_start_of_sentence(self):
text_model = self.sherlock_model_ss3
# " I was " has 128 matches in sherlock.txt
# " was I " has 2 matches in sherlock.txt
start_str = "was I"
sent = text_model.make_sentence_with_start(start_str, strict=False, tri... | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_make_sentence_with_words_not_at_start_of_sentence_of_state_size(self):
text_model = self.sherlock_model_ss2
start_str = "was I"
sent = text_model.make_sentence_with_start(start_str, strict=False, tries=50)
assert sent is not None
assert start_str == sent[: len(start_str)... | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_make_sentence_with_start_three_words(self):
start_str = "Sherlock Holmes was"
text_model = self.sherlock_model
try:
text_model.make_sentence_with_start(start_str)
assert False
except markovify.text.ParamError:
assert True
with self.as... | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_short_sentence_min_chars(self):
sent = None
while sent is None:
sent = self.sherlock_model.make_short_sentence(100, min_chars=50)
assert len(sent) <= 100
assert len(sent) >= 50 | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_max_words(self):
text_model = self.sherlock_model
sent = text_model.make_sentence(max_words=0)
assert sent is None | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_newline_text(self):
with open(
os.path.join(os.path.dirname(__file__), "texts/senate-bills.txt")
) as f:
model = markovify.NewlineText(f.read())
model.make_sentence() | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_bad_json(self):
with self.assertRaises(Exception):
markovify.Chain.from_json(1) | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def test_recompiling(self):
model_recompile = self.sherlock_model.compile()
sent = model_recompile.make_sentence()
assert len(sent) != 0
model_recompile.compile(inplace=True)
sent = model_recompile.make_sentence()
assert len(sent) != 0 | jsvine/markovify | [
3125,
340,
3125,
14,
1420233680
] |
def setUp(self):
pass | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def json_expected(self, filename, function_name):
json_expected = None
json_file = json_expected_file(filename, function_name)
try:
with open(json_file, "rb") as json_file_fp:
json_expected = json.loads(json_file_fp.read().decode("utf-8"))
except IOError:
... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_parse_document(self, filename):
soup = parser.parse_document(sample_xml(filename))
self.assertTrue(isinstance(soup, BeautifulSoup)) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_title_json(self, filename, expected):
full_title_json = parser.full_title_json(self.soup(filename))
self.assertEqual(expected, full_title_json) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_impact_statement_json(self, filename, expected):
impact_statement_json = parser.impact_statement_json(self.soup(filename))
self.assertEqual(expected, impact_statement_json) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_ethics_json_by_file(self, filename, expected_length):
soup = parser.parse_document(sample_xml(filename))
self.assertEqual(len(parser.ethics_json(soup)), expected_length) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_ethics_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.ethics_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_acknowledgements_json_by_file(self, filename, expected):
acknowledgements_json = parser.acknowledgements_json(self.soup(filename))
if expected is None:
self.assertEqual(expected, acknowledgements_json)
else:
self.assertEqual(expected, type(acknowledgements_json)) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_appendices_json_by_file(self, filename, expected_len):
soup = parser.parse_document(sample_xml(filename))
tag_content = parser.appendices_json(soup)
self.assertEqual(len(tag_content), expected_len) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_appendices_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.appendices_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_appendices_json_with_base_url(self, xml_content, base_url, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.appendices_json(soup_body(soup), base_url)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_keywords_json(self, filename, expected):
keywords_json = parser.keywords_json(self.soup(filename))
self.assertEqual(expected, keywords_json) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_research_organism_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.research_organism_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_acknowledgements_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.acknowledgements_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_datasets_json_by_file(self, filename, expected_len):
soup = parser.parse_document(sample_xml(filename))
tag_content = parser.datasets_json(soup)
self.assertEqual(len(tag_content), expected_len) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_datasets_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.datasets_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_footnotes_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.footnotes_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_supplementary_files_json_by_file(self, filename, expected_len):
soup = parser.parse_document(sample_xml(filename))
tag_content = parser.supplementary_files_json(soup)
self.assertEqual(len(tag_content), expected_len) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_supplementary_files_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.supplementary_files_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_funding_statement_json_by_file(self, filename, expected):
soup = parser.parse_document(sample_xml(filename))
tag_content = parser.funding_statement_json(soup)
self.assertEqual(tag_content, expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_funding_statement_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.funding_statement_json(soup)
self.assertEqual(tag_content, expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_funding_awards_json_by_file(self, filename, expected_len):
soup = parser.parse_document(sample_xml(filename))
tag_content = parser.funding_awards_json(soup)
self.assertEqual(len(tag_content), expected_len) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_funding_awards_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.funding_awards_json(soup)
self.assertEqual(tag_content, expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_editor_evaluation(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.editor_evaluation(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_decision_letter(self, filename, expected, not_expected):
sub_article_content = parser.decision_letter(self.soup(filename))
if expected is not None:
self.assertEqual(expected, sub_article_content)
if not_expected is not None:
self.assertNotEqual(not_expected, sub_... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_decision_letter_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.decision_letter(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_author_response(self, filename, expected, not_expected):
sub_article_content = parser.author_response(self.soup(filename))
if expected is not None:
self.assertEqual(expected, sub_article_content)
if not_expected is not None:
self.assertNotEqual(not_expected, sub_... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_author_response_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.author_response(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body(self, filename, expected, not_expected):
body = parser.body(self.soup(filename))
if expected is not None:
self.assertEqual(expected, body)
if not_expected is not None:
self.assertNotEqual(not_expected, body) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.body_json(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_json_with_base_url(self, xml_content, base_url, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.body_json(soup, base_url=base_url)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_editors_json_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.editors_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_authors_json_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.authors_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_author_line_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.author_line(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_format_author_line(self, author_names, expected):
self.assertEqual(parser.format_author_line(author_names), expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_format_aff_edge_cases(self, xml_content, expected):
if xml_content:
soup = parser.parse_xml(xml_content)
aff_tag = soup_body(soup)
else:
# where the tag is None
aff_tag = xml_content
tag_content = parser.format_aff(aff_tag)
self.as... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_extract_author_line_names(self, authors_json, expected):
self.assertEqual(parser.extract_author_line_names(authors_json), expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_format_contributor_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
contrib_tag = raw_parser.article_contributors(soup)[0]
tag_content = parser.format_contributor(contrib_tag, soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_phone_number_json(self, phone, expected):
self.assertEqual(parser.phone_number_json(phone), expected) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_references_json_authors(self, ref_authors, ref_content, expected):
references_json = parser.references_json_authors(ref_authors, ref_content)
self.assertEqual(expected, references_json) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_references_json_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.references_json(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_references_publisher(self, publisher_name, publisher_loc, expected):
self.assertEqual(
parser.references_publisher(publisher_name, publisher_loc), expected
) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_blocks(self, xml_content, expected_len):
if xml_content:
soup = parser.parse_xml(xml_content)
body_tag = soup_body(soup_body(soup))
else:
body_tag = xml_content
body_block_tags = parser.body_blocks(body_tag)
self.assertEqual(len(body_bloc... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_block_title_label_caption(
self,
title_value,
label_value,
caption_content,
set_caption,
prefer_title,
prefer_label,
expected_title,
expected_label,
expected_caption, | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_block_content(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
# find the first tag in the root with a name
for child in soup.root.children:
if child.name:
body_tag = child
break
tag_content = parser.body_block_c... | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_body_block_content_render(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.body_block_content_render(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_render_raw_body(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.render_raw_body(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_abstract_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.abstract_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_digest_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.digest_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_ymd(self, xml_content, test_date_type, expected):
soup = parser.parse_xml(xml_content)
date_tag = raw_parser.pub_date(soup, date_type=test_date_type)[0]
self.assertEqual(expected, parser.ymd(date_tag)) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_history_date(self, xml_content, date_type, expected):
soup = parser.parse_xml(xml_content)
self.assertEqual(expected, parser.history_date(soup, date_type)) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_journal_issn(self, xml_content, pub_format, pub_type, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.journal_issn(
soup_body(soup), pub_format=pub_format, pub_type=pub_type
)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_author_contributions(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.author_contributions(soup, "con")
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_competing_interests(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.competing_interests(soup, ["conflict", "COI-statement"])
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_author_notes(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_author_notes(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_abstracts(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.abstracts(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_abstract_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.abstract(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_abstract_xml(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.abstract_xml(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_accepted_date_date(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.accepted_date_date(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_accepted_date_day(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.accepted_date_day(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_accepted_date_month(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.accepted_date_month(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_accepted_date_timestamp(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.accepted_date_timestamp(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_accepted_date_year(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.accepted_date_year(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_ack(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.ack(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_acknowledgements(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.acknowledgements(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_article_type(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.article_type(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_author_notes(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.author_notes(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_authors(self, filename, expected):
soup = parser.parse_document(filename)
tag_content = parser.authors(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_authors_non_byline(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.authors_non_byline(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.