fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
67
get_setters_property
def
function
def get_setters_property(node): """Get the property node for the given setter node. :param node: The node to get the property for. :type node: nodes.FunctionDef :rtype: nodes.FunctionDef or None :returns: The node relating to the property of the given setter node, or None if one could not be found. """ property_ = None property_name = get_setters_property_name(node) class_node = utils.node_frame_class(node) if property_name and class_node: class_attrs = class_node.getattr(node.name) for attr in class_attrs: if utils.decorated_with_property(attr): property_ = attr break return property_
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
79
get_setters_property_name
ref
function
property_name = get_setters_property_name(node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
80
node_frame_class
ref
class
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
84
decorated_with_property
ref
function
if utils.decorated_with_property(attr):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
91
returns_something
def
function
def returns_something(return_node): """Check if a return node returns a value other than None. :param return_node: The return node to check. :type return_node: astroid.Return :rtype: bool :return: _True if the return node returns a value other than None, _False otherwise. """ returns = return_node.value if returns is None: return _False return not (isinstance(returns, nodes.Const) and returns.value is None)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
109
_get_raise_target
def
function
def _get_raise_target(node): if isinstance(node.exc, nodes.Call): func = node.exc.func if isinstance(func, (nodes.Name, nodes.Attribute)): return utils.safe_infer(func) return None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
113
safe_infer
ref
function
return utils.safe_infer(func)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
117
_split_multiple_exc_types
def
function
def _split_multiple_exc_types(target: str) -> List[str]: delimiters = r"(\s*,(?:\s*or\s)?\s*|\s+or\s+)" return re.split(delimiters, target)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
122
possible_exc_types
def
function
def possible_exc_types(node: nodes.NodeNG) -> Set[nodes.ClassDef]: """Gets all the possible raised exception types for the given raise node. .. note:: Caught exception types are ignored. :param node: The raise node to find exception types for. :returns: A list of exception types possibly raised by :param:`node`. """ exceptions = [] if isinstance(node.exc, nodes.Name): inferred = utils.safe_infer(node.exc) if inferred: exceptions = [inferred] elif node.exc is None: handler = node.parent while handler and not isinstance(handler, nodes.ExceptHandler): handler = handler.parent if handler and handler.type: try: for exception in astroid.unpack_infer(handler.type): if exception is not astroid.Uninferable: exceptions.append(exception) except astroid.InferenceError: pass else: target = _get_raise_target(node) if isinstance(target, nodes.ClassDef): exceptions = [target] elif isinstance(target, nodes.FunctionDef): for ret in target.nodes_of_class(nodes.Return): if ret.frame(future=_True) != target: # return from inner function - ignore it continue val = utils.safe_infer(ret.value) if val and utils.inherit_from_std_ex(val): if isinstance(val, nodes.ClassDef): exceptions.append(val) elif isinstance(val, astroid.Instance): exceptions.append(val.getattr("__class__")[0]) try: return { exc for exc in exceptions if not utils.node_ignores_exception(node, exc.name) } except astroid.InferenceError: return set()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
136
safe_infer
ref
function
inferred = utils.safe_infer(node.exc)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
146
unpack_infer
ref
function
for exception in astroid.unpack_infer(handler.type):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
152
_get_raise_target
ref
function
target = _get_raise_target(node)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
156
nodes_of_class
ref
class
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
157
frame
ref
function
if ret.frame(future=True) != target:
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
161
safe_infer
ref
function
val = utils.safe_infer(ret.value)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
162
inherit_from_std_ex
ref
function
if val and utils.inherit_from_std_ex(val):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
172
node_ignores_exception
ref
function
if not utils.node_ignores_exception(node, exc.name)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
178
docstringify
def
function
def docstringify(docstring: str, default_type: str = "default") -> "Docstring": best_match = (0, DOCSTRING_TYPES.get(default_type, Docstring)(docstring)) for docstring_type in ( SphinxDocstring, EpytextDocstring, GoogleDocstring, NumpyDocstring, ): instance = docstring_type(docstring) matching_sections = instance.matching_sections() if matching_sections > best_match[0]: best_match = (matching_sections, instance) return best_match[1]
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
186
docstring_type
ref
function
instance = docstring_type(docstring)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
187
matching_sections
ref
function
matching_sections = instance.matching_sections()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
194
Docstring
def
class
__init__ __repr__ matching_sections exceptions has_params has_returns has_rtype has_property_returns has_property_type has_yields has_yields_type match_param_docs params_documented_elsewhere
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
217
matching_sections
def
function
def matching_sections(self) -> int: """Returns the number of matching docstring sections.""" return 0 def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
221
exceptions
def
function
def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
224
has_params
def
function
def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
227
has_returns
def
function
def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
230
has_rtype
def
function
def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
233
has_property_returns
def
function
def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
236
has_property_type
def
function
def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
239
has_yields
def
function
def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
242
has_yields_type
def
function
def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
245
match_param_docs
def
function
def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
248
params_documented_elsewhere
def
function
def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
252
SphinxDocstring
def
class
matching_sections exceptions has_params has_returns has_rtype has_property_returns has_property_type match_param_docs
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
330
matching_sections
def
function
def matching_sections(self) -> int: """Returns the number of matching docstring sections.""" return 0 def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
343
exceptions
def
function
def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
347
group
ref
function
raise_type = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
348
_split_multiple_exc_types
ref
function
types.update(_split_multiple_exc_types(raise_type))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
352
has_params
def
function
def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
358
has_returns
def
function
def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
364
has_rtype
def
function
def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
370
has_property_returns
def
function
def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
378
has_property_type
def
function
def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
384
match_param_docs
def
function
def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
389
group
ref
function
name = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
393
group
ref
function
param_type = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
401
EpytextDocstring
def
class
has_property_returns
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
440
has_property_returns
def
function
def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
445
has_property_type
ref
function
if self.has_property_type():
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
453
GoogleDocstring
def
class
matching_sections has_params has_returns has_rtype has_property_returns has_property_type has_yields has_yields_type exceptions match_param_docs _first_line min_section_indent _is_section_header _parse_section
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
537
matching_sections
def
function
def matching_sections(self) -> int: """Returns the number of matching docstring sections.""" return 0 def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
546
_first_line
ref
function
self.re_property_returns_line.search(self._first_line()),
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
550
has_params
def
function
def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
556
has_returns
def
function
def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
560
_parse_section
ref
function
entries = self._parse_section(self.re_returns_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
566
group
ref
function
return_desc = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
572
has_rtype
def
function
def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
576
_parse_section
ref
function
entries = self._parse_section(self.re_returns_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
582
group
ref
function
return_type = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
588
has_property_returns
def
function
def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
591
_first_line
ref
function
first_line = self._first_line()
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
599
has_property_type
def
function
def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
603
_first_line
ref
function
return bool(self.re_property_returns_line.match(self._first_line()))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
605
has_yields
def
function
def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
609
_parse_section
ref
function
entries = self._parse_section(self.re_yields_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
615
group
ref
function
yield_desc = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
621
has_yields_type
def
function
def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
625
_parse_section
ref
function
entries = self._parse_section(self.re_yields_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
631
group
ref
function
yield_type = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
637
exceptions
def
function
def exceptions(self): return set() def has_params(self): return _False def has_returns(self): return _False def has_rtype(self): return _False def has_property_returns(self): return _False def has_property_type(self): return _False def has_yields(self): return _False def has_yields_type(self): return _False def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
640
_parse_section
ref
function
entries = self._parse_section(self.re_raise_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
646
group
ref
function
exc_type = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
647
group
ref
function
exc_desc = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
649
_split_multiple_exc_types
ref
function
types.update(_split_multiple_exc_types(exc_type))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
653
match_param_docs
def
function
def match_param_docs(self): return set(), set() def params_documented_elsewhere(self): return self.re_for_parameters_see.search(self.doc) is not None
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
657
_parse_section
ref
function
entries = self._parse_section(self.re_param_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
658
_parse_section
ref
function
entries.extend(self._parse_section(self.re_keyword_param_section))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
664
group
ref
function
param_name = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
665
group
ref
function
param_type = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
666
group
ref
function
param_desc = match.group(3)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
676
_first_line
def
function
def _first_line(self): return self.doc.lstrip().split("\n", 1)[0] @staticmethod def min_section_indent(section_match): return len(section_match.group(1)) + 1 @staticmethod def _is_section_header(_): # Google parsing does not need to detect section headers, # because it works off of indentation level only return _False def _parse_section(self, section_re): section_match = section_re.search(self.doc) if section_match is None: return [] min_indentation = self.min_section_indent(section_match) entries = [] entry = [] is_first = _True for line in section_match.group(2).splitlines(): if not line.strip(): continue indentation = space_indentation(line) if indentation < min_indentation: break # The first line after the header defines the minimum # indentation. if is_first: min_indentation = indentation is_first = _False if indentation == min_indentation: if self._is_section_header(line): break # Lines with minimum indentation must contain the beginning # of a new parameter documentation. if entry: entries.append("\n".join(entry)) entry = [] entry.append(line) if entry: entries.append("\n".join(entry)) return entries
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
680
min_section_indent
def
function
def min_section_indent(section_match): return len(section_match.group(1)) + 1 @staticmethod def _is_section_header(_): # Google parsing does not need to detect section headers, # because it works off of indentation level only return _False def _parse_section(self, section_re): section_match = section_re.search(self.doc) if section_match is None: return [] min_indentation = self.min_section_indent(section_match) entries = [] entry = [] is_first = _True for line in section_match.group(2).splitlines(): if not line.strip(): continue indentation = space_indentation(line) if indentation < min_indentation: break # The first line after the header defines the minimum # indentation. if is_first: min_indentation = indentation is_first = _False if indentation == min_indentation: if self._is_section_header(line): break # Lines with minimum indentation must contain the beginning # of a new parameter documentation. if entry: entries.append("\n".join(entry)) entry = [] entry.append(line) if entry: entries.append("\n".join(entry)) return entries
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
681
group
ref
function
return len(section_match.group(1)) + 1
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
684
_is_section_header
def
function
def _is_section_header(_): # Google parsing does not need to detect section headers, # because it works off of indentation level only return _False def _parse_section(self, section_re): section_match = section_re.search(self.doc) if section_match is None: return [] min_indentation = self.min_section_indent(section_match) entries = [] entry = [] is_first = _True for line in section_match.group(2).splitlines(): if not line.strip(): continue indentation = space_indentation(line) if indentation < min_indentation: break # The first line after the header defines the minimum # indentation. if is_first: min_indentation = indentation is_first = _False if indentation == min_indentation: if self._is_section_header(line): break # Lines with minimum indentation must contain the beginning # of a new parameter documentation. if entry: entries.append("\n".join(entry)) entry = [] entry.append(line) if entry: entries.append("\n".join(entry)) return entries
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
689
_parse_section
def
function
def _parse_section(self, section_re): section_match = section_re.search(self.doc) if section_match is None: return [] min_indentation = self.min_section_indent(section_match) entries = [] entry = [] is_first = _True for line in section_match.group(2).splitlines(): if not line.strip(): continue indentation = space_indentation(line) if indentation < min_indentation: break # The first line after the header defines the minimum # indentation. if is_first: min_indentation = indentation is_first = _False if indentation == min_indentation: if self._is_section_header(line): break # Lines with minimum indentation must contain the beginning # of a new parameter documentation. if entry: entries.append("\n".join(entry)) entry = [] entry.append(line) if entry: entries.append("\n".join(entry)) return entries
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
694
min_section_indent
ref
function
min_indentation = self.min_section_indent(section_match)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
699
group
ref
function
for line in section_match.group(2).splitlines():
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
702
space_indentation
ref
function
indentation = space_indentation(line)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
713
_is_section_header
ref
function
if self._is_section_header(line):
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
729
NumpyDocstring
def
class
match_param_docs min_section_indent _is_section_header
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
783
match_param_docs
def
function
def match_param_docs(self) -> Tuple[Set[str], Set[str]]: """Matches parameter documentation section to parameter documentation rules.""" params_with_doc = set() params_with_type = set() entries = self._parse_section(self.re_param_section) entries.extend(self._parse_section(self.re_keyword_param_section)) for entry in entries: match = self.re_param_line.match(entry) if not match: continue # check if parameter has description only re_only_desc = re.match(r"\s* (\*{0,2}\w+)\s*:?\n", entry) if re_only_desc: param_name = match.group(1) param_desc = match.group(2) param_type = None else: param_name = match.group(1) param_type = match.group(3) param_desc = match.group(4) if param_type: params_with_type.add(param_name) if param_desc: params_with_doc.add(param_name) return params_with_doc, params_with_type @staticmethod def min_section_indent(section_match): return len(section_match.group(1)) @staticmethod def _is_section_header(line): return bool(re.match(r"\s*-+$", line))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
788
_parse_section
ref
function
entries = self._parse_section(self.re_param_section)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
789
_parse_section
ref
function
entries.extend(self._parse_section(self.re_keyword_param_section))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
798
group
ref
function
param_name = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
799
group
ref
function
param_desc = match.group(2)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
802
group
ref
function
param_name = match.group(1)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
803
group
ref
function
param_type = match.group(3)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
804
group
ref
function
param_desc = match.group(4)
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
815
min_section_indent
def
function
def min_section_indent(section_match): return len(section_match.group(1)) + 1 @staticmethod def _is_section_header(_): # Google parsing does not need to detect section headers, # because it works off of indentation level only return _False def _parse_section(self, section_re): section_match = section_re.search(self.doc) if section_match is None: return [] min_indentation = self.min_section_indent(section_match) entries = [] entry = [] is_first = _True for line in section_match.group(2).splitlines(): if not line.strip(): continue indentation = space_indentation(line) if indentation < min_indentation: break # The first line after the header defines the minimum # indentation. if is_first: min_indentation = indentation is_first = _False if indentation == min_indentation: if self._is_section_header(line): break # Lines with minimum indentation must contain the beginning # of a new parameter documentation. if entry: entries.append("\n".join(entry)) entry = [] entry.append(line) if entry: entries.append("\n".join(entry)) return entries
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
816
group
ref
function
return len(section_match.group(1))
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/extensions/_check_docs_utils.py
pylint/extensions/_check_docs_utils.py
819
_is_section_header
def
function
def _is_section_header(line): return bool(re.match(r"\s*-+$", line))