def check_for_positional_argument ( kwargs , name , default = False ) : if name in kwargs : if str ( kwargs [ name ] ) == "True" : return True elif str ( kwargs [ name ] ) == "False" : return False else : return kwargs [ name ] return default
python check default optional arg in function
def check_for_positional_argument(kwargs, name, default=False):
    """
    @type kwargs: dict
    @type name: str
    @type default: bool, int, str
    @return: bool, int
    """
    if name in kwargs:
        if str(kwargs[name]) == "True":
            return True
        elif str(kwargs[name]) == "False":
            return False
        else:
            return kwargs[name]

    return default