from typing import Set


def add_cell(cell: str, visited: Set[str]) -> bool:
    """
    Add cell to a set of visited set if it is not equal to '*' or ' '.
    If the same cell is already in the visited set, return False.
    Otherwise, return True.

    >>> add_cell('5', {'1', '2', '3'})
    True
    >>> add_cell('5', {'1', '2', '5'})
    False
    >>> add_cell('*', {'1', '2', '3'})
    True
    >>> add_cell(' ', {'1', '2', '3'})
    True
    """
    if cell in ('*', ' '):
        return True

    if cell in visited:
        return False

    visited.add(cell)

    return True