def _ensure_string(source):
    if isinstance(source, string_types):
        return source.rstrip()
    else:
        return _rstrip_lines(source)
Ensure a source is a string.
dataset/ETHPy150Open rossant/ipymd/ipymd/utils/utils.py/_ensure_string