def get_class_name(o, lower=False):
    """
    Returns the class name of an object o.
    """
    if not isinstance(o, type):
        o = o.__class__
    if lower:
        return o.__name__.lower()
    else:
        return o.__name__