def METHOD_NAME(version: str) -> str:
    match = re.match('(.*)v[0-9]+$', version)
    if match is not None:
        version = match.group(1)
    match = re.match('(.*)p[0-9]+$', version)
    if match is not None:
        version = match.group(1)
    return version