from typing import List
import re


def _trim_leading_whitespace(lines: List[str]) -> List[str]:
    """Trims leading, plain spaces from the snippet content. Finds the minimum
    number of leading spaces, ignoring empty lines, and removes that number of
    spaces from each line.

    Args:
        lines (List[str]): Lines of content. These lines are newline terminated.

    Returns:
        List of trimmed lines.
    """

    def number_of_leading_spaces(input: str) -> int:
        return len(input) - len(input.lstrip(" "))

    def is_empty_line(input: str) -> bool:
        if re.match(r"^\s*$", input):
            return True
        return False

    leading_spaces = [
        number_of_leading_spaces(line) for line in lines if not is_empty_line(line)
    ]
    max_leading_spaces = min(leading_spaces)
    return [
        "\n" if is_empty_line(line) else line[max_leading_spaces:] for line in lines
    ]