def sanitize_table_name(table_name: str) -> str:
    """
    Sanitize the table name to ensure it is valid for use in Azure Table Storage
    or Cosmos DB.
    """
    san_table_name = ALPHANUMERIC_REGEX.sub("", table_name)
    if san_table_name[0].isdigit():
        san_table_name = f"{TABLE_NAME_PLACEHOLDER_CHARACTER}{san_table_name}"
    san_length = len(san_table_name)
    if san_length < MIN_TABLE_NAME_LENGTH:
        san_table_name += TABLE_NAME_PLACEHOLDER_CHARACTER * (
            MIN_TABLE_NAME_LENGTH - san_length
        )
    elif len(san_table_name) > MAX_TABLE_NAME_LENGTH:
        san_table_name = san_table_name[:MAX_TABLE_NAME_LENGTH]
    return san_table_name

    Sanitize the table name to ensure it is valid for use in Azure Table Storage
    or Cosmos DB.
    
llama-index-utils/llama-index-utils-azure/llama_index/utils/azure/table.py