def METHOD_NAME(version, levels=2):
    """
    Take a version number as a string delimited by periods and return a tuple with the desired number of levels.
    For example::
        print(version_tuple('0.5.1.dev1', levels=2))
        ('0', '5')
    """
    v = _strip_dev_suffix(version).split(".")
    v = v[0 : min(len(v), levels)]
    if len(v) < levels:
        v = v + ["0"] * (levels - len(v))
    return tuple(v)