import typing
import itertools


def generate_fixed_permutations(
    base_name: str,
    locations: typing.List[str],
    perm_length: int,
) -> typing.List[typing.List[str]]:
    """
    Generate path permutations of a specified length which always start and
    end at base_name.
    :param base_name:
        Name of base to begin from.
    :param locations:
        List of locations that can be visited.
    :param perm_length:
        Length of the trip in stops.
    :return:
        List of all possible paths of specified length.
    """
    location_perms = itertools.permutations(locations, perm_length)
    return [[base_name] + list(perm) + [base_name] for perm in location_perms]