keep track all loaded raba classes
485659
def getLastRabaId(self, cls) :
		""""""
		self.loadedRabaClasses[cls.__name__] = cls
		sql = 'SELECT MAX(raba_id) from %s LIMIT 1' % (cls.__name__)
		cur = self.execute(sql)
		res = cur.fetchone()
		try :
			return int(res[0])+1
		except TypeError:
			return  0
639919
def refresh():
    """"""
    override_files = []
    for stack in traceback.extract_stack():
        f = os.path.join(os.path.dirname(stack[0]), OVERRIDE_FILE)
        if f not in override_files:
            override_files.insert(0, f)
    if OVERRIDE_FILE in override_files:
        del override_files[override_files.index(OVERRIDE_FILE)]
    override_files.append(OVERRIDE_FILE)

    def import_path(path):
        if sys.version_info < (3, 5, 0):
            from importlib.machinery import SourceFileLoader
            return SourceFileLoader(__name__, path).load_module()
        import importlib.util
        spec = importlib.util.spec_from_file_location(__name__, path)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)
        return module

    for override_file in override_files:
        if not os.path.isfile(override_file):
            continue
        mod = import_path(override_file)
        globals().update({n: getattr(mod, n) for n in dir(mod) if not n.startswith("__")})
827979
def follow_directories_loaded(self, fname):
        """"""
        if self._to_be_loaded is None:
            return
        path = osp.normpath(to_text_string(fname))
        if path in self._to_be_loaded:
            self._to_be_loaded.remove(path)
        if self._to_be_loaded is not None and len(self._to_be_loaded) == 0:
            self.fsmodel.directoryLoaded.disconnect(
                                        self.follow_directories_loaded)
            if self._scrollbar_positions is not None:
                # The tree view need some time to render branches:
                QTimer.singleShot(50, self.restore_scrollbar_positions)
1240583
def collect_ansible_classes():
    """"""
    def trace_calls(frame, event, arg):  # pylint: disable=W0613
        """Trace function calls to collect ansible classes.

        Trace functions and check if they have self as an arg. If so, get their class if the
        class belongs to ansible.
        """
        if event != 'call':
            return
        try:
            _locals = inspect.getargvalues(frame).locals
            if 'self' not in _locals:
                return
            _class = _locals['self'].__class__
            _class_repr = repr(_class)
            if 'ansible' not in _class_repr:
                return
            ANSIBLE_CLASSES[_class] = True
        except (AttributeError, TypeError):
            pass

    print "Gathering classes"
    sys.settrace(trace_calls)
    main()
1078537
def store(self):
        '''
        
        '''
        for var_name in self.track_vars:
            value_now = getattr(self,var_name)
            getattr(self,var_name + '_hist').append(value_now)
1136898
private function SaveClassesToJson()
    {
        $classes = array();
        $enumerations = array();
        $variables = array();
        
        foreach($this->symbols->headers as $header)
        {
            if(!$header->HasClasses())
                continue;
            
            foreach($header->namespaces as $namespace)
            {
                if(!$namespace->HasClasses())
                    continue;
                
                foreach($namespace->classes as $class)
                {   
                    // Set class details
                    if($class->description)
                    {
                        $classes[$header->name][$namespace->name]
                            [$class->name]
                            ["_description"] = $class->description
                        ;
                    }
                    
                    if($class->parents)
                    {
                        foreach($class->parents as $parent)
                        {
                            $classes[$header->name][$namespace->name]
                                [$class->name]
                                ["_parents"][] = $parent
                            ;
                        }
                    }
                    
                    if($class->struct)
                    {
                        $classes[$header->name][$namespace->name]
                            [$class->name]
                            ["_struct"] = $class->struct
                        ;
                    }
                    
                    if($class->forward_declaration)
                    {
                        $classes[$header->name][$namespace->name]
                            [$class->name]
                            ["_forward_declaration"] = $class->forward_declaration
                        ;
                    }
                    
                    if($class->platforms)
                    {
                        $classes[$header->name][$namespace->name]
                            [$class->name]
                            ["_platforms"] = $class->platforms
                        ;
                    }
                    
                    // Get methods
                    foreach($class->methods as $function)
                    {
                        foreach($function->overloads as $overload)
                        {
                            $parameters = array();

                            if($overload->HasParameters())
                            {
                                foreach($overload->parameters as $parameter)
                                {
                                    $parameter_array = array();
                                
                                    $parameter_array["name"] = $parameter->name;
                                    $parameter_array["type"] = $parameter->original_type;

                                    if($parameter->is_array)
                                        $parameter_array["is_array"] = $parameter->is_array;

                                    if($parameter->default_value)
                                        $parameter_array["value"] = $parameter->default_value;


                                    if(trim($parameter->description))
                                        $parameter_array["description"] = $parameter->description;

                                    $parameters[] = $parameter_array;
                                }

                                $classes[$header->name][$namespace->name]
                                    [$class->name][$function->name][] = [
                                        "description" => $overload->description,
                                        "return_type" => $overload->return_type->original_type,
                                        "parameters" => $parameters
                                    ]
                                ;
                            }
                            else
                            {
                                $classes[$header->name][$namespace->name]
                                    [$class->name][$function->name][] = [
                                        "description" => $overload->description,
                                        "return_type" => $overload->return_type->original_type
                                    ]
                                ;
                            }
                        }
                    }
                    
                    // Get enumerations
                    foreach($class->enumerations as $enumeration)
                    {
                        if(trim($enumeration->description))
                        {
                            $enumerations[$header->name][$namespace->name]
                                [$class->name][$enumeration->name] = [
                                    "options" => $enumeration->options,
                                    "description" => $enumeration->description
                                ]
                            ;
                        }
                        else
                        {
                            $enumerations[$header->name][$namespace->name]
                                [$class->name][$enumeration->name] = [
                                    "options" => $enumeration->options
                                ]
                            ;
                        }
                    }
                    
                    // Get variables
                    foreach($class->variables as $variable)
                    {
                        $variable_array = array();
                        
                        if(trim($variable->type))
                            $variable_array["type"] = $variable->type;
                        
                        if(trim($variable->static))
                            $variable_array["static"] = $variable->static;
                        
                        if(trim($variable->protected))
                            $variable_array["protected"] = $variable->protected;
                        
                        if(trim($variable->mutable))
                            $variable_array["mutable"] = $variable->mutable;
                        
                        if(trim($variable->description))
                            $variable_array["description"] = $variable->description;
                        
                        $variables[$header->name][$namespace->name]
                            [$class->name][$variable->name] = $variable_array
                        ;
                    }
                }
            }
        }
        
        if(count($classes) > 0)
        {
            file_put_contents(
                $this->definitions_path . "classes.json", 
                Json::Encode($classes)
            );
            
            unset($classes);
        }
        
        if(count($enumerations) > 0)
        {
            file_put_contents(
                $this->definitions_path . "class_enumerations.json", 
                Json::Encode($enumerations)
            );
            
            unset($enumerations);
        }
        
        if(count($variables) > 0)
        {
            file_put_contents(
                $this->definitions_path . "class_variables.json", 
                Json::Encode($variables)
            );

            unset($variables);
        }
    }
313158
function setLoaderClass(c, t) {
    timeouts.push(
        setTimeout(() => {
            loadbar.classList.add(c);
        }, t)
    );
}
647351
def archive(self):
        """"""
        pipe = self.redis.pipeline(transaction=True)
        pipe.srem(ACTIVE_EXPERIMENTS_REDIS_KEY, self.name)
        pipe.sadd(ARCHIVED_EXPERIMENTS_REDIS_KEY, self.name)
        pipe.execute()
764771
def mark
      classes = Set.new
      marked_objects = 0
      @progressmeter.start("Marking linked objects", @db.item_counter) do
        each do |obj|
          classes.add(obj.class)
          @progressmeter.update(marked_objects += 1)
        end
      end
      @class_map.keep(classes.map { |c| c.to_s })

      # The root_objects object is included in the count, but we only want to
      # count user objects here.
      PEROBS.log.debug "#{marked_objects - 1} of #{@db.item_counter} " +
        "objects marked"
      @stats.marked_objects = marked_objects - 1
    end
867828
function load() {
        Inspector.Page.on("frameNavigated.CSSAgent", _onFrameNavigated);
        Inspector.CSS.on("styleSheetAdded.CSSAgent", _styleSheetAdded);
        Inspector.CSS.on("styleSheetRemoved.CSSAgent", _styleSheetRemoved);

        // getAllStyleSheets was deleted beginning with Chrome 34
        if (!_getAllStyleSheetsNotFound) {
            Inspector.Page.on("frameStoppedLoading.CSSAgent", _onFrameStoppedLoading);
        }
    }
455330
private void recordRollbackLoader(final String patchId, PatchableTarget.TargetInfo target) {
        // setup the content loader paths
        final DirectoryStructure structure = target.getDirectoryStructure();
        final InstalledImage image = structure.getInstalledImage();
        final File historyDir = image.getPatchHistoryDir(patchId);
        final File miscRoot = new File(historyDir, PatchContentLoader.MISC);
        final File modulesRoot = structure.getModulePatchDirectory(patchId);
        final File bundlesRoot = structure.getBundlesPatchDirectory(patchId);
        final PatchContentLoader loader = PatchContentLoader.create(miscRoot, bundlesRoot, modulesRoot);
        //
        recordContentLoader(patchId, loader);
    }
837843
def updateTraceCount(self):
        """"""
        self.ui.ntracesLbl.setNum(self.ui.trackview.model().traceCount())
795803
async def refresh(self):
        """"""
        cls = type(self)
        if hasattr(cls, 'read'):
            descriptors, alt_descriptors = get_pk_descriptors(cls)
            if len(descriptors) == 1:
                try:
                    obj = await cls.read(getattr(self, descriptors[0][0]))
                except AttributeError:
                    found = False
                    for alt_name, _ in alt_descriptors[0]:
                        if hasattr(self, alt_name):
                            obj = await cls.read(getattr(self, alt_name))
                            found = True
                            break
                    if not found:
                        raise
            elif len(descriptors) > 1:
                args = []
                for idx, (name, _) in enumerate(descriptors):
                    try:
                        args.append(getattr(self, name))
                    except AttributeError:
                        found = False
                        for alt_name, _ in alt_descriptors[idx]:
                            if hasattr(self, alt_name):
                                args.append(getattr(self, alt_name))
                                found = True
                                break
                        if not found:
                            raise
                obj = await cls.read(*args)
            else:
                raise AttributeError(
                    "unable to perform 'refresh' no primary key "
                    "fields defined.")
            if type(obj) is cls:
                self._data = obj._data
                self._loaded = True
            else:
                raise TypeError(
                    "result of '%s.read' must be '%s', not '%s'" % (
                        cls.__name__, cls.__name__, type(obj).__name__))
        else:
            raise AttributeError(
                "'%s' object doesn't support refresh." % cls.__name__)
620035
def generate_endpoint_classes(db, generate_pks=False):
    """"""
    seen_classes = set()
    for cls in current_app.class_references.values():
        seen_classes.add(cls.__tablename__)
    with app.app_context():
        db.metadata.reflect(bind=db.engine)
        for name, table in db.metadata.tables.items():
            if not name in seen_classes:
                seen_classes.add(name)
                if not table.primary_key and generate_pks:
                    cls = add_pk_if_required(db, table, name)
                else:
                    cls = type(
                        str(name),
                        (sandman_model, db.Model),
                        {'__tablename__': name})
                register(cls)
767751
def load_last_visible_toolbars(self):
        """"""
        toolbars_names = CONF.get('main', 'last_visible_toolbars', default=[])

        if toolbars_names:
            dic = {}
            for toolbar in self.toolbarslist:
                dic[toolbar.objectName()] = toolbar

            toolbars = []
            for name in toolbars_names:
                if name in dic:
                    toolbars.append(dic[name])
            self.visible_toolbars = toolbars
        else:
            self.get_visible_toolbars()
        self._update_show_toolbars_action()
932605
def flushIndexes(self) :
		""
		for n in self.getIndexes(rabaOnly = True) :
			self.dropIndexByName(n[1])
335821
public void postClassLoaderInit()
  {
    // bartender.setLocalShard(pod.getNode(podNode));
    ServiceManagerBuilderAmp builder = ServicesAmp.newManager();
    builder.name(EnvLoader.getEnvironmentName());
    
    BartenderSystem bartender = BartenderSystem.current();
    if (bartender != null) {
      PodBartender pod = bartender.findActivePod(getPodName());
    
      Objects.requireNonNull(pod);
    
      int podNode = _builder.getPodNode();
      bartender.setLocalPod(pod);
      //builder.setPodNode(new ServiceNodeImpl(pod.getNode(podNode)));
    }
    
    /*
    //builder.setJournalMaxCount(_builder.getJournalMaxCount());
    builder.setJournalDelay(_builder.getJournalDelay());
    // XXX: config timing issue
    builder.debug(_builder.isDebug());
    builder.debugQueryTimeout(_builder.getDebugQueryTimeout());
    builder.autoStart(false);
    */
    _ampManager = builder.start();

    /*
    if (_controller.getConfigException() != null) {
      setAmpConfigException(_controller.getConfigException());
    }
    else if (_configException != null) {
      setAmpConfigException(_configException);
    }
    */
   
    Amp.contextManager(_ampManager);
    
    /*
    _ampManager.run(()->{
      EmbedBuilder embedBuilder = new EmbedBuilder();
      embedBuilder.scanClassLoader();
      embedBuilder.build();
    });
    */
  }