import types
import importlib


def import_pickle() -> types.ModuleType:
    """ Returns cPickle module if available, returns imported pickle module otherwise """
    try:
        pickle = importlib.import_module('cPickle')
    except ImportError:
        pickle = importlib.import_module('pickle')
    return pickle