'Given a MusicXML file, return the score as an xml.etree.ElementTree.
Given a MusicXML file, return the score as an xml.etree.ElementTree
If the file is compress (ends in .mxl), uncompress it first
Args:
filename: The path of a MusicXML file
Returns:
The score as an xml.etree.ElementTree.
Raises:
MusicXMLParseException: if the file cannot be parsed.'

@staticmethod
def _get_score(filename):

    score = None
    if filename.endswith('.mxl'):
        try:
            mxlzip = zipfile.ZipFile(filename)
        except zipfile.BadZipfile as exception:
            raise MusicXMLParseException(exception)
        namelist = mxlzip.namelist()
        container_file = [x for x in namelist if (x == 'META-INF/container.xml')]
        compressed_file_name = ''
        if container_file:
            try:
                container = ET.fromstring(mxlzip.read(container_file[0]))
                for rootfile_tag in container.findall('./rootfiles/rootfile'):
                    if ('media-type' in rootfile_tag.attrib):
                        if (rootfile_tag.attrib['media-type'] == MUSICXML_MIME_TYPE):
                            if (not compressed_file_name):
                                compressed_file_name = rootfile_tag.attrib['full-path']
                            else:
                                raise MusicXMLParseException('Multiple    MusicXML    files    found    in    compressed    archive')
                    elif (not compressed_file_name):
                        compressed_file_name = rootfile_tag.attrib['full-path']
                    else:
                        raise MusicXMLParseException('Multiple    MusicXML    files    found    in    compressed    archive')
            except ET.ParseError as exception:
                raise MusicXMLParseException(exception)
        if (not compressed_file_name):
            raise MusicXMLParseException('Unable    to    locate    main    .xml    file    in    compressed    archive.')
        compressed_file_name = compressed_file_name.encode('utf-8')
        if (compressed_file_name not in namelist):
            raise MusicXMLParseException(('Score    file    %s    not    found    in    zip    archive' % compressed_file_name))
        score_string = mxlzip.read(compressed_file_name)
        try:
            score = ET.fromstring(score_string)
        except ET.ParseError as exception:
            raise MusicXMLParseException(exception)
    else:
        try:
            tree = ET.parse(filename)
            score = tree.getroot()
        except ET.ParseError as exception:
            raise MusicXMLParseException(exception)
    return score
