def parse_meters(meters):

    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 parse(obj):
        if isinstance(obj, str):
            return get_meters_by_name(obj)
        else:
            return obj

    def parse_name(obj):
        if isinstance(obj, str):
            obj = get_meters_by_name(obj)
        return to_small_case(obj)
    if isinstance(meters, dict):
        return {k: parse(v) for (k, v) in meters.items()}
    elif isinstance(meters, Iterable):
        return {parse_name(v): parse(v) for v in meters}
    else:
        raise Exception('Expected iterable meters')
def parse_meters(meters):

    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 parse(obj):
        if isinstance(obj, str):
            return get_meters_by_name(obj)
        else:
            return obj

    def parse_name(obj):
        if isinstance(obj, str):
            obj = get_meters_by_name(obj)
        return to_small_case(obj)
    if isinstance(meters, dict):
        return {k: parse(v) for (k, v) in meters.items()}
    elif isinstance(meters, Iterable):
        return {parse_name(v): parse(v) for v in meters}
    else:
        raise Exception('Expected iterable meters')