parameters: (tree, leaves=None)
return_statement: return leaves
docstring: Flatten a tree into a list.
  
    Args:
      tree: iterable or not. If iterable, its elements (child) can also be
        iterable or not.
      leaves: list to which the tree leaves are appended (None by default).
    Returns:
      A list of all the leaves in the tree.
docstring_summary: Flatten a tree into a list.
docstring_tokens: Flatten a tree into a list .
function: def flatten_tree(tree, leaves=None):
    """Flatten a tree into a list.
  
    Args:
      tree: iterable or not. If iterable, its elements (child) can also be
        iterable or not.
      leaves: list to which the tree leaves are appended (None by default).
    Returns:
      A list of all the leaves in the tree.
    """
    if leaves is None:
      leaves = []
    if isinstance(tree, dict):
      for _, child in iteritems(tree):
        flatten_tree(child, leaves)
    elif is_iterable(tree):
      for child in tree:
        flatten_tree(child, leaves)
    else:
      leaves.append(tree)
    return leaves
function_tokens: def flatten_tree ( tree , leaves = None ) : if leaves is None : leaves = [ ] if isinstance ( tree , dict ) : for _ , child in iteritems ( tree ) : flatten_tree ( child , leaves ) elif is_iterable ( tree ) : for child in tree : flatten_tree ( child , leaves ) else : leaves . append ( tree ) return leaves