return the layer number by index taking into
account the hidden layers.
353289
function(index) {
    var layers = [];
    for(var i = 0; i < this.layers.length; ++i) {
      var layer = this.layers[i];
      if(this._isLayerVisible(layer)) {
        layers.push(i);
      }
    }
    if (index >= layers.length) {
      return -1;
    }
    return +layers[index];
  }
492550
def get_image_layer(self, image_id):
        """"""
        return self._http_call(self.IMAGE_JSON, get, image_id=image_id)
438072
public int findIndexByLayerId(int id) {
        final ChildDrawable[] layers = mLayerState.mChildren;
        final int N = mLayerState.mNum;
        for (int i = 0; i < N; i++) {
            final ChildDrawable childDrawable = layers[i];
            if (childDrawable.mId == id) {
                return i;
            }
        }

        return -1;
    }
278805
def layered(self):
        """"""
        result = []
        for layer in self._layered:
            nxt = []
            for name in layer:
                nxt.append((name, self.all_images[name]))
            result.append(nxt)
        return result
852840
def get_layer_by_name(self, name):
        
        try:
            return self.layernames[name]
        except KeyError:
            msg = 'Layer "{0}" not found.'
            logger.debug(msg.format(name))
            raise ValueError
393189
def get_index_nested(x, i):
    
    for ind in range(len(x)):
        if i == x[ind]:
            return ind
    return -1
782870
def get_probs(self, x):
    
    name = self._get_softmax_name()

    return self.get_layer(x, name)
348026
def get_layer(self, class_: Type[L], became: bool=True) -> L:
        

        try:
            return self._index[class_][0]
        except KeyError:
            if became:
                return self._transformed[class_][0]
            else:
                raise
690743
def indexXY(self, index):
        
        rect = self.visualRect(index)
        return rect.x(), rect.y()
668036
def get_index_node(self, idx):
        ''''''
        idx = self.node_index.index(idx)
        return self.nodes[idx]
369126
private int rasterLayerCount() {
		int rasterLayerCount = 0;
		for (int index = 0; index < mapInfo.getLayers().size(); index++) {
			if (layers.get(index) instanceof RasterLayer) {
				rasterLayerCount++;
			}
		}
		return rasterLayerCount;
	}
613759
def findLayer( self, layerName ):
        
        for layer in self._layers:
            if ( layer.name() == layerName ):
                return layer
        return None
754146
private int getNumRepeats(int level) {
		int size = 1;
		// Return 1 for illegally high level
		if(level < getNumLevels()) {
			for(Axis axis : axes.subList(level, getNumLevels())) {
				size *= axis.getOrder();
			}
		}
		return size;
	}
973062
public Layer getOutputLayer() {
        Layer ret = getLayers()[getLayers().length - 1];
        if (ret instanceof FrozenLayerWithBackprop) {
            ret = ((FrozenLayerWithBackprop) ret).getInsideLayer();
        }
        return ret;
    }
912980
def _getLayer(self, name, **kwargs):
        
        for glyph in self.layers:
            if glyph.layer.name == name:
                return glyph
        raise ValueError("No layer named '%s' in glyph '%s'."
                         % (name, self.name))
809173
def get_index(self):
        '''  '''
        ifreq = struct.pack('16si', self.name, 0)
        res = fcntl.ioctl(sockfd, SIOCGIFINDEX, ifreq)
        return struct.unpack("16si", res)[1]
55762
function findLayers(layers, names) {
  if (!defined(names)) {
    // If a list of layers is not specified, we're using all layers.
    return layers;
  }
  return names.split(",").map(function(id) {
    return findLayer(layers, id);
  });
}