MCPcopy
hub / github.com/pallets/jinja / find

Method find

src/jinja2/nodes.py:186–193  ·  view source on GitHub ↗

Find the first node of a given type. If no such node exists the return value is `None`.

(self, node_type: t.Type[_NodeBound])

Source from the content-addressed store, hash-verified

184 yield item
185
186 def find(self, node_type: t.Type[_NodeBound]) -> t.Optional[_NodeBound]:
187 """Find the first node of a given type. If no such node exists the
188 return value is `None`.
189 """
190 for result in self.find_all(node_type):
191 return result
192
193 return None
194
195 def find_all(
196 self, node_type: t.Union[t.Type[_NodeBound], t.Tuple[t.Type[_NodeBound], ...]]

Callers 1

visit_TemplateMethod · 0.80

Calls 1

find_allMethod · 0.95

Tested by

no test coverage detected