Return the parent scope.

        :return: FoldScope or None
1919
def parent(self):
        
        if TextBlockHelper.get_fold_lvl(self._trigger) > 0 and \
                self._trigger.blockNumber():
            block = self._trigger.previous()
            ref_lvl = self.trigger_level - 1
            while (block.blockNumber() and
                    (not TextBlockHelper.is_fold_trigger(block) or
                     TextBlockHelper.get_fold_lvl(block) > ref_lvl)):
                block = block.previous()
            try:
                return FoldScope(block)
            except ValueError:
                return None
        return None
88054
def get_parent_objects(self, context):
        
        parent_object = api.get_parent(context)
        portal_type = api.get_portal_type(context)
        return parent_object.objectValues(portal_type)
988892
def parent(self):
        
        parent = list(self.graph.objects(self.asNode(), RDF_NAMESPACES.DTS.parent))
        if parent:
            return self.parent_class(parent[0])
        return None
791281
def pop_scope(self):
        """"""
        child_scope = self.stack.current.current.copy()
        self.stack.current.pop()
        parent_scope = self.stack.current.current.copy()
        self.stack.current.current = {
            key: child_scope[key] for key in child_scope if key in parent_scope
        }
175068
def get_parent(self, update=False):
        
        depth = int(len(self.path) / self.steplen)
        if depth <= 1:
            return
        try:
            if update:
                del self._cached_parent_obj
            else:
                return self._cached_parent_obj
        except AttributeError:
            pass
        parentpath = self._get_basepath(self.path, depth - 1)
        self._cached_parent_obj = get_result_class(
            self.__class__).objects.get(path=parentpath)
        return self._cached_parent_obj
857863
def scopes(self):
        
        if not self.__scopes:
            self.__scopes = Scopes(self.__connection)
        return self.__scopes
625808
function fetchScope(element) {
            var scope;
            while (!scope && element.length) {
              scope = element.data('_scope');
              if (!scope) {
                element = element.parent();
              }
            }
            return scope;
          }
115268
def get_scope_path(cls, scope_separator="::"):
        
        if cls.get_parent_scope() is None:
            return ""
        elif isinstance(cls.get_parent_scope(), comp.Root):
            return ""
        else:
            parent_path = cls.get_parent_scope().get_scope_path(scope_separator)
            if parent_path:
                return(
                    parent_path
                    + scope_separator
                    + cls.get_parent_scope().type_name
                )
            else:
                return cls.get_parent_scope().type_name
863422
def unfold_if_colapsed(self, block):
        
        try:
            folding_panel = self._editor.panels.get('FoldingPanel')
        except KeyError:
            pass
        else:
            from spyder.plugins.editor.utils.folding import FoldScope
            if not block.isVisible():
                block = FoldScope.find_parent_scope(block)
                if TextBlockHelper.is_collapsed(block):
                    folding_panel.toggle_fold_trigger(block)
165263
def _add_scope_decorations(self, block, start, end):
        
        try:
            parent = FoldScope(block).parent()
        except ValueError:
            parent = None
        if TextBlockHelper.is_fold_trigger(block):
            base_color = self._get_scope_highlight_color()
            factor_step = 5
            if base_color.lightness() < 128:
                factor_step = 10
                factor = 70
            else:
                factor = 100
            while parent:
                # highlight parent scope
                parent_start, parent_end = parent.get_range()
                self._add_scope_deco(
                    start, end + 1, parent_start, parent_end,
                    base_color, factor)
                # next parent scope
                start = parent_start
                end = parent_end
                parent = parent.parent()
                factor += factor_step
            # global scope
            parent_start = 0
            parent_end = self.editor.document().blockCount()
            self._add_scope_deco(
                start, end + 1, parent_start, parent_end, base_color,
                factor + factor_step)
        else:
            self._clear_scope_decos()
1316553
def get_window(self): 
        
        x = self
        while not x._parent == None and \
              not isinstance(x._parent, Window): 
                  x = x._parent
        return x._parent
1058464
def GetParentFileEntry(self):
    
    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return None
    parent_inode = self._parent_inode
    parent_location = self._file_system.DirnamePath(location)
    if parent_inode is None and parent_location is None:
      return None

    if parent_location == '':
      parent_location = self._file_system.PATH_SEPARATOR

    root_inode = self._file_system.GetRootInode()
    is_root = bool(
        parent_location == self._file_system.LOCATION_ROOT or (
            parent_inode is not None and root_inode is not None and
            parent_inode == root_inode))

    parent_path_spec = getattr(self.path_spec, 'parent', None)
    path_spec = tsk_path_spec.TSKPathSpec(
        inode=parent_inode, location=parent_location, parent=parent_path_spec)
    return TSKFileEntry(
        self._resolver_context, self._file_system, path_spec, is_root=is_root)
652914
function determineContext( scope ) {
   let current = scope;
   while( !current.hasOwnProperty( 'widget' ) && current !== current.$root ) {
      current = current.$parent;
   }

   const isInWidget = !!current.widget;

   return {
      widgetName: isInWidget ? current.widget.path : '',
      widgetId: isInWidget ? current.widget.id : '',
      widgetScopeId: isInWidget ? current.$id : null,
      scopeId: scope.$id
   };
}
250813
def _get_scope_with_mangled(self, name):
        """"""
        scope = self
        while True:
            parent = scope.get_enclosing_scope()
            if parent is None:
                return

            if name in parent.rev_mangled:
                return parent

            scope = parent
510067
def _get_parent(self):
        """"""
        _dir = os.path.dirname(self.path)
        if is_repo(_dir):
            return Local(_dir)
        else:
            return None
1354679
def mangle_scope_tree(root, toplevel):
    
    def mangle(scope):
        # don't mangle global scope if not specified otherwise
        if scope.get_enclosing_scope() is None and not toplevel:
            return
        for name in scope.symbols:
            mangled_name = scope.get_next_mangled_name()
            scope.mangled[name] = mangled_name
            scope.rev_mangled[mangled_name] = name

    def visit(node):
        mangle(node)
        for child in node.children:
            visit(child)

    visit(root)
749404
function () {
      let scope = context.getScope();
      while (scope && scope.type !== 'class') {
        scope = scope.upper;
      }
      const node = scope && scope.block;
      if (!node || !utils.isES6Component(node)) {
        return null;
      }
      return node;
    }