def is_pickle_file(abspath):
    """Parse file extension.
    
    - *.pickle: uncompressed, utf-8 encode pickle file
    - *.gz: compressed, utf-8 encode pickle file
    """
    abspath = abspath.lower()
    fname, ext = os.path.splitext(abspath)
    if ext in [".pickle", ".pk", ".p"]:
        is_pickle = True
    elif ext == ".gz":
        is_pickle = False
    elif ext == ".tmp":
        return is_pickle_file(fname)
    else:
        raise PickleExtError(
            "'%s' is not a valid pickle file. "
            "extension has to be '.pickle' for uncompressed, '.gz' "
            "for compressed." % abspath)
    return is_pickle
Parse file extension.
    
    - *.pickle: uncompressed, utf-8 encode pickle file
    - *.gz: compressed, utf-8 encode pickle file