def check_numeric(value_string):
    """
    This function tries to determine if a string would be better represented
    with a numeric type, either int or float.  If neither works, for example
    ``10 Mb``, it will simply return the same string provided

    :param value_string: input string to be parsed.

    :return: the input string, an int, or a float
    """
    if type(value_string) in ('int', 'long', 'float'):
        return value_string

    try:
        if '.' in value_string:
            return float(value_string)
    except (TypeError, ValueError):
        pass

    try:
        return int(value_string)
    except (TypeError, ValueError):
        pass

    return value_string