Retrieves nodes from root to leaf and returns leaf value.

@param feat    feature vector
@param root_id starting root index
@return leaf value
778956
@Override
  public final float getLeafValue(FVec feat, int root_id) {
    int pid = root_id;

    int pos = pid * NODE_SIZE + 4;
    int cleft_ = UnsafeUtils.get4(_nodes, pos);

    while (cleft_ != -1) {
      final int sindex_ = UnsafeUtils.get4(_nodes, pos + 8);
      final float fvalue = feat.fvalue((int) (sindex_ & ((1L << 31) - 1L)));
      if (Float.isNaN(fvalue)) {
        pid = (sindex_ >>> 31) != 0 ? cleft_ : UnsafeUtils.get4(_nodes, pos + 4);
      } else {
        final float value_ = UnsafeUtils.get4f(_nodes, pos + 12);
        pid = (fvalue < value_) ? cleft_ : UnsafeUtils.get4(_nodes, pos + 4);
      }
      pos = pid * NODE_SIZE + 4;
      cleft_ = UnsafeUtils.get4(_nodes, pos);
    }

    return UnsafeUtils.get4f(_nodes, pos + 12);
  }
1108780
public static STRtree featureCollectionToSTRtree( SimpleFeatureCollection collection ) {
        STRtree tree = new STRtree();
        SimpleFeatureIterator featureIterator = collection.features();
        while( featureIterator.hasNext() ) {
            SimpleFeature feature = featureIterator.next();
            Geometry geometry = (Geometry) feature.getDefaultGeometry();
            tree.insert(geometry.getEnvelopeInternal(), feature);
        }
        featureIterator.close();
        return tree;
    }
1348221
function getFeaturePropsHTML (feature) {
        var props = ['name', 'kind', 'kind_detail', 'id']; // show these properties first if available
        Object.keys(feature.properties) // show rest of proeprties alphabetized
            .sort()
            .forEach(function(p) {
                if (props.indexOf(p) === -1) {
                    props.push(p);
                }
            });

        var info = '<div class="featureTable">';
        props.forEach(function(p) {
            if (feature.properties[p]) {
                info += '<div class="featureRow"><div class="featureCell"><b>' + p + '</b></div>' +
                    '<div class="featureCell">' + feature.properties[p] + '</div></div>';
            }
        });
        info += '<div class="featureRow"><div class="featureCell"><b>scene layers</b></div>' +
                '<div class="featureCell">' + feature.layers.join('<br>') + '</div></div>';
        info += '</div>';
        return info;
    }
1242018
function(featureId) {
        var label = document.getElementById(featureId + this.LABEL_ID_SUFFIX);
        if (label) {
            this.textRoot.removeChild(label);
        }
        var outline = document.getElementById(featureId + this.LABEL_OUTLINE_SUFFIX);
        if (outline) {
            this.textRoot.removeChild(outline);
        }
    }
908970
private void createMissingSpanningRelations(SDocumentGraph graph,
    FastInverseMap<Long, SNode> nodeByRankID,
    TreeMap<Long, SToken> tokenByIndex,
    Map<String, ComponentEntry> componentForSpan,
    AtomicInteger numberOfRelations)
  {

    // add the missing spanning relations for each continuous span of the graph
    for (SSpan span : graph.getSpans())
    {
      long pre=1;
      RelannisNodeFeature featSpan = RelannisNodeFeature.extract(span);      
      ComponentEntry spanComponent = componentForSpan.get(span.getId());
      if (spanComponent != null && featSpan != null 
        && featSpan.getLeftToken() >= 0 && featSpan.getRightToken() >= 0)
      {
        for (long i = featSpan.getLeftToken(); i <= featSpan.getRightToken();
          i++)
        {
          SToken tok = tokenByIndex.get(i);
          if (tok != null)
          {
            boolean missing = true;
            List<SRelation<SNode, SNode>> existingRelations = graph.getRelations(span.getId(),
              tok.getId());
            if (existingRelations != null)
            {
              for (Relation e : existingRelations)
              {
                if (e instanceof SSpanningRelation)
                {
                  missing = false;
                  break;
                }
              }
            } // end if relations exist

            if (missing)
            {
              String type = "c";

              SLayer layer
                = findOrAddSLayer(spanComponent.getNamespace(), graph);

              createNewRelation(graph, span, tok, null, type,
                spanComponent.getId(), layer,
                pre++, nodeByRankID, numberOfRelations);
            }
          } // end if token exists
        } // end for each covered token index
      }
    } // end for each span
  }
827515
def get(self, node_id):
        
        return \
            self._nodes[_node.Root.ID].get(node_id) or \
            self._nodes[_node.Root.ID].get(self._sid_map.get(node_id))
1326396
private Feature getFeature(AnnotationFS annotation, FeatureDescription featureDescription) {
		if(feature == null) {
			String name = featureDescription.getName();
			feature = annotation.getType().getFeatureByBaseName(name);
		}
		return feature;
	}
1305425
function GetInitialRootInformation(filter_manager){

    var search = _create_manager('ontology');

    // Initial trigger over root terms.
    var rt = [];
    us.each(sd.root_terms, function(pair){
	rt.push(pair['id']);
    });
    search.set_ids(rt);

    // Ready the callback.
    search.register('search', function(resp, man){
	
	// Verify and extract initial response.
	if( resp && resp.documents() && resp.documents().length ){	    
	    global_root_docs = resp.documents();
	    console.log('Starting root gene product search with (' +
			global_root_docs.length + ') documents.');
	    GetRootCountInformation(global_root_docs, filter_manager);
	}else{
	    alert('failure to find root information');
	}
    });

    search.search();
}
1173530
public static Vector<Element> readFeatureNodes(String templateFile){
		Vector<Element> feaTypes = new Vector<Element>();
		
		try {
			// Read feature template file........
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			DocumentBuilder builder = factory.newDocumentBuilder();

			InputStream feaTplStream = new FileInputStream(templateFile);
			Document doc = builder.parse(feaTplStream);
		
			Element root = doc.getDocumentElement();
			NodeList childrent = root.getChildNodes();
			for (int i = 0; i < childrent.getLength(); i++)
				if (childrent.item(i) instanceof Element) {
					Element child = (Element) childrent.item(i);
					feaTypes.add(child);
				}
		}
		catch (Exception e){
			System.out.println("Reading featuretemplate fail " + e.getMessage());
			e.printStackTrace();			
		}
		
		return feaTypes;		
	}
1174715
def knearest(self, f_or_start, end=None, chrom=None, k=1):
        


        if end is not None:
            f = Feature(f_or_start, end, chrom=chrom)
        else:
            f = f_or_start

        DIST = 2000
        feats = filter_feats(self.find(f.start - DIST, f.end + DIST, chrom=f.chrom), f, k)
        if len(feats) >= k:
            return feats

        nfeats = k - len(feats)
        fleft = Feature(f.start - DIST, f.start, chrom=f.chrom)
        feats.extend(self.left(fleft, n=nfeats))

        fright = Feature(f.end, f.end + DIST, chrom=f.chrom)
        feats.extend(self.right(fright, n=nfeats))
        return filter_feats(feats, f, k)
935504
def runGetFeatureSet(self, id_):
        
        compoundId = datamodel.FeatureSetCompoundId.parse(id_)
        dataset = self.getDataRepository().getDataset(compoundId.dataset_id)
        featureSet = dataset.getFeatureSet(id_)
        return self.runGetRequest(featureSet)
629314
public void index(String rootViewUuid) {
    try (DbSession dbSession = dbClient.openSession(false)) {
      Map<String, String> viewAndProjectViewUuidMap = newHashMap();
      for (ComponentDto viewOrSubView : dbClient.componentDao().selectEnabledDescendantModules(dbSession, rootViewUuid)) {
        viewAndProjectViewUuidMap.put(viewOrSubView.uuid(), viewOrSubView.projectUuid());
      }
      index(dbSession, viewAndProjectViewUuidMap, true, Size.REGULAR);
    }
  }
999275
def get_features(subject_id):
    ""
    
    features_path = os.path.join(my_project,'base_features', subject_id, 'features.txt')
    feature_vector = np.loadtxt(features_path)
    
    return feature_vector
1261424
function getRoutes(feature) {
  const targetPath = `src/features/${feature}/route.js`; //utils.mapFeatureFile(feature, 'route.js');
  if (vio.fileNotExists(targetPath)) return [];
  const theAst = ast.getAst(targetPath);
  const arr = [];
  let rootPath = '';
  let indexRoute = null;

  traverse(theAst, {
    ObjectExpression(path) {
      const node = path.node;
      const props = node.properties;
      if (!props.length) return;
      const obj = {};
      props.forEach(p => {
        if (_.has(p, 'key.name') && !p.computed) {
          obj[p.key.name] = p;
        }
      });
      if (obj.path && obj.component) {
        // in a route config, if an object expression has both 'path' and 'component' property, then it's a route config
        arr.push({
          path: _.get(obj.path, 'value.value'), // only string literal supported
          component: _.get(obj.component, 'value.name'), // only identifier supported
          isIndex: !!obj.isIndex && _.get(obj.isIndex, 'value.value'), // suppose to be boolean
          node: {
            start: node.start,
            end: node.end,
          },
        });
      }
      if (obj.isIndex && obj.component && !indexRoute) {
        // only find the first index route
        indexRoute = {
          component: _.get(obj.component, 'value.name'),
        };
      }
      if (obj.path && obj.childRoutes && !rootPath) {
        rootPath = _.get(obj.path, 'value.value');
        if (!rootPath) rootPath = '$none'; // only find the first rootPath
      }
    },
  });
  const prjRootPath = getRootRoutePath();
  if (rootPath === '$none') rootPath = prjRootPath;
  else if (!/^\//.test(rootPath)) rootPath = prjRootPath + '/' + rootPath;
  rootPath = rootPath.replace(/\/+/, '/');
  arr.forEach(item => {
    if (!/^\//.test(item.path)) {
      item.path = (rootPath + '/' + item.path).replace(/\/+/, '/');
    }
  });
  if (indexRoute) {
    indexRoute.path = rootPath;
    arr.unshift(indexRoute);
  }
  return arr;
}
1005798
def getFeatureById(self, featureId):
        
        sql = "SELECT * FROM FEATURE WHERE id = ?"
        query = self._dbconn.execute(sql, (featureId,))
        ret = query.fetchone()
        if ret is None:
            return None
        return sqlite_backend.sqliteRowToDict(ret)
676023
private String getFeatureString(Set<String> featureNames) {
        StringBuilder featureBuilder = new StringBuilder();

        if (featureNames != null) {
            Iterator<String> iter = featureNames.iterator();
            while (iter.hasNext()) {
                featureBuilder.append(iter.next());
                if (iter.hasNext())
                    featureBuilder.append(',');
            }
        }
        return featureBuilder.toString();
    }
780438
def _get_feature_weights_dict(feature_weights,  # type: FeatureWeights
                              feature_fn        # type: Optional[Callable[[str], str]]
                              ):
    # type: (...) -> Dict[str, Tuple[float, Tuple[str, int]]]
    
    return {
        # (group, idx) is an unique feature identifier, e.g. ('pos', 2)
        feat_name: (fw.weight, (group, idx))
        for group in ['pos', 'neg']
        for idx, fw in enumerate(getattr(feature_weights, group))
        for feat_name in _get_features(fw.feature, feature_fn)
    }