import numbers
import ast


def is_numeric(obj):
    """
    Check if the given object represents a number
    :param obj: input object
    :return: True if obj is a number, else False
    """
    if isinstance(obj, numbers.Number):
        return True
    elif isinstance(obj, str):
        try:
            nodes = list(ast.walk(ast.parse(obj)))[1:]
        except SyntaxError:
            return False
        if not isinstance(nodes[0], ast.Expr):
            return False
        if not isinstance(nodes[-1], ast.Num):
            return False
        nodes = nodes[1:-1]
        for i in range(len(nodes)):
            if i % 2 == 0:
                if not isinstance(nodes[i], ast.UnaryOp):
                    return False
            else:
                if not isinstance(nodes[i], (ast.USub, ast.UAdd)):
                    return False
        return True
    else:
        return False