cmph/__init__.py
def load_hash(existing_mph):
    """
    Load a Minimal Perfect Hash (MPH)
    Given an input stream, this will load a minimal perfect hash

    Parameters
    ----------
    existing_mph : file_like, string
        An input stream that is file like, and able to load
        a preexisting MPH, or the filename representing it.

    Raises
    ------
    IOError
        If there is an issue accessing or manipulating the underlying
        stream

    Returns
    -------
    MPH
        A MPH wrapper class
    """
    if is_file_location(existing_mph):
        with open(abspath(existing_mph)) as hash_table:
            _mph = _cmph.cmph_load(hash_table)
    elif is_file(existing_mph):
        _mph = _cmph.cmph_load(existing_mph)

    if not _mph:
        raise IOError("Unable to load an MPH from the given source")

    return MPH(_mph)
def load_hash(existing_mph):
    """
    Load a Minimal Perfect Hash (MPH)
    Given an input stream, this will load a minimal perfect hash

    Parameters
    ----------
    existing_mph : file_like, string
        An input stream that is file like, and able to load
        a preexisting MPH, or the filename representing it.

    Raises
    ------
    IOError
        If there is an issue accessing or manipulating the underlying
        stream

    Returns
    -------
    MPH
        A MPH wrapper class
    """
    if is_file_location(existing_mph):
        with open(abspath(existing_mph)) as hash_table:
            _mph = _cmph.cmph_load(hash_table)
    elif is_file(existing_mph):
        _mph = _cmph.cmph_load(existing_mph)

    if not _mph:
        raise IOError("Unable to load an MPH from the given source")

    return MPH(_mph)
Load a Minimal Perfect Hash (MPH)
    Given an input stream, this will load a minimal perfect hash

    Parameters
    ----------
    existing_mph : file_like, string
        An input stream that is file like, and able to load
        a preexisting MPH, or the filename representing it.

    Raises
    ------
    IOError
        If there is an issue accessing or manipulating the underlying
        stream

    Returns
    -------
    MPH
        A MPH wrapper class