def prettyprint(s, toUpper=False):
    """Given a string, replaces underscores with spaces and uppercases the
    first letter of each word ONLY if the string is composed of lowercased
    letters.  If the param, toUpper is given then s.upper is returned.

    Examples: "data_quality" -> "Data Quality"
    "copy_number_123" -> "Copy Number 123"

    "My_own_title" -> "My own title"
    "Hla" -> "Hla"
    """
    if toUpper:
        s = s.upper()
        s= s.replace("_", " ")
    else:
        s = s.title()
        s= s.replace("_", " ")
    return s