def str_lower(batch: Union[str, list, tuple]):
    """Recursively search for strings in a list and convert them to lowercase

    Args:
        batch: a string or a list containing strings at some level of nesting

    Returns:
        the same structure where all strings are converted to lowercase
    """
    if isinstance(batch, str):
        return batch.lower()
    else:
        return list(map(str_lower, batch))
Recursively search for strings in a list and convert them to lowercase

    Args:
        batch: a string or a list containing strings at some level of nesting

    Returns:
        the same structure where all strings are converted to lowercase
    
deeppavlov/models/preprocessors/str_lower.py