function stringlengths 11 56k | repo_name stringlengths 5 60 | features list |
|---|---|---|
def test_award_groups(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.award_groups(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_category(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.category(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_collection_year(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.collection_year(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_collection_year_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.collection_year(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_component_doi(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.component_doi(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_components(self, filename, expected):
soup = parser.parse_document(filename)
tag_content = parser.components(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_conflict(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.conflict(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_contributors(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.contributors(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_copyright_holder(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.copyright_holder(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_copyright_holder_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.copyright_holder_json(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_copyright_statement(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.copyright_statement(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_copyright_year_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.copyright_year(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_correspondence(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.correspondence(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_digest(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.digest(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_display_channel(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.display_channel(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_doi(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.doi(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_elocation_id(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.elocation_id(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_abstract(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_abstract(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_affiliation(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_affiliation(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_award_group_funding_source(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_award_group_funding_source(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_award_groups(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_award_groups(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_correspondence(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_correspondence(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_digest(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_digest(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_funding_statement(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_funding_statement(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_keyword_groups(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_keyword_groups(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_keywords(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_keywords(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_license(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_license(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_research_organism(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_research_organism(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_subject_area(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_subject_area(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_full_title(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.full_title(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_funding_statement(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.funding_statement(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_graphics(self, filename, expected):
soup = parser.parse_document(filename)
tag_content = parser.graphics(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_impact_statement(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.impact_statement(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_inline_graphics(self, filename, expected):
soup = parser.parse_document(filename)
tag_content = parser.inline_graphics(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_is_poa(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.is_poa(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_journal_id(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.journal_id(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_journal_title(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.journal_title(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_keywords(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.keywords(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_license(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.license(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_license_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.license_json(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_license_url(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.license_url(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_media(self, filename, expected):
soup = parser.parse_document(filename)
tag_content = parser.media(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_dates_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_dates(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_date_timestamp(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_date_timestamp(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_date_date(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_date_date(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_date_day(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_date_day(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_date_month(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_date_month(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_date_year(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_date_year(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_publisher(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.publisher(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_publisher_id(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.publisher_id(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_received_date_date(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.received_date_date(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_received_date_day(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.received_date_day(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_received_date_month(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.received_date_month(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_received_date_timestamp(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.received_date_timestamp(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_received_date_year(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.received_date_year(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_refs_edge_cases(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.refs(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_related_article(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.related_article(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_sub_articles(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.sub_articles(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_related_object_ids(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.related_object_ids(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_research_organism(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.research_organism(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_self_uri(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.self_uri(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_subject_area(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.subject_area(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_supplementary_material(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.supplementary_material(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_title(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.title(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_title_prefix(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.title_prefix(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_title_prefix_json(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.title_prefix_json(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_title_short(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.title_short(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_title_slug(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.title_slug(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_volume(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.volume(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_issue(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.issue(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_fpage(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.fpage(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_lpage(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.lpage(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_version_history(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.version_history(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_clinical_trials(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.clinical_trials(soup_body(soup))
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def test_pub_history(self, xml_content, expected):
soup = parser.parse_xml(xml_content)
tag_content = parser.pub_history(soup)
self.assertEqual(expected, tag_content) | elifesciences/elife-tools | [
14,
7,
14,
4,
1423012481
] |
def _get_PyLinterRunV():
# Separate function to speed up import.
from pylint.lint import Run as PyLinterRun
from pylint import __version__ as pylint_version
if pylint_version >= '2.0.0':
PyLinterRunV = PyLinterRun
else:
PyLinterRunV = lambda *args, do_exit=False: PyLinterRun( # pyli... | sdpython/pyquickhelper | [
21,
10,
21,
22,
1388194285
] |
def _extended_refactoring(filename, line): # pragma: no cover
"""
Private function which does extra checkings
when refactoring :epkg:`pyquickhelper`.
@param filename filename
@param line line
@return None or error message
"""
if "from pyq... | sdpython/pyquickhelper | [
21,
10,
21,
22,
1388194285
] |
def check_pep8(folder, ignore=('E265', 'W504'), skip=None,
complexity=-1, stop_after=100, fLOG=None,
pylint_ignore=('C0103', 'C1801',
'R0201', 'R1705',
'W0108', 'W0613',
'W0107', 'C0415',
... | sdpython/pyquickhelper | [
21,
10,
21,
22,
1388194285
] |
def __init__(self, parent=None, width=200, placeholder=u"Enter some text ..", value=u"", **kwargs):
""" Constructs a new input field. An input field always needs a width specified """
LUIObject.__init__(self, x=0, y=0, solid=True)
self.set_width(width)
self._layout = LUIHorizontalStretch... | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def value(self):
""" Returns the value of the input field """
return self._value | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def value(self, new_value):
""" Sets the value of the input field """
self._value = new_value
self._render_text()
self.trigger_event("changed", self._value) | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def cursor_pos(self):
""" Set the cursor position """
return self._cursor_index | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def cursor_pos(self, pos):
""" Set the cursor position """
if pos >= 0:
self._cursor_index = max(0, min(len(self._value), pos))
else:
self._cursor_index = max(len(self._value) + pos + 1, 0)
self._reset_cursor_tick()
self._render_text() | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def on_click(self, event):
""" Internal on click handler """
self.request_focus() | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def _reset_cursor_tick(self):
""" Internal method to reset the cursor tick """
self._tickstart = globalClock.get_frame_time() | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def on_keydown(self, event):
""" Internal keydown handler. Processes the special keys, and if none are
present, redirects the event """
key_name = event.message
if key_name == "backspace":
self._value = self._value[:max(0, self._cursor_index - 1)] + self._value[self._cursor_i... | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def on_textinput(self, event):
""" Internal textinput handler """
self._value = self._value[:self._cursor_index] + event.message + \
self._value[self._cursor_index:]
self.cursor_pos = self._cursor_index + len(event.message)
self.trigger_event("changed", self._value) | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def _render_text(self):
""" Internal method to render the text """
self._text.set_text(self._value)
self._cursor.left = self._text.left + \
self._text.text_handle.get_char_pos(self._cursor_index) + 1
max_left = self.width - 15
if self._value:
self._placeh... | tobspr/LUI | [
77,
28,
77,
16,
1409080850
] |
def test_normal(self, value, expected):
assert get_integer_digit(value) == expected | thombashi/DataProperty | [
16,
5,
16,
1,
1455893692
] |
def test_abnormal(self, value, expected):
assert get_integer_digit(value) == expected | thombashi/DataProperty | [
16,
5,
16,
1,
1455893692
] |
def test_exception(self, value, exception):
with pytest.raises(exception):
get_integer_digit(value) | thombashi/DataProperty | [
16,
5,
16,
1,
1455893692
] |
def test_normal(self, value, expected):
assert get_number_of_digit(value) == expected | thombashi/DataProperty | [
16,
5,
16,
1,
1455893692
] |
def test_normal_max_decimal_places(self, value, max_decimal_places, expected):
assert get_number_of_digit(value, max_decimal_places=max_decimal_places) == expected | thombashi/DataProperty | [
16,
5,
16,
1,
1455893692
] |
def initialize(self, app):
super(EndpointHandler, self).initialize(app) | tableau/TabPy | [
1378,
537,
1378,
10,
1475011563
] |
def put(self, name):
if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
self.fail_with_auth_error()
return
self.logger.log(logging.DEBUG, f"Processing PUT for /endpoints/{name}")
try:
if not self.request.body:
self.error_out(400, ... | tableau/TabPy | [
1378,
537,
1378,
10,
1475011563
] |
def delete(self, name):
if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
self.fail_with_auth_error()
return
self.logger.log(logging.DEBUG, f"Processing DELETE for /endpoints/{name}")
try:
endpoints = self.tabpy_state.get_endpoints(name)
... | tableau/TabPy | [
1378,
537,
1378,
10,
1475011563
] |
def parseline(line):
sline = line.split()
if len(sline) < 11:
return None
m = PATTERN_IPV4.match(sline[0])
sortkey = None
ip = None
if m is None:
m = PATTERN_IPV6.match(sline[0])
if m is None:
m = PATTERN_ONION.match(sline[0])
if m is None:
... | deeponion/deeponion | [
63,
37,
63,
1,
1531515389
] |
def filtermultiport(ips):
'''Filter out hosts with more nodes per IP'''
hist = collections.defaultdict(list)
for ip in ips:
hist[ip['sortkey']].append(ip)
return [value[0] for (key,value) in list(hist.items()) if len(value)==1] | deeponion/deeponion | [
63,
37,
63,
1,
1531515389
] |
def filterbyasn(ips, max_per_asn, max_per_net):
# Sift out ips by type
ips_ipv46 = [ip for ip in ips if ip['net'] in ['ipv4', 'ipv6']]
ips_onion = [ip for ip in ips if ip['net'] == 'onion']
# Filter IPv46 by ASN, and limit to max_per_net per network
result = []
net_count = collections.defaultdi... | deeponion/deeponion | [
63,
37,
63,
1,
1531515389
] |
def main():
lines = sys.stdin.readlines()
ips = [parseline(line) for line in lines]
print('\x1b[7m IPv4 IPv6 Onion Pass \x1b[0m', file=sys.stderr)
print('%s Initial' % (ip_stats(ips)), file=sys.stderr)
# Skip entries with invalid address.
ips = ... | deeponion/deeponion | [
63,
37,
63,
1,
1531515389
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.