Return a treemodel with the levels: project, sequence, shot and reftrack type

        :returns: a treemodel
        :rtype: :class:`jukeboxcore.gui.treemodel.TreeModel`
        :raises: None
550607
def create_shot_model(self, ):
        
        rootdata = treemodel.ListItemData(['Name'])
        rootitem = treemodel.TreeItem(rootdata)
        prjs = djadapter.projects.all()
        for prj in prjs:
            prjdata = djitemdata.ProjectItemData(prj)
            prjitem = treemodel.TreeItem(prjdata, rootitem)
            for seq in prj.sequence_set.all():
                seqdata = djitemdata.SequenceItemData(seq)
                seqitem = treemodel.TreeItem(seqdata, prjitem)
                for shot in seq.shot_set.all():
                    shotdata = djitemdata.ShotItemData(shot)
                    shotitem = treemodel.TreeItem(shotdata, seqitem)
                    for typ in self.refobjinter.get_available_types_for_scene(shot):
                        typdata = treemodel.ListItemData([typ])
                        treemodel.TreeItem(typdata, shotitem)

        return treemodel.TreeModel(rootitem)
255429
def get_child_types(tree):
    
    child_types = defaultdict(list)
    for i, child in enumerate(tree):
        child_types[get_tree_type(child)].append(i)
    return child_types
969753
def inheritanceTree(self):
        
        inherits = self.inherits()
        while inherits:
            ischema = orb.system.schema(inherits)
            if not ischema:
                raise orb.errors.ModelNotFound(schema=inherits)

            yield ischema
            inherits = ischema.inherits()
1056542
def get_tree(cls, parent=None):
        
        if parent:
            depth = parent.get_depth() + 1
            results = [parent]
        else:
            depth = 1
            results = []
        cls._get_tree_recursively(results, parent, depth)
        return results
89156
def prj_create_dep(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        dep = self.create_dep(projects=[self.cur_prj])
        if dep:
            depdata = djitemdata.DepartmentItemData(dep)
            treemodel.TreeItem(depdata, self.prj_dep_model.root)
721400
def to_model
      lm = low.try(:to_model)
      hm = high.try(:to_model)
      wm = width.try(:to_model)
      model_type = type
      if @entry.at_xpath('./cda:uncertainRange', HQMF2::Document::NAMESPACES)
        model_type = 'IVL_PQ'
      end

      if generate_any_value?(lm, hm)
        # Generate AnyValue if the only elements in the range are AnyValues.
        HQMF::AnyValue.new
      elsif generate_value?(lm, hm)
        # Generate a singel value if both low and high are the same
        HQMF::Value.new(lm.type, nil, lm.value, lm.inclusive?, lm.derived?, lm.expression)
      else
        HQMF::Range.new(model_type, lm, hm, wm)
      end
    end
271711
def as_models(self, klass):
        """"""
        try:
            return [klass(mod) for mod in self.tree.reply.data.results.array[0].item]
        except AttributeError:
            return []
992350
def rebuild_tree(cls, session, tree_id):
        
        session.query(cls).filter_by(tree_id=tree_id)\
            .update({cls.left: 0, cls.right: 0, cls.level: 0})
        top = session.query(cls).filter_by(parent_id=None)\
            .filter_by(tree_id=tree_id).one()
        top.left = left = 1
        top.right = right = 2
        top.level = level = cls.get_default_level()

        def recursive(children, left, right, level):
            level = level + 1
            for i, node in enumerate(children):
                same_level_right = children[i - 1].right
                left = left + 1

                if i > 0:
                    left = left + 1
                if same_level_right:
                    left = same_level_right + 1

                right = left + 1
                node.left = left
                node.right = right
                parent = node.parent

                j = 0
                while parent:
                    parent.right = right + 1 + j
                    parent = parent.parent
                    j += 1

                node.level = level
                recursive(node.children, left, right, level)

        recursive(top.children, left, right, level)
992187
def create_asset_model(self, ):
        
        rootdata = treemodel.ListItemData(['Name'])
        rootitem = treemodel.TreeItem(rootdata)
        prjs = djadapter.projects.all()
        for prj in prjs:
            prjdata = djitemdata.ProjectItemData(prj)
            prjitem = treemodel.TreeItem(prjdata, rootitem)
            for atype in prj.atype_set.all():
                atypedata = djitemdata.AtypeItemData(atype)
                atypeitem = treemodel.TreeItem(atypedata, prjitem)
                for asset in atype.asset_set.filter(project=prj):
                    assetdata = djitemdata.AssetItemData(asset)
                    assetitem = treemodel.TreeItem(assetdata, atypeitem)
                    for typ in self.refobjinter.get_available_types_for_scene(asset):
                        typdata = treemodel.ListItemData([typ])
                        treemodel.TreeItem(typdata, assetitem)

        return treemodel.TreeModel(rootitem)
1335287
function CompareTreeModel(rootPath, fetchItems, root) {
		this.rootPath = rootPath;
		this.fetchItems = fetchItems;
		this.root = root;
	}
180002
def run(self):
        
        model = Model(self.fP, self.doc)
        self.doc.walkabout(model)
        return model
1293686
def get_previous(self):
        """"""

        prev_iter = self.model.iter_previous(self.iter)
        if prev_iter:
            return TreeModelRow(self.model, prev_iter)
301768
def seq_create_shot(self, *args, **kwargs):
        
        if not self.cur_seq:
            return
        shot = self.create_shot(sequence=self.cur_seq)
        if shot:
            shotdata = djitemdata.ShotItemData(shot)
            treemodel.TreeItem(shotdata, self.seq_shot_model.root)
1321266
def _generateInitialModel(self, output_model_type):
        
        logger().info("Generating initial model for BHMM using MLHMM...")
        from bhmm.estimators.maximum_likelihood import MaximumLikelihoodEstimator
        mlhmm = MaximumLikelihoodEstimator(self.observations, self.nstates, reversible=self.reversible,
                                           output=output_model_type)
        model = mlhmm.fit()
        return model
474248
def tree_to_gexf(tree:'BubbleTree') -> str:
    
    output_nodes, output_edges = '', ''

    def build_node(node:str) -> str:
        """Yield strings describing given node, recursively"""
        if tree.inclusions[node]:  # it's a powernode
            yield '<node id="{}" label="{}">'.format(node, node)
            yield '<nodes>'
            for sub in tree.inclusions[node]:
                yield from build_node(sub)
            yield '</nodes>'
            yield '</node>'
        else:  # it's a regular node
            yield '<node id="{}" label="{}"/>'.format(node, node)
        return

    # build full hierarchy from the roots
    output_nodes += '\n'.join('\n'.join(build_node(root)) for root in tree.roots)

    # # add the edges to the final graph
    for idx, (source, targets) in enumerate(tree.edges.items()):
        for target in targets:
            if source <= target:  # edges dict is complete. This avoid multiple edges.
                output_edges += '<edge id="{}" source="{}" target="{}" />\n'.format(idx, source, target)

    return GEXF_TEMPLATE.format(
        'directed' if tree.oriented else 'undirected',
        output_nodes,
        output_edges
    )
1267694
def get_tree_from_sha(self, ref):
        '''
        
        '''
        try:
            return self.repo.revparse_single(ref).tree
        except (KeyError, TypeError, ValueError, AttributeError):
            return None
538629
def referenceModel(self):
        
        model = orb.system.model(self.__reference)
        if not model:
            raise orb.errors.ModelNotFound(schema=self.__reference)
        return model