from typing import List
from typing import Any


def get_range_command(indexes: List[str], val: List[Any]) -> List[Any]:
    """
         Filter list with a given range.
         Args:
             indexes (list): indexes to filter.
             val (list): list to filter .
         Returns:
             filtered list.
     """
    result = []
    for index in indexes:
        if '-' in str(index):
            start, end = index.split('-')
            start = int(start) if start else 0
            end = int(end) if end else len(val)
            for element in val[start:end + 1]:
                result.append(element)
        else:
            result.append(val[int(index)])
    return result