def camel_case_to_lower_case(string: str) -> str:
    return re.sub(r"(?<!^)(?=[A-Z])", "_", string).lower()


def get_filename_by_extension(name: str, extension: str) -> str:
    lower_case_name = camel_case_to_lower_case(name)
    if lower_case_name.endswith("".join(["_", extension])):
        return lower_case_name
    return "_".join([lower_case_name, extension])

