def rake_to_mech(rake):
    """
    Convert rake to mechanism.

    Args:
        rake (float): Rake angle in degrees.

    Returns:
        str: Mechanism.
    """
    mech = 'ALL'
    if rake is not None:
        if (rake >= -180 and rake <= -150) or \
           (rake >= -30 and rake <= 30) or \
           (rake >= 150 and rake <= 180):
            mech = 'SS'
        if rake >= -120 and rake <= -60:
            mech = 'NM'
        if rake >= 60 and rake <= 120:
            mech = 'RS'
    return mech