mappature delle richieste
173099
public function map($method, $action, $callback){
		$route = new Route($method, $action, $callback);
		array_push($this->routes, $route);
		return $route;
	}
18793
def map(self, width, height):
        
        template = ti.load(os.path.join(script_dir, 'assets', 'template.tmx'))['map0']
        #template.set_view(0, 0, template.px_width, template.px_height)
        template.set_view(0, 0, width*template.tw, height*template.th)

        # TODO: Save the generated map.
        #epoch = int(time.time())
        #filename = 'map_' + str(epoch) + '.tmx'

        # Draw borders
        border_x = template.cells[width]
        for y in xrange(0,height+1):
            border_x[y].tile = template.cells[0][0].tile

        for x in xrange(0,width):
            template.cells[x][height].tile = template.cells[0][0].tile

        # Start within borders
        #self.recursive_division(template.cells, 3, (template.px_width/template.tw)-1, (template.px_height/template.th)-1, 0, 0)
        self.recursive_division(template.cells, 3, width, height, 0, 0)

        return template
1273627
public function automap() {
        $map = array();

        // Shallow copy.
        $collectionfrom = $this->get_collection_from();
        $collectionto = $this->get_collection_to();

        // Find mappings.
        foreach ($collectionfrom as $keyfrom => $compfrom) {
            foreach ($collectionto as $keyto => $compto) {
                if ($compfrom->get('idnumber') == $compto->get('idnumber')) {
                    $map[$compfrom->get('id')] = $compto->get('id');
                    unset($collectionfrom[$keyfrom]);
                    unset($collectionto[$keyto]);
                    break;
                }
            }
        }

        $this->mappings = $map;
    }
663475
def setup_map(self,londel=1.,latdel=1.,*args,**kwargs):
        
        
        s = kwargs['s'] if kwargs.has_key('s') else 25
        edgecolor = kwargs['edgecolor'] if kwargs.has_key('edgecolor') else 'none'
        bathy = kwargs.get('bathy',not kwargs.get('nobathy',False))
        
        #Plot Sequence
        ##############
        self.drawcoastlines()
        if bathy : cs=self.drawbathy(**kwargs)
        
        self.drawparallels(np.arange(np.floor(self.limit[0]), np.ceil(self.limit[2]), latdel), labels=[1, 0, 0, 0])
        self.drawmeridians(np.arange(np.floor(self.limit[1]), np.ceil(self.limit[3]), londel), labels=[0, 0, 0, 1])
                
#        if len(args) == 3 :
#            lon=args[0]
#            lat=args[1]
#            z=args[2]
#            if np.size(z) > 1 : self.scatter(lon,lat,z,s=s,edgecolor=edgecolor)
#            else : 
#                if type(z) != type(str()) : z = '.k'
#                self.plot(lon,lat,z,ms=s)*
#        if len(args) == 2 :
#            lon=args[0]
#            lat=args[1]
#            if np.size(z) > 1 : self.plot(lon,lat,z,s=s,edgecolor=edgecolor)
#            else : 
#                if type(z) != type(str()) : z = '.k'
#                self.plot(lon,lat,z,ms=s)
        return cs if bathy else None
566489
public function map() {
		$modules = Module::all();
		
		//dd($modules);
		
		foreach ($modules as $module) {
			$routes = $module->routes;
			$routesFolder = 'routes'.DIRECTORY_SEPARATOR;
			
			if ($routes) {
				foreach ($routes as $route) {
					if (strrpos($route, $routesFolder."web")) {
						
						$this->mapWebRoute($route, $module->namespace);
					}
					elseif (strrpos($route, $routesFolder."api")) {
						
						$this->mapApiRoute($route, $module->namespace);
					}
				}
			}
		}
	}
1051812
def map(self,index_name, index_type, map_value):
        '''
        
        '''
        request = self.session
        url = 'http://%s:%s/%s/%s/_mapping' % (self.host, self.port, index_name, index_type)
        content = { index_type : { 'properties' : map_value } }
        if self.verbose:
            print content
        response = request.put(url,content)
        return response
1131813
def map_data(self):
        
        with open(self.src_file, "r") as f:
            for line in f:
                cols = line.split(',')
                print(cols)
468938
private function _generateMappings()
    {
        if (!isset($this->_mappings) && $this->_map->mappings) {
            //up to date, nothing to do
            return;
        }
        $this->_mappingsChanged = false;
        if (!count($this->_mappings)) {
            return '';
        }

        foreach ($this->_mappings as $m) {
            if ($m['originalSource'] && !in_array($m['originalSource'], $this->_map->sources)) {
                $this->_map->sources[] = $m['originalSource'];
            }
        }

        $this->_map->names = array();
        foreach ($this->_mappings as $m) {
            if ($m['originalName'] && !in_array($m['originalName'], $this->_map->names)) {
                $this->_map->names[] = $m['originalName'];
            }
        }

        // group mappings by generated line number.
        $groupedMap = $groupedMapEncoded = array();
        foreach ($this->_mappings as $m) {
            $groupedMap[$m['generatedLine']][] = $m;
        }
        ksort($groupedMap);

        $lastGeneratedLine = $lastOriginalSourceIndex = $lastOriginalNameIndex = $lastOriginalLine = $lastOriginalColumn = 0;

        foreach ($groupedMap as $lineNumber => $lineMap) {
            while (++$lastGeneratedLine < $lineNumber) {
                $groupedMapEncoded[] = ';';
            }

            $lineMapEncoded = array();
            $lastGeneratedColumn = 0;

            foreach ($lineMap as $m) {
                $mapEncoded = Kwf_SourceMaps_Base64VLQ::encode($m['generatedColumn'] - $lastGeneratedColumn);
                $lastGeneratedColumn = $m['generatedColumn'];

                // find the index
                if ($m['originalSource']) {
                    $index = array_search($m['originalSource'], $this->_map->sources);
                    $mapEncoded .= Kwf_SourceMaps_Base64VLQ::encode($index - $lastOriginalSourceIndex);
                    $lastOriginalSourceIndex = $index;

                    // lines are stored 0-based in SourceMap spec version 3
                    $mapEncoded .= Kwf_SourceMaps_Base64VLQ::encode($m['originalLine'] - 1 - $lastOriginalLine);
                    $lastOriginalLine = $m['originalLine'] - 1;

                    $mapEncoded .= Kwf_SourceMaps_Base64VLQ::encode($m['originalColumn'] - $lastOriginalColumn);
                    $lastOriginalColumn = $m['originalColumn'];

                    if ($m['originalName']) {
                        $index = array_search($m['originalName'], $this->_map->names);
                        $mapEncoded .= Kwf_SourceMaps_Base64VLQ::encode($index - $lastOriginalNameIndex);
                        $lastOriginalNameIndex = $index;
                    }
                }

                $lineMapEncoded[] = $mapEncoded;
            }

            $groupedMapEncoded[] = implode(',', $lineMapEncoded).';';
        }

        $this->_map->mappings = rtrim(implode($groupedMapEncoded), ';');
    }
807940
def CrearAjusteCredito(self, 
               datos_adicionales=None,              # unificado, contrato, papel
               concepto_importe_iva_0=None,         # unificado, contrato, papel
               importe_ajustar_iva_0=None,          # unificado, contrato, papel
               concepto_importe_iva_105=None,       # unificado, contrato, papel
               importe_ajustar_iva_105=None,        # unificado, contrato, papel
               concepto_importe_iva_21=None,        # unificado, contrato, papel
               importe_ajustar_iva_21=None,         # unificado, contrato, papel
               diferencia_peso_neto=None,           # unificado
               diferencia_precio_operacion=None,    # unificado
               cod_grado=None,                      # unificado
               val_grado=None,                      # unificado  
               factor=None,                         # unificado
               diferencia_precio_flete_tn=None,     # unificado
               **kwargs
               ):
        ""

        self.ajuste['ajusteCredito'] = {
            'diferenciaPesoNeto': diferencia_peso_neto,
            'diferenciaPrecioOperacion': diferencia_precio_operacion,
            'codGrado': cod_grado,
            'valGrado': val_grado,
            'factor': factor,
            'diferenciaPrecioFleteTn': diferencia_precio_flete_tn,
            'datosAdicionales': datos_adicionales,
            'opcionales': None,
            'conceptoImporteIva0': concepto_importe_iva_0,
            'importeAjustarIva0': importe_ajustar_iva_0,
            'conceptoImporteIva105': concepto_importe_iva_105,
            'importeAjustarIva105': importe_ajustar_iva_105,
            'conceptoImporteIva21': concepto_importe_iva_21,
            'importeAjustarIva21': importe_ajustar_iva_21,
            'deducciones': [],
            'retenciones': [],
            'percepciones': [],
            'certificados': [],
            }
        # vinculación con AgregarOpcional:
        self.opcionales = self.ajuste['ajusteCredito']['opcionales']
        # vinculación con AgregarRetencion y AgregarDeduccion
        self.deducciones = self.ajuste['ajusteCredito']['deducciones']
        self.retenciones = self.ajuste['ajusteCredito']['retenciones']
        # para LSG:
        self.percepciones = self.ajuste['ajusteCredito']['percepciones']
        # para compatibilidad con AgregarCertificado (WSLPGv1.17)
        self.liquidacion = self.ajuste['ajusteCredito']
        return True
495354
protected function map() {
		/** @var string|null $sample */
		$sample = $this->f('dfSample');
		/** @var string[] $values */
		$values = [self::_DEFAULT, self::$UCFIRST, self::$UCWORDS, self::$UPPERCASE, self::$LOWERCASE];
		/** @var string[] $labels */
		$labels = [
			'As Is'
			, 'Uppercase first letter'
			, 'Uppercase Each Word\'s First Letter'
			,'UPPERCASE'
			,'lowercase'
		];
		return array_combine(
			$values
			,!$sample
			? $labels
			: array_map(function($value, $label) use($sample) {
				return sprintf('%s (%s)', self::apply($sample, $value), $label);
			}, $values, $labels)
			//: df_map([__CLASS__, 'apply'], $keys, [], $sample)
		);
	}
783032
private static Map<String, String> mapCustomInfo(CustomInfoType ciType){
        Map<String, String> customInfo = new HashMap<String, String>();
        if (ciType != null){
            for (CustomInfoType.Item item : ciType.getItem()) {
                customInfo.put(item.getKey(), item.getValue());
            }
        }
        return customInfo;
    }
227310
def estimate_map(interface, state, label, inp):
    """"""
    out = interface.output(0)
    centers = {}
    for row in inp:
        row = row.strip().split(state["delimiter"])
        if len(row) > 1:
            x = [(0 if row[i] in state["missing_vals"] else float(row[i])) for i in state["X_indices"]]
            cluster = min((state['dist'](c, x), i) for i, c in state['centers'])[1]
            vertex = state['create'](x, 1.0)
            centers[cluster] = vertex if cluster not in centers else state["update"](centers[cluster], vertex)

    for cluster, values in centers.iteritems():
        out.add(cluster, values)
1243348
public Map<RDFName, List<DCField>> getMap() {
        Map<RDFName, List<DCField>> map = new HashMap<RDFName, List<DCField>>(15);

        if (m_titles != null) map.put(DC.TITLE, m_titles);
        if (m_creators != null) map.put(DC.CREATOR, m_creators);
        if (m_subjects != null) map.put(DC.SUBJECT, m_subjects);
        if (m_descriptions != null) map.put(DC.DESCRIPTION, m_descriptions);
        if (m_publishers != null) map.put(DC.PUBLISHER, m_publishers);
        if (m_contributors != null) map.put(DC.CONTRIBUTOR, m_contributors);
        if (m_dates != null) map.put(DC.DATE, m_dates);
        if (m_types != null) map.put(DC.TYPE, m_types);
        if (m_formats != null) map.put(DC.FORMAT, m_formats);
        if (m_identifiers != null) map.put(DC.IDENTIFIER, m_identifiers);
        if (m_sources != null) map.put(DC.SOURCE, m_sources);
        if (m_languages != null) map.put(DC.LANGUAGE, m_languages);
        if (m_relations != null) map.put(DC.RELATION, m_relations);
        if (m_coverages != null) map.put(DC.COVERAGE, m_coverages);
        if (m_rights != null) map.put(DC.RIGHTS, m_rights);

        return map;
    }
1206840
function mapFiles(files, relative, required) {
  if (!files) {
    return []
  }

  if (Array.isArray(files) === false) {
    files = [files]
  }

  return files.map(f => ({
    file: resolvePath(relative, f),
    required: required
  }))
}
289392
def type_map(gtype, fn):
    """"""

    cb = ffi.callback('VipsTypeMap2Fn', fn)
    return vips_lib.vips_type_map(gtype, cb, ffi.NULL, ffi.NULL)
23619
function map(cov) {
  var ret = {
      instrumentation: 'node-jscoverage'
    , sloc: 0
    , hits: 0
    , misses: 0
    , coverage: 0
    , files: []
  };

  for (var filename in cov) {
    var data = coverage(filename, cov[filename]);
    ret.files.push(data);
    ret.hits += data.hits;
    ret.misses += data.misses;
    ret.sloc += data.sloc;
  }

  ret.files.sort(function(a, b) {
    return a.filename.localeCompare(b.filename);
  });

  if (ret.sloc > 0) {
    ret.coverage = (ret.hits / ret.sloc) * 100;
  }

  return ret;
}
1256871
function simpleMap(map, lvls, opts, type, ext, callback) {
    opts = utils.clone(opts);
    lvls--;
    if(lvls < 1) {
        opts.simple = false;
        opts.recursive = true;
        opts.type = type;
        opts.ext = ext;
    }
    var folders = map.__filter({type:'directory'}, true);
    var count = folders.length;
    var errs = [];

    function end(err) {
        if(err) {
            errs.push(err);
        }
        if(--count !== 0) {
            return;
        }
        if(errs.length) {
            callback(errs);
            return;
        }
        callback(null, map);
    }
    folders.forEach(function (folder) {
        folder.__map(opts, function (err, fMap) {
            if(err) {
                end(err);
                return;
            }
            if(lvls < 1) {
                end();
            } else {
                simpleMap(fMap, lvls, opts, type, ext, end);
            }
        });
    });
}