def try_key(key, d):
    try:
        return d[key]
    except KeyError:
        try:
            if (key in ('true', 'false')):
                return d[(key == 'true')]
            else:
                try:
                    return d[int(key)]
                except ValueError:
                    raise ModelInfoLookupError(key)
        except KeyError:
            raise ModelInfoLookupError(key)
def try_key(key, d):
    try:
        return d[key]
    except KeyError:
        try:
            if (key in ('true', 'false')):
                return d[(key == 'true')]
            else:
                try:
                    return d[int(key)]
                except ValueError:
                    raise ModelInfoLookupError(key)
        except KeyError:
            raise ModelInfoLookupError(key)