def METHOD_NAME(values):
    if keyword in values:
        try:
            return type(values[values.index(keyword) + 1].strip(unit))
        except (ValueError, IndexError):
            # Something went quite wrong if the keyword exists but the value doesn't
            return None
    else:
        # Wrong wavetype for this keyword
        return None