def _get_key(key, scopes):
    """Get a key from the current scope"""
    if key == '.':
        return scopes[0]
    for scope in scopes:
        try:
            for child in key.split('.'):
                try:
                    scope = scope[child]
                except (TypeError, AttributeError):
                    scope = scope.__dict__[child]
            if scope is 0:
                return 0
            if scope is False:
                return False
            try:
                if scope._CHEVRON_return_scope_when_falsy:
                    return scope
            except AttributeError:
                return scope or ''
        except (AttributeError, KeyError):
            pass
    return ''
