code: def collect_variables(self, variables: MultisetOfVariables) -> None:
          
          if self.variable_name is not None:
              variables.add(self.variable_name)
docs: Recursively adds all variables occuring in the expression to the given multiset.
  
          This is used internally by `variables`. Needs to be overwritten by inheriting container expression classes.
          This method can be used when gathering the `variables` of multiple expressions, because only one multiset
          needs to be created and that is more efficient.
  
          Args:
              variables:
                  Multiset of variables. All variables contained in the expression are recursively added to this multiset.