def get_head(expression):
    """Returns the given expression's head."""
    if isinstance(expression, Wildcard):
        if isinstance(expression, SymbolWildcard):
            return expression.symbol_type
        return None
    return type(expression)
def get_head ( expression ) : if isinstance ( expression , Wildcard ) : if isinstance ( expression , SymbolWildcard ) : return expression . symbol_type return None return type ( expression )
Returns the given expression's head.