def strip_endlines(in_arg):
    """Remove eol characters Linux/Win/Mac (input can be string or list of strings)."""

    if isinstance(in_arg, (tuple, list)):
        buff = []
        for x in in_arg:
            if isinstance(x, bytes):
                buff.append(x.rstrip().decode('utf-8'))
            elif isinstance(x, str):
                buff.append(x.rstrip())
            else:
                # input is unknown
                buff.append(in_arg)
        return buff

    elif isinstance(in_arg, bytes):
        return in_arg.rstrip().decode('utf-8')

    elif isinstance(in_arg, str):
        return in_arg.rstrip()
    else:
        # input is unknown
        return in_arg