parameters: (self)
docstring: Remove groups with no attributes
docstring_summary: Remove groups with no attributes
docstring_tokens: Remove groups with no attributes
function: def removeGroups(self):
          """ Remove groups with no attributes """
          # Doesn't work for nested groups
          
          for element in self.tree.iter():
              if not isinstance(element.tag, basestring):
                  continue
              
              element_type = element.tag.split('}')[1]
              if element_type == 'g' and not element.keys():
                  parent = element.getparent()
                  if parent is not None:
                      parent_postion = parent.index(element)
                      print
                      print parent
                      # Move children outside of group
                      for i, child in enumerate(element, parent_postion):
                          print i
                          print "move %s to %s" % (child, i)
                          parent.insert(i, child)
function_tokens: def removeGroups ( self ) : # Doesn't work for nested groups for element in self . tree . iter ( ) : if not isinstance ( element . tag , basestring ) : continue element_type = element . tag . split ( '}' ) [ 1 ] if element_type == 'g' and not element . keys ( ) : parent = element . getparent ( ) if parent is not None : parent_postion = parent . index ( element ) print print parent # Move children outside of group for i , child in enumerate ( element , parent_postion ) : print i print "move %s to %s" % ( child , i ) parent . insert ( i , child )