map : map(list, fn)
Iterates through `list` (an array or an object).

var map = require('dom101/map');
var text = require('dom101/text');

map(qa('.button'), function (el) {
return text(el);
});
516081
function map (list, fn) {
  var i
  var len = list.length
  var result = []
  var idx

  if (typeof len === 'number') {
    for (i = 0; i < len; i++) {
      result.push(fn(list[i], i))
    }
  } else {
    idx = 0
    for (i in list) {
      if (list.hasOwnProperty(i)) {
        result.push(fn(list[i], i, idx++))
      }
    }
  }

  return result
}
512578
function mapify(elements) {
    var result = {};
    for (var i = 0; i+1 < elements.length;) {
        result[elements[i++]] = elements[i++];
    }
    return result;
}
1286420
function map ( input, inputMin, inputMax, outputMin, outputMax, clamp, ease ) {
    input = ( input - inputMin ) / ( inputMax - inputMin );
    if ( ease ) {
        input = ease(input);
    } 
    var output = input * ( outputMax - outputMin ) + outputMin;
    if ( !!clamp ) {
        if ( outputMax < outputMin ) {
            if ( output < outputMax ) {
                output = outputMax;
            }
            else if ( output > outputMin ) {
                output = outputMin;
            }
        } else {
            if ( output > outputMax ) {
                output = outputMax;
            }
            else if ( output < outputMin ) {
                output = outputMin;
            }
        }
    }
    return output;
}
33291
function(object) {
		var result = [];
		for (var def in object) {
			if (!gui.Type.isFunction(object[def])) {
				result.push(def);
			}
		}
		return result;
	}
728901
@MapMethod
    public Map<String,Object> iterate(Map<String,Object> o, final ScriptFunction f){
        return Objects.iterate(o,new Closure<ObjectIterator.IterateBean, Object>() {
            @Override
            public Object call(ObjectIterator.IterateBean input) {
                return f.call(Objects.newHashMap(String.class,Object.class,
                        "path",input.getPath(),
                        "value",input.getValue(),
                        "name",input.getName()
                        ));
            }
        });
    }
1085271
function map (f, arr) {
    var result = [], i, n;
    for (i = 0, n = arr.length; i < n; i++) {
      result.push(f(arr[i]));
    }
    return result;
  }
530626
function mapObject(key, value) {
		var c = key.charAt(0);
		if (c === "_" || c === "$") {
			return undefined;
		} else if (isArray(this) && key.match(INTRINSIC)) {
			return undefined;
		} else if (isType(value)) {
			return parse(value);
		} else if (gui.Type.isComplex(value)) {
			switch (value.constructor) {
				case Object:
				case Array:
					return value;
			}
			return undefined;
		} else {
			if (isType(this)) {
				var base = this.constructor.prototype;
				var desc = Object.getOwnPropertyDescriptor(base, key);
				if (desc && (desc.set || desc.get)) {
					return undefined;
				}
			}
			return value;
		}
	}
1143790
function mapToObject(input, mapFunc) {
    const obj = {};
    for (const element of input) {
        obj[element] = mapFunc(element);
    }
    return obj;
}
888193
function (fn) {
      var items = this.items;
      var sorted = lazy.sortObject(this.keyMap, {prop: undefined, get: fn});
      var keys = Object.keys(sorted);
      var len = keys.length, i = -1;
      var arr = new Array(len);

      while (++i < len) {
        var key = keys[i];
        arr[i] = items[sorted[key]];
        sorted[key] = i;
      }

      this.items = arr;
      this.keyMap = sorted;
      return this;
    }
1082268
function getSpecificMap(map, array){
		var returnMap;
		var arrayCopy = array.splice(0);

		//if first item in array is "current" or "subnav" it makes the function a bit more efficient
		//it restricts any title searches to just offspring of the current page
		if (array[0] === 'current' || array[0] === 'subnav'){
			arrayCopy.shift();
			arrayCopy = pageMap.location.concat(link);
		}

		for (var i = 0; i < arrayCopy.length; i++){
			var searchTerm = arrayCopy[i];
			var searchMap = typeof returnMap !== 'undefined' ? returnMap : map;

			//Output an error if neither a string or an interval provided
			if (checkSearchTerm(searchTerm)){

				if (is_string(searchTerm)){
					//if item is a string, do a getTitleMap function on the search term using the last map
					returnMap = getTitleMap(searchMap, searchTerm);

				} else if(is_numeric(searchTerm) && isset(searchMap.subnav)) {
					//if item is a number, return the map at the specified index of the last map in array
					returnMap = searchMap.subnav[parseInt(searchTerm)];
				} else {
					returnMap = false;
					break;
				}
			} else {
				break;
			}
		}

		if (returnMap){
			return returnMap;
		} else {
			return false;
		}

	}
1321522
function runningMap(a, fn, init) {
  return a.map(v => init = fn(v, init));
}
1315550
def map(self, func, iterable, chunksize=None):
        
        # The key magic is that we must call r.get() with a timeout, because a
        # Condition.wait() without a timeout swallows KeyboardInterrupts.
        r = self.map_async(func, iterable, chunksize)

        while True:
            try:
                return r.get(self.wait_timeout)
            except TimeoutError:
                pass
            except KeyboardInterrupt:
                self.terminate()
                self.join()
                raise
138357
function map(arr, fun, thisp) {
        var i,
            length = arr.length,
            result = [];
        for (i = 0; i < length; i += 1) {
            if (arr.hasOwnProperty(i)) {
                result[i] = fun.call(thisp, arr[i], i, arr);
            }
        }
        return result;
    }
1253816
function(source, domap, thisp) {
		var result = {},
			mapping;
		this.each(source, function(key, value) {
			mapping = domap.call(thisp, key, value);
			if (mapping !== undefined) {
				result[key] = mapping;
			}
		});
		return result;
	}
501296
function mapLog(...tags) {
    /**
     * Array logge Prinst every value on separated line
     * @function printArray
     * @param {Array} message Printed list
     * @returns {Array}
     */
    function printArray(message) {
      if (active) {
        arrayCheck(message)
        const tag = normalizeDefaults(tags)
        //count length + 2. Also handles edge case with objects without 'length' field
        const spaceLn = P(
          length,
          defaultTo(0),
          add(2) )
        const ln = sum( map( spaceLn, tags ) )
        const spaces = new Array(ln)
          .fill(' ')
          .join('')

        const getFormatted = num => chalk.green(`<${num}>`)
        levelLogger( tag, getFormatted(0), head( message ) )
        const printTail = (e, i) => levelLogger(spaces, getFormatted(i+1), e)

        P(
          tail,
          indexedMap(printTail)
        )(message)
      }
      return message
    }
    return printArray
  }
679333
function enumerate(collection) {
    if (isObject(collection)) {
        if (collection instanceof Map) {
            return enumerateMap(collection)
        } else if (isIterable(collection)) {
            return enumerateIterable(collection)
        } else {
            return enumerateObject(collection)
        }
    } else {
        throw new TypeError("Object cannot be enumerated")
    }
}
126210
function getKeyFromList(list, key, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i][key] == value) {
            return list[i];
        }
    }
    return false;
}