'Convert a string representation of a number into a numeric type.'

@staticmethod
def str_to_num(value):

    if isinstance(value, numbers.Number):
        return value
    try:
        return int(value)
    except ValueError:
        return float(value)
