def str_to_num(text):
    '''
    Convert a string to a number.
    Returns an integer if the string represents an integer, a floating
    point number if the string is a real number, or the string unchanged
    otherwise.
    '''
    try:
        return int(text)
    except __HOLE__:
        try:
            return float(text)
        except ValueError:
            return text
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/str_to_num