def cut_suffix(name, suffix):
    """Cuts off the *suffix* from *name* string, if it ends with it

    :param name: original name from which suffix will be cut off
    :type name: string
    :param suffix: string to be removed
    :return: string without suffix
    """
    if isinstance(name, str) and name.endswith(suffix):
        name = name[:-len(suffix)]

    return name