def getSliceDictionary(xmlElement):
 for metadataElement in xmlElement.getChildrenWithClassName('metadata'):
  for child in metadataElement.children:
   if (child.className.lower() == 'slice:layers'):
    return child.attributeDictionary
 return {}

def getSliceDictionary ( xmlElement ) : for metadataElement in xmlElement . getChildrenWithClassName ( 'metadata' ) : for child in metadataElement . children : if ( child . className . lower ( ) == 'slice:layers' ) : return child . attributeDictionary return { }
get the metadata slice attribute dictionary .