import re


def make_value(val):
    """Tries to return numeric value or argument unchanged if it cannot be parsed as int or float"""
    val = val.strip()
    numval = re.sub('[^\d\.\-]', '', val)
    if numval:
        if '.' in numval:
            return float(numval)
        else:
            return int(numval)
    return val or None