from typing import List
from typing import Dict


def get_vrf_group(files_list: List[str]) -> Dict[str, List[str]]:
    """
    Group files by VRF name.
    """
    groups = {}
    for filename_path in files_list:
        filename_path = filename_path.replace("\\", "/")
    #   print(filename_path)

        if "show" in filename_path \
        or "display" in filename_path:
            continue

        """
        Example)
        "switch-001_192.168.252.201_20191028-142654_vrf_10.log"
        vrf_name = "_vrf_10.log"
        """
        pos1 = filename_path.rfind("_")
        pos2 = filename_path[:pos1].rfind("_")
        vrf_name = filename_path[pos2:]

        # Group by vrf_name and store a list of file names in the list.
    #   print(vrf_name)
        if not vrf_name in groups.keys():
            groups[vrf_name] = []
        groups[vrf_name].append(filename_path)
    return groups