[docs]defencode_version(version:int|str|None)->str:""" Normalize version input into standardized string format. Converts various version inputs into a consistent string representation by removing leading zeros from numeric versions while preserving the special LATEST version identifier. :after_param version: Version input - None, "LATEST", integer, or zero-padded string :returns: Normalized version string ("LATEST" or numeric without leading zeros) Examples:: encode_version(None) # → "LATEST" encode_version("LATEST") # → "LATEST" encode_version(1) # → "1" encode_version("000001") # → "1" encode_version(42) # → "42" """ifversionisNone:returnLATEST_VERSIONelse:returnstr(version).lstrip("0")