MCPcopy Index your code
hub / github.com/google/python-fire / _numpy_section

Function _numpy_section

fire/docstrings.py:729–748  ·  view source on GitHub ↗

Checks whether the current line is the start of a new numpy-style section. Numpy style sections are followed by a full line of hyphens, for example: Section Name ------------ Section body goes here. Args: line_info: Information about the current line. Returns: A Section

(line_info)

Source from the content-addressed store, hash-verified

727
728
729def _numpy_section(line_info):
730 """Checks whether the current line is the start of a new numpy-style section.
731
732 Numpy style sections are followed by a full line of hyphens, for example:
733
734 Section Name
735 ------------
736 Section body goes here.
737
738 Args:
739 line_info: Information about the current line.
740 Returns:
741 A Section type if one matches, or None if no section type matches.
742 """
743 next_line_is_hyphens = _line_is_hyphens(line_info.next.stripped)
744 if next_line_is_hyphens:
745 possible_title = line_info.remaining
746 return _section_from_possible_title(possible_title)
747 else:
748 return None
749
750
751def _line_is_numpy_parameter_type(line_info):

Callers 1

_update_section_stateFunction · 0.85

Calls 2

_line_is_hyphensFunction · 0.85

Tested by

no test coverage detected