Process texture
@param  {Texture} map Map to process
@return {Integer}     Index of the processed texture in the "textures" array
196096
function processTexture(map) {
      if (cachedData.textures.has(map)) {
        return cachedData.textures.get(map);
      }

      if (!outputJSON.textures) {
        outputJSON.textures = [];
      }

      var gltfTexture = {
        sampler: processSampler(map),
        source: processImage(map.image, map.format, map.flipY)
      };

      outputJSON.textures.push(gltfTexture);

      var index = outputJSON.textures.length - 1;
      cachedData.textures.set(map, index);

      return index;
    }
443844
protected void processMap(final URI map) {
        assert !map.isAbsolute();
        this.map = map;
        currentFile = job.tempDirURI.resolve(map);
        // parse
        logger.info("Processing " + currentFile);
        final Document doc;
        try {
            logger.debug("Reading " + currentFile);
            doc = builder.parse(new InputSource(currentFile.toString()));
        } catch (final SAXException | IOException e) {
            logger.error("Failed to parse " + currentFile, e);
            return;
        }

        logger.debug("Split branches and generate copy-to");
        splitBranches(doc.getDocumentElement(), Branch.EMPTY);
        logger.debug("Filter map");
        filterBranches(doc.getDocumentElement());
        logger.debug("Rewrite duplicate topic references");
        rewriteDuplicates(doc.getDocumentElement());
        logger.debug("Filter topics and generate copies");
        generateCopies(doc.getDocumentElement(), Collections.emptyList());
        logger.debug("Filter existing topics");
        filterTopics(doc.getDocumentElement(), Collections.emptyList());

        logger.debug("Writing " + currentFile);
        Result result = null;
        try {
            Transformer serializer = TransformerFactory.newInstance().newTransformer();
            result = new StreamResult(currentFile.toString());
            serializer.transform(new DOMSource(doc), result);
        } catch (final TransformerConfigurationException | TransformerFactoryConfigurationError e) {
            throw new RuntimeException(e);
        } catch (final TransformerException e) {
            logger.error("Failed to serialize " + map.toString() + ": " + e.getMessage(), e);
        } finally {
            try {
                close(result);
            } catch (final IOException e) {
                logger.error("Failed to close result stream for " + map.toString() + ": " + e.getMessage(), e);
            }
        }
    }
71160
function (map, array) {
                if (map == null)
                    return;
                for (var i in map) {
                    var item = map[i];
                    var key = item.key;
                    if (map == this._objectKeys) {
                        key[this._metaDataName] = null;
                        delete item.key[this._metaDataName];
                    }
                    while (item) {
                        array.push(item.value);
                        item.value = null;
                        item.key = null;
                        var next = item.next;
                        item.next = null;
                        item = next;
                    }
                    map[i] = null;
                    delete map[i];
                }
            }
1253570
public RFuture<Texture> textureAsync () {
    return state.map(new Function<Image,Texture>() {
      public Texture apply (Image image) { return texture(); }
    });
  }
1161581
@Modified
    protected void modified(Map<String, Object> map) {

        // Build up the list of filters in a local list, then convert that to an array
        // and assign to the static reference. This is done to avoid creating an iterator
        // in the main path in `process`.
        List<SpanFilter> filters = new ArrayList<SpanFilter>();

        /*
         * Removing filter processing until microprofile spec for it is approved. Expect to add this code
         * back in in 1Q18 - smf
         */
//        processFilters(filters, map, configAdmin, "excludeSpans", ExcludeFilter.class);
//        processFilters(filters, map, configAdmin, "includeSpans", IncludeFilter.class);

        SpanFilter[] finalFilters = new SpanFilter[filters.size()];
        filters.toArray(finalFilters);

        allFilters = finalFilters;
    }
224794
public static <K, V> Map<K, V> asDeepMap(Map<K, V> map) {
		return from(map).deepLook().map();
	}
604944
function projectEnvironmentMapGPU(renderer, envMap) {
    var shTexture = new Texture2D({
        width: 9,
        height: 1,
        type: Texture.FLOAT
    });
    var pass = new Pass({
        fragment: projectEnvMapShaderCode
    });
    pass.material.define('fragment', 'TEXTURE_SIZE', envMap.width);
    pass.setUniform('environmentMap', envMap);

    var framebuffer = new FrameBuffer();
    framebuffer.attach(shTexture);
    pass.render(renderer, framebuffer);

    framebuffer.bind(renderer);
    // TODO Only chrome and firefox support Float32Array
    var pixels = new vendor.Float32Array(9 * 4);
    renderer.gl.readPixels(0, 0, 9, 1, Texture.RGBA, Texture.FLOAT, pixels);

    var coeff = new vendor.Float32Array(9 * 3);
    for (var i = 0; i < 9; i++) {
        coeff[i * 3] = pixels[i * 4];
        coeff[i * 3 + 1] = pixels[i * 4 + 1];
        coeff[i * 3 + 2] = pixels[i * 4 + 2];
    }
    framebuffer.unbind(renderer);

    framebuffer.dispose(renderer);
    pass.dispose(renderer);
    return coeff;
}
605096
function processMaterial(material) {
      if (cachedData.materials.has(material)) {
        return cachedData.materials.get(material);
      }

      if (!outputJSON.materials) {
        outputJSON.materials = [];
      }

      if (material.isShaderMaterial) {
        console.warn('GLTFExporter: THREE.ShaderMaterial not supported.');
        return null;
      }

      // @QUESTION Should we avoid including any attribute that has the default value?
      var gltfMaterial = {
        pbrMetallicRoughness: {}
      };

      if (material.isMeshBasicMaterial) {
        gltfMaterial.extensions = { KHR_materials_unlit: {} };

        extensionsUsed['KHR_materials_unlit'] = true;
      } else if (!material.isMeshStandardMaterial) {
        console.warn(
          'GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.'
        );
      }

      // pbrMetallicRoughness.baseColorFactor
      var color = material.color.toArray().concat([material.opacity]);

      if (!equalArray(color, [1, 1, 1, 1])) {
        gltfMaterial.pbrMetallicRoughness.baseColorFactor = color;
      }

      if (material.isMeshStandardMaterial) {
        gltfMaterial.pbrMetallicRoughness.metallicFactor = material.metalness;
        gltfMaterial.pbrMetallicRoughness.roughnessFactor = material.roughness;
      } else if (material.isMeshBasicMaterial) {
        gltfMaterial.pbrMetallicRoughness.metallicFactor = 0.0;
        gltfMaterial.pbrMetallicRoughness.roughnessFactor = 0.9;
      } else {
        gltfMaterial.pbrMetallicRoughness.metallicFactor = 0.5;
        gltfMaterial.pbrMetallicRoughness.roughnessFactor = 0.5;
      }

      // pbrMetallicRoughness.metallicRoughnessTexture
      if (material.metalnessMap || material.roughnessMap) {
        if (material.metalnessMap === material.roughnessMap) {
          gltfMaterial.pbrMetallicRoughness.metallicRoughnessTexture = {
            index: processTexture(material.metalnessMap)
          };
        } else {
          console.warn(
            'THREE.GLTFExporter: Ignoring metalnessMap and roughnessMap because they are not the same Texture.'
          );
        }
      }

      // pbrMetallicRoughness.baseColorTexture
      if (material.map) {
        gltfMaterial.pbrMetallicRoughness.baseColorTexture = {
          index: processTexture(material.map)
        };
      }

      if (
        material.isMeshBasicMaterial ||
        material.isLineBasicMaterial ||
        material.isPointsMaterial
      ) {
      } else {
        // emissiveFactor
        var emissive = material.emissive
          .clone()
          .multiplyScalar(material.emissiveIntensity)
          .toArray();

        if (!equalArray(emissive, [0, 0, 0])) {
          gltfMaterial.emissiveFactor = emissive;
        }

        // emissiveTexture
        if (material.emissiveMap) {
          gltfMaterial.emissiveTexture = {
            index: processTexture(material.emissiveMap)
          };
        }
      }

      // normalTexture
      if (material.normalMap) {
        gltfMaterial.normalTexture = {
          index: processTexture(material.normalMap)
        };

        if (material.normalScale.x !== -1) {
          if (material.normalScale.x !== material.normalScale.y) {
            console.warn(
              'THREE.GLTFExporter: Normal scale components are different, ignoring Y and exporting X.'
            );
          }

          gltfMaterial.normalTexture.scale = material.normalScale.x;
        }
      }

      // occlusionTexture
      if (material.aoMap) {
        gltfMaterial.occlusionTexture = {
          index: processTexture(material.aoMap)
        };

        if (material.aoMapIntensity !== 1.0) {
          gltfMaterial.occlusionTexture.strength = material.aoMapIntensity;
        }
      }

      // alphaMode
      if (material.transparent || material.alphaTest > 0.0) {
        gltfMaterial.alphaMode = material.opacity < 1.0 ? 'BLEND' : 'MASK';

        // Write alphaCutoff if it's non-zero and different from the default (0.5).
        if (material.alphaTest > 0.0 && material.alphaTest !== 0.5) {
          gltfMaterial.alphaCutoff = material.alphaTest;
        }
      }

      // doubleSided
      if (material.side === THREE.DoubleSide) {
        gltfMaterial.doubleSided = true;
      }

      if (material.name !== '') {
        gltfMaterial.name = material.name;
      }

      if (Object.keys(material.userData).length > 0) {
        gltfMaterial.extras = serializeUserData(material);
      }

      outputJSON.materials.push(gltfMaterial);

      var index = outputJSON.materials.length - 1;
      cachedData.materials.set(material, index);

      return index;
    }
1353758
function(map) {
        /**
         * If nothing to do with resolutions has been set, assume a single
         * resolution determined by ratio*extent/size - if an image has a
         * pixel aspect ratio different than one (as calculated above), the
         * image will be stretched in one dimension only.
         */
        if( this.options.maxResolution == null ) {
            this.options.maxResolution = this.aspectRatio *
                                         this.extent.getWidth() /
                                         this.size.w;
        }
        OpenLayers.Layer.prototype.setMap.apply(this, arguments);
    }
956942
def parse_map_Ks(self):
        """"""
        Kd = os.path.join(self.dir, " ".join(self.values[1:]))
        self.this_material.set_texture_specular_color(Kd)
900439
public static Map<String, String> mapStringToMap(String map) {
    String[] m = map.split("[,;]");
    Map<String, String> res = new HashMap<String, String>();
    for (String str : m) {
      int index = str.lastIndexOf('=');
      String key = str.substring(0, index);
      String val = str.substring(index + 1);
      res.put(key.trim(), val.trim());
    }
    return res;
  }
400729
function (map) {
            var key;
            for (key in map) {
                if (map.hasOwnProperty(key)) {
                    this._init(key, map[key]);
                }
            }
            return this;
        }
934735
private void processItemIdIndexMapping(final Map<String, List<Integer>> map, final List<Integer> rowIndex,
			final TreeItemModel treeModel, final Set<String> expandedRows) {

		// Add current item
		String id = treeModel.getItemId(rowIndex);
		if (id == null) {
			return;
		}
		map.put(id, rowIndex);

		// Check row is expandable
		if (!treeModel.isExpandable(rowIndex)) {
			return;
		}

		// Check has children
		if (!treeModel.hasChildren(rowIndex)) {
			return;
		}

		// Add children if expanded ROWS null or contains ID
		boolean addChildren = expandedRows == null || expandedRows.contains(id);
		if (!addChildren) {
			return;
		}

		// Get actual child count
		int children = treeModel.getChildCount(rowIndex);
		if (children == 0) {
			// Could be there are no children even though hasChildren returned true
			return;
		}

		// Add children by processing each child row
		for (int i = 0; i < children; i++) {
			// Add next level
			List<Integer> nextRow = new ArrayList<>(rowIndex);
			nextRow.add(i);
			processItemIdIndexMapping(map, nextRow, treeModel, expandedRows);
		}
	}
877127
function(map) {
        var tileQueue = this.tileQueue[map.id];
        var limit = this.tilesPerFrame;
        var animating = map.zoomTween && map.zoomTween.playing;
        while (!animating && tileQueue.length && limit) {
            tileQueue.shift().draw(true);
            --limit;
        }
    }
607742
function(map) {
    var self = this;
    this.options.map = map;

    // Add cartodb logo
    if (this.options.cartodb_logo != false)
      cdb.geo.common.CartoDBLogo.addWadus({ left:8, bottom:8 }, 0, map._container);

    this.__update(function() {
      // if while the layer was processed in the server is removed
      // it should not be added to the map
      var id = L.stamp(self);
      if (!map._layers[id]) {
        return;
      }

      L.TileLayer.prototype.onAdd.call(self, map);
      self.fire('added');
      self.options.added = true;
    });
  }
1194186
function() {
        var min_size = Infinity;
        var index = null;
        for (var i = 0; i < this.bound_textures.length; i++) {
            var t = this.bound_textures[i];
            if (t.size < min_size) {
                min_size = t.size;
                index = i;
            }
        }
        return index;
    }
26908
function preprocessSourceMap(sourceMap) {
      if (typeof sourceMap === 'string') {
        sourceMap = JSON.parse(sourceMap);
      }
      if (sourceMap && Array.isArray(sourceMap.sources)) {
        sourceMap.sources = sourceMap.sources.map(sourceUrl =>
          urlTools.resolveUrl(assetGraph.root, sourceUrl.replace(/^\//, ''))
        );
      }
      return sourceMap;
    }