def _abs(val):
    """Return the absolute value of val"""
    if not isinstance(val, int) and not isinstance(val, float):
        if val.isdigit() or val[0] in ['+', '-'] and val[1:].isdigit():
            return abs(int(val))
        return abs(float(val))
    return abs(val)
