from typing import List


def _alias_names_for_scope(aliases: List[str], scope: str) -> List[str]:
    """
    Returns a list of alias names from a list of aliases with the given scope.
    Aliases from the API are scoped with a prefix character followed by a colon
    and then the alias name. For example "d:alias_name_1".

    Parameters
    ----------
    aliases: List[str]
        a list of course alias strings from the API
    scope: str
        the scope to filter by

    Returns
    -------
    List[str]
        a list of alias names (scope omitted) filtered by the given scope
    """
    result: List[str] = []
    try:
        result = [
            alias.split(":")[1] for alias in aliases if alias.split(":")[0] == scope
        ]
    except (ValueError, IndexError):
        pass
    return result