def flatten_all_paths(group, group_filter=lambda x: True,<EOL>path_filter=lambda x: True, path_conversions=CONVERSIONS,<EOL>group_search_xpath=SVG_GROUP_TAG):
if not isinstance(group, Element):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(type(group)))<EOL><DEDENT>if not group_filter(group):<EOL><INDENT>return []<EOL><DEDENT>StackElement = collections.namedtuple('<STR_LIT>',<EOL>['<STR_LIT>', '<STR_LIT>'])<EOL>def new_stack_element(element, last_tf):<EOL><INDENT>return StackElement(element, last_tf.dot(<EOL>parse_transform(element.get('<STR_LIT>'))))<EOL><DEDENT>def get_relevant_children(parent, last_tf):<EOL><INDENT>children = []<EOL>for elem in filter(group_filter,<EOL>parent.iterfind(group_search_xpath, SVG_NAMESPACE)):<EOL><INDENT>children.append(new_stack_element(elem, last_tf))<EOL><DEDENT>return children<EOL><DEDENT>stack = [new_stack_element(group, np.identity(<NUM_LIT:3>))]<EOL>FlattenedPath = collections.namedtuple('<STR_LIT>',<EOL>['<STR_LIT:path>', '<STR_LIT>', '<STR_LIT>'])<EOL>paths = []<EOL>while stack:<EOL><INDENT>top = stack.pop()<EOL>for key, converter in path_conversions.items():<EOL><INDENT>for path_elem in filter(path_filter, top.group.iterfind(<EOL>'<STR_LIT>'+key, SVG_NAMESPACE)):<EOL><INDENT>path_tf = top.transform.dot(<EOL>parse_transform(path_elem.get('<STR_LIT>')))<EOL>path = transform(parse_path(converter(path_elem)), path_tf)<EOL>paths.append(FlattenedPath(path, path_elem, path_tf))<EOL><DEDENT><DEDENT>stack.extend(get_relevant_children(top.group, top.transform))<EOL><DEDENT>return paths<EOL>
Returns the paths inside a group (recursively), expressing the
    paths in the base coordinates.

    Note that if the group being passed in is nested inside some parent
    group(s), we cannot take the parent group(s) into account, because
    xml.etree.Element has no pointer to its parent. You should use
    Document.flatten_group(group) to flatten a specific nested group into
    the root coordinates.

    Args:
        group is an Element
        path_conversions (dict):
            A dictionary to convert from an SVG element to a path data
            string. Any element tags that are not included in this
            dictionary will be ignored (including the `path` tag). To
            only convert explicit path elements, pass in
            `path_conversions=CONVERT_ONLY_PATHS`.