# Path: modules/pepdata/common.py
# def _prepare_memoization_key(args, kwargs):
# def memoize(fn):
#     def wrapped_fn(*args, **kwargs):
# def int_or_seq(x):
# def dataframe_from_counts(counts):


from collections import namedtuple
from ..common import memoize, cache
import os
import xml
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function, division, absolute_import


ALLELE_XML_FILENAME = "MhcAlleleNames.xml"
ALLELE_XML_URL = "http://www.iedb.org/doc/MhcAlleleNameList.zip"
ALLELE_XML_DECOMPRESS = True

def local_path(force_download=False):
    """Downloads allele database from IEDB, returns local path to XML file."""
    return cache.fetch(
        filename=ALLELE_XML_FILENAME,
        url=ALLELE_XML_URL,
        decompress=ALLELE_XML_DECOMPRESS,
        force=force_download)

def delete():
    """Deletes local XML file"""

# Path: modules/pepdata/common.py
# def _prepare_memoization_key(args, kwargs):
# def memoize(fn):
#     def wrapped_fn(*args, **kwargs):
# def int_or_seq(x):
# def dataframe_from_counts(counts):


# Path: modules/pepdata/iedb/alleles.py
from collections import namedtuple
from ..common import memoize, cache
import os
import xml

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function, division, absolute_import


ALLELE_XML_FILENAME = "MhcAlleleNames.xml"
ALLELE_XML_URL = "http://www.iedb.org/doc/MhcAlleleNameList.zip"
ALLELE_XML_DECOMPRESS = True

def local_path(force_download=False):
    """Downloads allele database from IEDB, returns local path to XML file."""
    return cache.fetch(
        filename=ALLELE_XML_FILENAME,
        url=ALLELE_XML_URL,
        decompress=ALLELE_XML_DECOMPRESS,
        force=force_download)

def delete():
    """Deletes local XML file"""

    path = cache.local_path(