import logging
import sys
from itertools import zip_longest

_NO_DEFAULT = object()

_LOG = logging.getLogger(__name__)


def _get_args_and_defaults(args, defaults):
    """Return a list of 2-tuples - the argument name and its default value or
        a special value that indicates there is no default value.

    Args:
        args: list of argument name
        defaults: tuple of default values
    """
    defaults = defaults or []
    args_and_defaults = [
        (argument, default)
        for (argument, default) in zip_longest(
            args[::-1], defaults[::-1], fillvalue=_NO_DEFAULT
        )
    ]
    return args_and_defaults[::-1]


def _get_args_to_parse(args, cli_arguments=None):
    """Return the given arguments if it is not None else sys.argv if it contains
        something, an empty list otherwise.

    Args:
        args: argument to be parsed
        cli_arguments: arguments from the command line, defaults to sys.argv; mostly
        for testing purposes
    """
    cli_arguments = cli_arguments if cli_arguments is not None else sys.argv
    arguments = args if args is not None else cli_arguments[1:]
    _LOG.debug("Parsing arguments: %s", arguments)
    return arguments

@@ -52,16 +52,62 @@
 _longest
+%0Afrom typing import Any, List, Optional, Tuple
 %0A%0A_NO_DE
@@ -192,26 +192,49 @@
 lts(args
-, defaults
+: List%5Bstr%5D, defaults: Tuple%5BAny%5D
 ):%0A    %22
@@ -743,16 +743,27 @@
 rse(args
+: List%5Bstr%5D
 , cli_ar
@@ -769,17 +769,40 @@
 rguments
-=
+: Optional%5BList%5Bstr%5D%5D = 
 None):%0A 

Add typing to args