from typing import List


def build_ip_set(ip_addresses: List[str]) -> str:
    """
    Build ip set input for list-cmdb-devices command.
    The input wil be a combination of ip-addresses list and ranges. For example,
    if ip_address = ['1.1.1.1','3.3.3.3','2.2.2.0-2.2.2.254'], the output will be:
    '1.1.1.1,3.3.3.3,2.2.2.0-2.2.2.254'

     Args:
         ip_addresses (list): List of IP addresses ranges/list.

     Returns:
        str: Formatted IP addresses for list-cmdb-devices command.
     """
    return ','.join(filter(None, ip_addresses))