Shared helper function for all :ref:`tools` to check if the passed
    m-function is indeed :func:`photon.Photon.m`

    :params pm:
        Suspected m-function
    :returns:
        Now to be proven correct m-function,
        tears down whole application otherwise.

def check_m(pm):
    '''
    Shared helper function for all :ref:`tools` to check if the passed
    m-function is indeed :func:`photon.Photon.m`

    :params pm:
        Suspected m-function
    :returns:
        Now to be proven correct m-function,
        tears down whole application otherwise.
    '''

    if not any([
        callable(pm),
        pm.__name__ != Photon.m.__name__,
        pm.__doc__ != Photon.m.__doc__
    ]):
        shell_notify(
            'wrong "m-function" passed!',
            state=True,
            more=pm.__name__
        )
    return pm