Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _update(self) -> None:
self._leaves_values = []
self._leaves_elements = []
for node in self:
if len(node.children) == 0:
self._leaves_elements.append(node.element)
self._leaves_values.append(node.element.value)
self._leaves_values = uniquify(self._leaves_values)
self._leaves_elements = uniquify(self._leaves_elements)
def _update(self) -> None:
self._leaves_values = []
self._leaves_elements = []
for node in self:
if len(node.children) == 0:
self._leaves_elements.append(node.element)
self._leaves_values.append(node.element.value)
self._leaves_values = uniquify(self._leaves_values)
self._leaves_elements = uniquify(self._leaves_elements)
Parameters
----------
type :
Object type.
Returns
-------
names :
All possible names.
"""
expansions = self.get_all_expansions_for_tag("#({})#".format(type))
for room_type in self.grammar["#room_type#"].alternatives:
expansions += self.get_all_expansions_for_tag("#{}_({})#".format(room_type.full_form(), type))
return uniquify(expansions)
def variables(self):
if not hasattr(self, "_variables"):
self._variables = tuple(uniquify(var for prop in self.all_propositions for var in prop.arguments))
return self._variables