from typing import List
from typing import Union


def replace_many(
        value: str,
        substrings_to_replace: List[str],
        replacement_substrings: Union[List[str], str]
) -> str:
    """
    Function replace many substring at once.

    Args:
        value: String in which we want to replace the substrings.
        substrings_to_replace: List of substrings we want to replace.
        replacement_substrings: List of replacement substring. If single substring is provided it is used as replacement
        for all the input string.

    Returns:
        Refactored input string.

    """
    if isinstance(replacement_substrings, str):
        replacement_substrings = [replacement_substrings] * len(substrings_to_replace)
    if len(substrings_to_replace) != len(replacement_substrings):
        return value
    for source, target in zip(substrings_to_replace, replacement_substrings):
        value = value.replace(source, target)
    return value