def to_small_case(obj):
    if hasattr(obj, 'name'):
        s = str(obj.name)
    else:
        name = obj.__class__.__name__
        s = ''
        for i in range((len(name) - 1)):
            s += name[i].lower()
            if (name[i].islower() and (not name[(i + 1)].islower())):
                s += '_'
        s += name[(- 1)].lower()
    return s
def to_small_case(obj):
    if hasattr(obj, 'name'):
        s = str(obj.name)
    else:
        name = obj.__class__.__name__
        s = 
        for i in range((len(name) - 1)):
            s += name[i].lower()
            if (name[i].islower() and (not name[(i + 1)].islower())):
                s += '_'
        s += name[(- 1)].lower()
    return s