from typing import Any
from typing import List


def _flatten_list(input_list: Any) -> List[int]:
  """Flatten the input list of lists into a list.

  Args:
    input_list: A list that can contain integers or arbitrarily nested lists of
      lists of integers.

  Returns:
    The flattened list.
      e.g. for [1, [2, 3], [[4]]] it would return [1, 2, 3, 4].
  """
  flattened_list = []
  for element in input_list:
    if isinstance(element, list):
      flattened_list += _flatten_list(element)
    else:
      flattened_list.append(element)
  return flattened_list