'Find the object of the given name in the given scope
@param name {str} The name of the object to look for
@param attrlist {seq of str} The attributes to look into (e.g.,
"variables", "functions", "classes")
@param scope {JSObject} The scope in which to find the object
@returns {JSObject or None} The found object, an immediate child of the
scope.'

def _findInScope(self, name, attrlist=('variables',), scope=None):

    assert (scope is not None), 'Missing    scope'
    for attr in attrlist:
        namesDict = getattr(scope, attr, None)
        if namesDict:
            subscope = namesDict.get(name)
            if subscope:
                log.debug('_findInScope:    Found    a    scope    for:    %r    in    %s.%s:', name, scope.name, attr)
                return subscope
    return None
